From solipsis at pitrou.net Thu Nov 1 05:07:52 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Thu, 01 Nov 2018 09:07:52 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=7 Message-ID: <20181101090752.1.6761465670776A94@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [-7, 1, 7] memory blocks, sum=1 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_fork leaked [-2, 2, 0] memory blocks, sum=0 test_multiprocessing_forkserver leaked [2, 0, 0] memory blocks, sum=2 test_multiprocessing_spawn leaked [-1, -1, 2] memory blocks, sum=0 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogdDGf3b', '--timeout', '7200'] From webhook-mailer at python.org Thu Nov 1 06:33:48 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Thu, 01 Nov 2018 10:33:48 -0000 Subject: [Python-checkins] bpo-35128: Fix spacing issues in warning.warn() messages. (GH-10268) Message-ID: https://github.com/python/cpython/commit/4b5e62dbb22a3593e0db266c12f805b727a42b00 commit: 4b5e62dbb22a3593e0db266c12f805b727a42b00 branch: master author: Pablo Aguiar committer: Serhiy Storchaka date: 2018-11-01T12:33:35+02:00 summary: bpo-35128: Fix spacing issues in warning.warn() messages. (GH-10268) files: M Lib/bz2.py M Lib/ftplib.py M Lib/imaplib.py M Lib/poplib.py M Lib/smtplib.py diff --git a/Lib/bz2.py b/Lib/bz2.py index 3ab099147190..21e8ff49c67b 100644 --- a/Lib/bz2.py +++ b/Lib/bz2.py @@ -66,7 +66,7 @@ def __init__(self, filename, mode="r", buffering=_sentinel, compresslevel=9): self._mode = _MODE_CLOSED if buffering is not _sentinel: - warnings.warn("Use of 'buffering' argument is deprecated and ignored" + warnings.warn("Use of 'buffering' argument is deprecated and ignored " "since Python 3.0.", DeprecationWarning, stacklevel=2) diff --git a/Lib/ftplib.py b/Lib/ftplib.py index 05840d492360..9611282ecacb 100644 --- a/Lib/ftplib.py +++ b/Lib/ftplib.py @@ -732,7 +732,7 @@ def __init__(self, host='', user='', passwd='', acct='', keyfile=None, "exclusive") if keyfile is not None or certfile is not None: import warnings - warnings.warn("keyfile and certfile are deprecated, use a" + warnings.warn("keyfile and certfile are deprecated, use a " "custom context instead", DeprecationWarning, 2) self.keyfile = keyfile self.certfile = certfile diff --git a/Lib/imaplib.py b/Lib/imaplib.py index e451413acf5a..dd237f7704ac 100644 --- a/Lib/imaplib.py +++ b/Lib/imaplib.py @@ -1277,7 +1277,7 @@ def __init__(self, host='', port=IMAP4_SSL_PORT, keyfile=None, "exclusive") if keyfile is not None or certfile is not None: import warnings - warnings.warn("keyfile and certfile are deprecated, use a" + warnings.warn("keyfile and certfile are deprecated, use a " "custom ssl_context instead", DeprecationWarning, 2) self.keyfile = keyfile self.certfile = certfile diff --git a/Lib/poplib.py b/Lib/poplib.py index d8a62c034327..9796f0d2f9c5 100644 --- a/Lib/poplib.py +++ b/Lib/poplib.py @@ -436,7 +436,7 @@ def __init__(self, host, port=POP3_SSL_PORT, keyfile=None, certfile=None, "exclusive") if keyfile is not None or certfile is not None: import warnings - warnings.warn("keyfile and certfile are deprecated, use a" + warnings.warn("keyfile and certfile are deprecated, use a " "custom context instead", DeprecationWarning, 2) self.keyfile = keyfile self.certfile = certfile diff --git a/Lib/smtplib.py b/Lib/smtplib.py index acfc3586e1c0..3c5ac75ab8ab 100755 --- a/Lib/smtplib.py +++ b/Lib/smtplib.py @@ -764,7 +764,7 @@ def starttls(self, keyfile=None, certfile=None, context=None): "exclusive") if keyfile is not None or certfile is not None: import warnings - warnings.warn("keyfile and certfile are deprecated, use a" + warnings.warn("keyfile and certfile are deprecated, use a " "custom context instead", DeprecationWarning, 2) if context is None: context = ssl._create_stdlib_context(certfile=certfile, @@ -1021,7 +1021,7 @@ def __init__(self, host='', port=0, local_hostname=None, "exclusive") if keyfile is not None or certfile is not None: import warnings - warnings.warn("keyfile and certfile are deprecated, use a" + warnings.warn("keyfile and certfile are deprecated, use a " "custom context instead", DeprecationWarning, 2) self.keyfile = keyfile self.certfile = certfile From webhook-mailer at python.org Thu Nov 1 06:48:56 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 01 Nov 2018 10:48:56 -0000 Subject: [Python-checkins] bpo-33578: Add getstate/setstate for CJK codec (GH-6984) Message-ID: https://github.com/python/cpython/commit/ac22f6aa989f18c33c12615af1c66c73cf75d5e7 commit: ac22f6aa989f18c33c12615af1c66c73cf75d5e7 branch: master author: Christopher Thorne committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-11-01T03:48:49-07:00 summary: bpo-33578: Add getstate/setstate for CJK codec (GH-6984) This implements getstate and setstate for the cjkcodecs multibyte incremental encoders/decoders, primarily to fix issues with seek/tell. The encoder getstate/setstate is slightly tricky as the "state" is pending bytes + MultibyteCodec_State but only an integer can be returned. The approach I've taken is to encode this data into a long, similar to how .tell() encodes a "cookie_type" as a long. https://bugs.python.org/issue33578 files: A Misc/NEWS.d/next/Library/2018-06-08-23-55-34.bpo-33578.7oSsjG.rst M Lib/test/test_io.py M Lib/test/test_multibytecodec.py M Misc/ACKS M Modules/cjkcodecs/_codecs_cn.c M Modules/cjkcodecs/clinic/multibytecodec.c.h M Modules/cjkcodecs/multibytecodec.c M Modules/cjkcodecs/multibytecodec.h diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index d927bb96ceb5..14352ff84fff 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -2971,6 +2971,34 @@ def test_seek_and_tell_with_data(data, min_pos=0): finally: StatefulIncrementalDecoder.codecEnabled = 0 + def test_multibyte_seek_and_tell(self): + f = self.open(support.TESTFN, "w", encoding="euc_jp") + f.write("AB\n\u3046\u3048\n") + f.close() + + f = self.open(support.TESTFN, "r", encoding="euc_jp") + self.assertEqual(f.readline(), "AB\n") + p0 = f.tell() + self.assertEqual(f.readline(), "\u3046\u3048\n") + p1 = f.tell() + f.seek(p0) + self.assertEqual(f.readline(), "\u3046\u3048\n") + self.assertEqual(f.tell(), p1) + f.close() + + def test_seek_with_encoder_state(self): + f = self.open(support.TESTFN, "w", encoding="euc_jis_2004") + f.write("\u00e6\u0300") + p0 = f.tell() + f.write("\u00e6") + f.seek(p0) + f.write("\u0300") + f.close() + + f = self.open(support.TESTFN, "r", encoding="euc_jis_2004") + self.assertEqual(f.readline(), "\u00e6\u0300\u0300") + f.close() + def test_encoded_writes(self): data = "1234567890" tests = ("utf-16", diff --git a/Lib/test/test_multibytecodec.py b/Lib/test/test_multibytecodec.py index 01a1cd3c693c..8e8362b70fd0 100644 --- a/Lib/test/test_multibytecodec.py +++ b/Lib/test/test_multibytecodec.py @@ -117,6 +117,88 @@ def test_stateful_keep_buffer(self): self.assertRaises(UnicodeEncodeError, encoder.encode, '\u0123') self.assertEqual(encoder.encode('', True), b'\xa9\xdc') + def test_state_methods_with_buffer_state(self): + # euc_jis_2004 stores state as a buffer of pending bytes + encoder = codecs.getincrementalencoder('euc_jis_2004')() + + initial_state = encoder.getstate() + self.assertEqual(encoder.encode('\u00e6\u0300'), b'\xab\xc4') + encoder.setstate(initial_state) + self.assertEqual(encoder.encode('\u00e6\u0300'), b'\xab\xc4') + + self.assertEqual(encoder.encode('\u00e6'), b'') + partial_state = encoder.getstate() + self.assertEqual(encoder.encode('\u0300'), b'\xab\xc4') + encoder.setstate(partial_state) + self.assertEqual(encoder.encode('\u0300'), b'\xab\xc4') + + def test_state_methods_with_non_buffer_state(self): + # iso2022_jp stores state without using a buffer + encoder = codecs.getincrementalencoder('iso2022_jp')() + + self.assertEqual(encoder.encode('z'), b'z') + en_state = encoder.getstate() + + self.assertEqual(encoder.encode('\u3042'), b'\x1b\x24\x42\x24\x22') + jp_state = encoder.getstate() + self.assertEqual(encoder.encode('z'), b'\x1b\x28\x42z') + + encoder.setstate(jp_state) + self.assertEqual(encoder.encode('\u3042'), b'\x24\x22') + + encoder.setstate(en_state) + self.assertEqual(encoder.encode('z'), b'z') + + def test_getstate_returns_expected_value(self): + # Note: getstate is implemented such that these state values + # are expected to be the same across all builds of Python, + # regardless of x32/64 bit, endianness and compiler. + + # euc_jis_2004 stores state as a buffer of pending bytes + buffer_state_encoder = codecs.getincrementalencoder('euc_jis_2004')() + self.assertEqual(buffer_state_encoder.getstate(), 0) + buffer_state_encoder.encode('\u00e6') + self.assertEqual(buffer_state_encoder.getstate(), + int.from_bytes( + b"\x02" + b"\xc3\xa6" + b"\x00\x00\x00\x00\x00\x00\x00\x00", + 'little')) + buffer_state_encoder.encode('\u0300') + self.assertEqual(buffer_state_encoder.getstate(), 0) + + # iso2022_jp stores state without using a buffer + non_buffer_state_encoder = codecs.getincrementalencoder('iso2022_jp')() + self.assertEqual(non_buffer_state_encoder.getstate(), + int.from_bytes( + b"\x00" + b"\x42\x42\x00\x00\x00\x00\x00\x00", + 'little')) + non_buffer_state_encoder.encode('\u3042') + self.assertEqual(non_buffer_state_encoder.getstate(), + int.from_bytes( + b"\x00" + b"\xc2\x42\x00\x00\x00\x00\x00\x00", + 'little')) + + def test_setstate_validates_input_size(self): + encoder = codecs.getincrementalencoder('euc_jp')() + pending_size_nine = int.from_bytes( + b"\x09" + b"\x00\x00\x00\x00\x00\x00\x00\x00" + b"\x00\x00\x00\x00\x00\x00\x00\x00", + 'little') + self.assertRaises(UnicodeError, encoder.setstate, pending_size_nine) + + def test_setstate_validates_input_bytes(self): + encoder = codecs.getincrementalencoder('euc_jp')() + invalid_utf8 = int.from_bytes( + b"\x01" + b"\xff" + b"\x00\x00\x00\x00\x00\x00\x00\x00", + 'little') + self.assertRaises(UnicodeDecodeError, encoder.setstate, invalid_utf8) + def test_issue5640(self): encoder = codecs.getincrementalencoder('shift-jis')('backslashreplace') self.assertEqual(encoder.encode('\xff'), b'\\xff') @@ -165,6 +247,37 @@ def test_decode_unicode(self): decoder = codecs.getincrementaldecoder(enc)() self.assertRaises(TypeError, decoder.decode, "") + def test_state_methods(self): + decoder = codecs.getincrementaldecoder('euc_jp')() + + # Decode a complete input sequence + self.assertEqual(decoder.decode(b'\xa4\xa6'), '\u3046') + pending1, _ = decoder.getstate() + self.assertEqual(pending1, b'') + + # Decode first half of a partial input sequence + self.assertEqual(decoder.decode(b'\xa4'), '') + pending2, flags2 = decoder.getstate() + self.assertEqual(pending2, b'\xa4') + + # Decode second half of a partial input sequence + self.assertEqual(decoder.decode(b'\xa6'), '\u3046') + pending3, _ = decoder.getstate() + self.assertEqual(pending3, b'') + + # Jump back and decode second half of partial input sequence again + decoder.setstate((pending2, flags2)) + self.assertEqual(decoder.decode(b'\xa6'), '\u3046') + pending4, _ = decoder.getstate() + self.assertEqual(pending4, b'') + + def test_setstate_validates_input(self): + decoder = codecs.getincrementaldecoder('euc_jp')() + self.assertRaises(TypeError, decoder.setstate, 123) + self.assertRaises(TypeError, decoder.setstate, ("invalid", 0)) + self.assertRaises(TypeError, decoder.setstate, (b"1234", "invalid")) + self.assertRaises(UnicodeError, decoder.setstate, (b"123456789", 0)) + class Test_StreamReader(unittest.TestCase): def test_bug1728403(self): try: diff --git a/Misc/ACKS b/Misc/ACKS index 043d604a3f96..08ff6d11fdd0 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -1626,6 +1626,7 @@ Nicolas M. Thi?ry James Thomas Robin Thomas Brian Thorne +Christopher Thorne Stephen Thorne Jeremy Thurgood Eric Tiedemann diff --git a/Misc/NEWS.d/next/Library/2018-06-08-23-55-34.bpo-33578.7oSsjG.rst b/Misc/NEWS.d/next/Library/2018-06-08-23-55-34.bpo-33578.7oSsjG.rst new file mode 100644 index 000000000000..4e2e4627dc54 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-06-08-23-55-34.bpo-33578.7oSsjG.rst @@ -0,0 +1 @@ +Implement multibyte encoder/decoder state methods diff --git a/Modules/cjkcodecs/_codecs_cn.c b/Modules/cjkcodecs/_codecs_cn.c index 1fcc220b8db0..8a62f7e257c6 100644 --- a/Modules/cjkcodecs/_codecs_cn.c +++ b/Modules/cjkcodecs/_codecs_cn.c @@ -51,6 +51,12 @@ ; \ } +/* + * codecs in this file use the first byte of MultibyteCodec_State.c[8] + * to store a 0 or 1 state value + */ +#define CN_STATE_OFFSET 0 + /* * GB2312 codec */ @@ -329,15 +335,15 @@ DECODER(gb18030) ENCODER_INIT(hz) { - state->i = 0; + state->c[CN_STATE_OFFSET] = 0; return 0; } ENCODER_RESET(hz) { - if (state->i != 0) { + if (state->c[CN_STATE_OFFSET] != 0) { WRITEBYTE2('~', '}'); - state->i = 0; + state->c[CN_STATE_OFFSET] = 0; NEXT_OUT(2); } return 0; @@ -350,10 +356,10 @@ ENCODER(hz) DBCHAR code; if (c < 0x80) { - if (state->i) { + if (state->c[CN_STATE_OFFSET]) { WRITEBYTE2('~', '}'); NEXT_OUT(2); - state->i = 0; + state->c[CN_STATE_OFFSET] = 0; } WRITEBYTE1((unsigned char)c); NEXT(1, 1); @@ -375,10 +381,10 @@ ENCODER(hz) if (code & 0x8000) /* MSB set: GBK */ return 1; - if (state->i == 0) { + if (state->c[CN_STATE_OFFSET] == 0) { WRITEBYTE4('~', '{', code >> 8, code & 0xff); NEXT(1, 4); - state->i = 1; + state->c[CN_STATE_OFFSET] = 1; } else { WRITEBYTE2(code >> 8, code & 0xff); @@ -391,13 +397,13 @@ ENCODER(hz) DECODER_INIT(hz) { - state->i = 0; + state->c[CN_STATE_OFFSET] = 0; return 0; } DECODER_RESET(hz) { - state->i = 0; + state->c[CN_STATE_OFFSET] = 0; return 0; } @@ -411,14 +417,14 @@ DECODER(hz) unsigned char c2 = INBYTE2; REQUIRE_INBUF(2); - if (c2 == '~' && state->i == 0) + if (c2 == '~' && state->c[CN_STATE_OFFSET] == 0) OUTCHAR('~'); - else if (c2 == '{' && state->i == 0) - state->i = 1; /* set GB */ - else if (c2 == '\n' && state->i == 0) + else if (c2 == '{' && state->c[CN_STATE_OFFSET] == 0) + state->c[CN_STATE_OFFSET] = 1; /* set GB */ + else if (c2 == '\n' && state->c[CN_STATE_OFFSET] == 0) ; /* line-continuation */ - else if (c2 == '}' && state->i == 1) - state->i = 0; /* set ASCII */ + else if (c2 == '}' && state->c[CN_STATE_OFFSET] == 1) + state->c[CN_STATE_OFFSET] = 0; /* set ASCII */ else return 1; NEXT_IN(2); @@ -428,7 +434,7 @@ DECODER(hz) if (c & 0x80) return 1; - if (state->i == 0) { /* ASCII mode */ + if (state->c[CN_STATE_OFFSET] == 0) { /* ASCII mode */ OUTCHAR(c); NEXT_IN(1); } diff --git a/Modules/cjkcodecs/clinic/multibytecodec.c.h b/Modules/cjkcodecs/clinic/multibytecodec.c.h index 25857fc6d6f0..a58bb646a411 100644 --- a/Modules/cjkcodecs/clinic/multibytecodec.c.h +++ b/Modules/cjkcodecs/clinic/multibytecodec.c.h @@ -115,6 +115,50 @@ _multibytecodec_MultibyteIncrementalEncoder_encode(MultibyteIncrementalEncoderOb return return_value; } +PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalEncoder_getstate__doc__, +"getstate($self, /)\n" +"--\n" +"\n"); + +#define _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_GETSTATE_METHODDEF \ + {"getstate", (PyCFunction)_multibytecodec_MultibyteIncrementalEncoder_getstate, METH_NOARGS, _multibytecodec_MultibyteIncrementalEncoder_getstate__doc__}, + +static PyObject * +_multibytecodec_MultibyteIncrementalEncoder_getstate_impl(MultibyteIncrementalEncoderObject *self); + +static PyObject * +_multibytecodec_MultibyteIncrementalEncoder_getstate(MultibyteIncrementalEncoderObject *self, PyObject *Py_UNUSED(ignored)) +{ + return _multibytecodec_MultibyteIncrementalEncoder_getstate_impl(self); +} + +PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalEncoder_setstate__doc__, +"setstate($self, state, /)\n" +"--\n" +"\n"); + +#define _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_SETSTATE_METHODDEF \ + {"setstate", (PyCFunction)_multibytecodec_MultibyteIncrementalEncoder_setstate, METH_O, _multibytecodec_MultibyteIncrementalEncoder_setstate__doc__}, + +static PyObject * +_multibytecodec_MultibyteIncrementalEncoder_setstate_impl(MultibyteIncrementalEncoderObject *self, + PyLongObject *statelong); + +static PyObject * +_multibytecodec_MultibyteIncrementalEncoder_setstate(MultibyteIncrementalEncoderObject *self, PyObject *arg) +{ + PyObject *return_value = NULL; + PyLongObject *statelong; + + if (!PyArg_Parse(arg, "O!:setstate", &PyLong_Type, &statelong)) { + goto exit; + } + return_value = _multibytecodec_MultibyteIncrementalEncoder_setstate_impl(self, statelong); + +exit: + return return_value; +} + PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalEncoder_reset__doc__, "reset($self, /)\n" "--\n" @@ -169,6 +213,50 @@ _multibytecodec_MultibyteIncrementalDecoder_decode(MultibyteIncrementalDecoderOb return return_value; } +PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_getstate__doc__, +"getstate($self, /)\n" +"--\n" +"\n"); + +#define _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_GETSTATE_METHODDEF \ + {"getstate", (PyCFunction)_multibytecodec_MultibyteIncrementalDecoder_getstate, METH_NOARGS, _multibytecodec_MultibyteIncrementalDecoder_getstate__doc__}, + +static PyObject * +_multibytecodec_MultibyteIncrementalDecoder_getstate_impl(MultibyteIncrementalDecoderObject *self); + +static PyObject * +_multibytecodec_MultibyteIncrementalDecoder_getstate(MultibyteIncrementalDecoderObject *self, PyObject *Py_UNUSED(ignored)) +{ + return _multibytecodec_MultibyteIncrementalDecoder_getstate_impl(self); +} + +PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_setstate__doc__, +"setstate($self, state, /)\n" +"--\n" +"\n"); + +#define _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_SETSTATE_METHODDEF \ + {"setstate", (PyCFunction)_multibytecodec_MultibyteIncrementalDecoder_setstate, METH_O, _multibytecodec_MultibyteIncrementalDecoder_setstate__doc__}, + +static PyObject * +_multibytecodec_MultibyteIncrementalDecoder_setstate_impl(MultibyteIncrementalDecoderObject *self, + PyObject *state); + +static PyObject * +_multibytecodec_MultibyteIncrementalDecoder_setstate(MultibyteIncrementalDecoderObject *self, PyObject *arg) +{ + PyObject *return_value = NULL; + PyObject *state; + + if (!PyArg_Parse(arg, "O!:setstate", &PyTuple_Type, &state)) { + goto exit; + } + return_value = _multibytecodec_MultibyteIncrementalDecoder_setstate_impl(self, state); + +exit: + return return_value; +} + PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_reset__doc__, "reset($self, /)\n" "--\n" @@ -330,4 +418,4 @@ PyDoc_STRVAR(_multibytecodec___create_codec__doc__, #define _MULTIBYTECODEC___CREATE_CODEC_METHODDEF \ {"__create_codec", (PyCFunction)_multibytecodec___create_codec, METH_O, _multibytecodec___create_codec__doc__}, -/*[clinic end generated code: output=680f59f4cfe63c25 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=2fa0a38494716b97 input=a9049054013a1b77]*/ diff --git a/Modules/cjkcodecs/multibytecodec.c b/Modules/cjkcodecs/multibytecodec.c index 22172b043bcd..4633499a8abf 100644 --- a/Modules/cjkcodecs/multibytecodec.c +++ b/Modules/cjkcodecs/multibytecodec.c @@ -895,6 +895,93 @@ _multibytecodec_MultibyteIncrementalEncoder_encode_impl(MultibyteIncrementalEnco return encoder_encode_stateful(STATEFUL_ECTX(self), input, final); } +/*[clinic input] +_multibytecodec.MultibyteIncrementalEncoder.getstate +[clinic start generated code]*/ + +static PyObject * +_multibytecodec_MultibyteIncrementalEncoder_getstate_impl(MultibyteIncrementalEncoderObject *self) +/*[clinic end generated code: output=9794a5ace70d7048 input=4a2a82874ffa40bb]*/ +{ + /* state made up of 1 byte for buffer size, up to MAXENCPENDING*4 bytes + for UTF-8 encoded buffer (each character can use up to 4 + bytes), and required bytes for MultibyteCodec_State.c. A byte + array is used to avoid different compilers generating different + values for the same state, e.g. as a result of struct padding. + */ + unsigned char statebytes[1 + MAXENCPENDING*4 + sizeof(self->state.c)]; + Py_ssize_t statesize; + const char *pendingbuffer = NULL; + Py_ssize_t pendingsize; + + if (self->pending != NULL) { + pendingbuffer = PyUnicode_AsUTF8AndSize(self->pending, &pendingsize); + if (pendingbuffer == NULL) { + return NULL; + } + if (pendingsize > MAXENCPENDING*4) { + PyErr_SetString(PyExc_UnicodeError, "pending buffer too large"); + return NULL; + } + statebytes[0] = pendingsize; + memcpy(statebytes+1, pendingbuffer, pendingsize); + statesize = 1 + pendingsize; + } else { + statebytes[0] = 0; + statesize = 1; + } + memcpy(statebytes+statesize, self->state.c, + sizeof(self->state.c)); + statesize += sizeof(self->state.c); + + return (PyObject *)_PyLong_FromByteArray(statebytes, statesize, + 1 /* little-endian */ , + 0 /* unsigned */ ); +} + +/*[clinic input] +_multibytecodec.MultibyteIncrementalEncoder.setstate + state as statelong: object(type='PyLongObject *', subclass_of='&PyLong_Type') + / +[clinic start generated code]*/ + +static PyObject * +_multibytecodec_MultibyteIncrementalEncoder_setstate_impl(MultibyteIncrementalEncoderObject *self, + PyLongObject *statelong) +/*[clinic end generated code: output=4e5e98ac1f4039ca input=c80fb5830d4d2f76]*/ +{ + PyObject *pending = NULL; + unsigned char statebytes[1 + MAXENCPENDING*4 + sizeof(self->state.c)]; + + if (_PyLong_AsByteArray(statelong, statebytes, sizeof(statebytes), + 1 /* little-endian */ , + 0 /* unsigned */ ) < 0) { + goto errorexit; + } + + if (statebytes[0] > MAXENCPENDING*4) { + PyErr_SetString(PyExc_UnicodeError, "pending buffer too large"); + return NULL; + } + + pending = PyUnicode_DecodeUTF8((const char *)statebytes+1, + statebytes[0], "strict"); + if (pending == NULL) { + goto errorexit; + } + + Py_CLEAR(self->pending); + self->pending = pending; + memcpy(self->state.c, statebytes+1+statebytes[0], + sizeof(self->state.c)); + + Py_RETURN_NONE; + +errorexit: + Py_XDECREF(pending); + return NULL; +} + /*[clinic input] _multibytecodec.MultibyteIncrementalEncoder.reset [clinic start generated code]*/ @@ -919,6 +1006,8 @@ _multibytecodec_MultibyteIncrementalEncoder_reset_impl(MultibyteIncrementalEncod static struct PyMethodDef mbiencoder_methods[] = { _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_ENCODE_METHODDEF + _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_GETSTATE_METHODDEF + _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_SETSTATE_METHODDEF _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_RESET_METHODDEF {NULL, NULL}, }; @@ -984,6 +1073,7 @@ mbiencoder_dealloc(MultibyteIncrementalEncoderObject *self) { PyObject_GC_UnTrack(self); ERROR_DECREF(self->errors); + Py_CLEAR(self->pending); Py_TYPE(self)->tp_free(self); } @@ -1119,6 +1209,68 @@ _multibytecodec_MultibyteIncrementalDecoder_decode_impl(MultibyteIncrementalDeco return NULL; } +/*[clinic input] +_multibytecodec.MultibyteIncrementalDecoder.getstate +[clinic start generated code]*/ + +static PyObject * +_multibytecodec_MultibyteIncrementalDecoder_getstate_impl(MultibyteIncrementalDecoderObject *self) +/*[clinic end generated code: output=255009c4713b7f82 input=4006aa49bddbaa75]*/ +{ + PyObject *buffer; + + buffer = PyBytes_FromStringAndSize((const char *)self->pending, + self->pendingsize); + if (buffer == NULL) { + return NULL; + } + + return make_tuple(buffer, (Py_ssize_t)*self->state.c); +} + +/*[clinic input] +_multibytecodec.MultibyteIncrementalDecoder.setstate + state: object(subclass_of='&PyTuple_Type') + / +[clinic start generated code]*/ + +static PyObject * +_multibytecodec_MultibyteIncrementalDecoder_setstate_impl(MultibyteIncrementalDecoderObject *self, + PyObject *state) +/*[clinic end generated code: output=106b2fbca3e2dcc2 input=e5d794e8baba1a47]*/ +{ + PyObject *buffer; + Py_ssize_t buffersize; + char *bufferstr; + unsigned long long flag; + + if (!PyArg_ParseTuple(state, "SK;setstate(): illegal state argument", + &buffer, &flag)) + { + return NULL; + } + + buffersize = PyBytes_Size(buffer); + if (buffersize == -1) { + return NULL; + } + + if (buffersize > MAXDECPENDING) { + PyErr_SetString(PyExc_UnicodeError, "pending buffer too large"); + return NULL; + } + + bufferstr = PyBytes_AsString(buffer); + if (bufferstr == NULL) { + return NULL; + } + self->pendingsize = buffersize; + memcpy(self->pending, bufferstr, self->pendingsize); + memcpy(self->state.c, (unsigned char *)&flag, sizeof(flag)); + + Py_RETURN_NONE; +} + /*[clinic input] _multibytecodec.MultibyteIncrementalDecoder.reset [clinic start generated code]*/ @@ -1137,6 +1289,8 @@ _multibytecodec_MultibyteIncrementalDecoder_reset_impl(MultibyteIncrementalDecod static struct PyMethodDef mbidecoder_methods[] = { _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_DECODE_METHODDEF + _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_GETSTATE_METHODDEF + _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_SETSTATE_METHODDEF _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_RESET_METHODDEF {NULL, NULL}, }; diff --git a/Modules/cjkcodecs/multibytecodec.h b/Modules/cjkcodecs/multibytecodec.h index 5b8c22276b4b..6d34534ee685 100644 --- a/Modules/cjkcodecs/multibytecodec.h +++ b/Modules/cjkcodecs/multibytecodec.h @@ -16,12 +16,15 @@ typedef uint16_t ucs2_t, DBCHAR; typedef unsigned short ucs2_t, DBCHAR; #endif -typedef union { - void *p; - int i; +/* + * A struct that provides 8 bytes of state for multibyte + * codecs. Codecs are free to use this how they want. Note: if you + * need to add a new field to this struct, ensure that its byte order + * is independent of CPU endianness so that the return value of + * getstate doesn't differ between little and big endian CPUs. + */ +typedef struct { unsigned char c[8]; - ucs2_t u2[4]; - Py_UCS4 u4[2]; } MultibyteCodec_State; typedef int (*mbcodec_init)(const void *config); From webhook-mailer at python.org Thu Nov 1 08:19:28 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Thu, 01 Nov 2018 12:19:28 -0000 Subject: [Python-checkins] [3.7] bpo-35128: Fix spacing issues in warning.warn() messages. (GH-10268). (GH-10280) Message-ID: https://github.com/python/cpython/commit/5e0537cf7e5b0a5ef134c7da0b68b8e55c69f4b0 commit: 5e0537cf7e5b0a5ef134c7da0b68b8e55c69f4b0 branch: 3.7 author: Serhiy Storchaka committer: GitHub date: 2018-11-01T14:19:23+02:00 summary: [3.7] bpo-35128: Fix spacing issues in warning.warn() messages. (GH-10268). (GH-10280) (cherry picked from commit 4b5e62dbb22a3593e0db266c12f805b727a42b00) Co-authored-by: Pablo Aguiar files: M Lib/ftplib.py M Lib/imaplib.py M Lib/poplib.py M Lib/smtplib.py diff --git a/Lib/ftplib.py b/Lib/ftplib.py index 05840d492360..9611282ecacb 100644 --- a/Lib/ftplib.py +++ b/Lib/ftplib.py @@ -732,7 +732,7 @@ def __init__(self, host='', user='', passwd='', acct='', keyfile=None, "exclusive") if keyfile is not None or certfile is not None: import warnings - warnings.warn("keyfile and certfile are deprecated, use a" + warnings.warn("keyfile and certfile are deprecated, use a " "custom context instead", DeprecationWarning, 2) self.keyfile = keyfile self.certfile = certfile diff --git a/Lib/imaplib.py b/Lib/imaplib.py index e451413acf5a..dd237f7704ac 100644 --- a/Lib/imaplib.py +++ b/Lib/imaplib.py @@ -1277,7 +1277,7 @@ def __init__(self, host='', port=IMAP4_SSL_PORT, keyfile=None, "exclusive") if keyfile is not None or certfile is not None: import warnings - warnings.warn("keyfile and certfile are deprecated, use a" + warnings.warn("keyfile and certfile are deprecated, use a " "custom ssl_context instead", DeprecationWarning, 2) self.keyfile = keyfile self.certfile = certfile diff --git a/Lib/poplib.py b/Lib/poplib.py index d8a62c034327..9796f0d2f9c5 100644 --- a/Lib/poplib.py +++ b/Lib/poplib.py @@ -436,7 +436,7 @@ def __init__(self, host, port=POP3_SSL_PORT, keyfile=None, certfile=None, "exclusive") if keyfile is not None or certfile is not None: import warnings - warnings.warn("keyfile and certfile are deprecated, use a" + warnings.warn("keyfile and certfile are deprecated, use a " "custom context instead", DeprecationWarning, 2) self.keyfile = keyfile self.certfile = certfile diff --git a/Lib/smtplib.py b/Lib/smtplib.py index 5e1bc0b198ed..6091c7fb7aca 100755 --- a/Lib/smtplib.py +++ b/Lib/smtplib.py @@ -762,7 +762,7 @@ def starttls(self, keyfile=None, certfile=None, context=None): "exclusive") if keyfile is not None or certfile is not None: import warnings - warnings.warn("keyfile and certfile are deprecated, use a" + warnings.warn("keyfile and certfile are deprecated, use a " "custom context instead", DeprecationWarning, 2) if context is None: context = ssl._create_stdlib_context(certfile=certfile, @@ -1019,7 +1019,7 @@ def __init__(self, host='', port=0, local_hostname=None, "exclusive") if keyfile is not None or certfile is not None: import warnings - warnings.warn("keyfile and certfile are deprecated, use a" + warnings.warn("keyfile and certfile are deprecated, use a " "custom context instead", DeprecationWarning, 2) self.keyfile = keyfile self.certfile = certfile From webhook-mailer at python.org Thu Nov 1 08:19:41 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Thu, 01 Nov 2018 12:19:41 -0000 Subject: [Python-checkins] [3.6] bpo-35128: Fix spacing issues in warning.warn() messages. (GH-10268). (GH-10281) Message-ID: https://github.com/python/cpython/commit/89138f286938753f273c90547491efe374e617c1 commit: 89138f286938753f273c90547491efe374e617c1 branch: 3.6 author: Serhiy Storchaka committer: GitHub date: 2018-11-01T14:19:37+02:00 summary: [3.6] bpo-35128: Fix spacing issues in warning.warn() messages. (GH-10268). (GH-10281) (cherry picked from commit 4b5e62dbb22a3593e0db266c12f805b727a42b00) Co-authored-by: Pablo Aguiar files: M Lib/ftplib.py M Lib/imaplib.py M Lib/poplib.py M Lib/smtplib.py diff --git a/Lib/ftplib.py b/Lib/ftplib.py index a02e595cb022..2ff251a0f7d9 100644 --- a/Lib/ftplib.py +++ b/Lib/ftplib.py @@ -732,7 +732,7 @@ def __init__(self, host='', user='', passwd='', acct='', keyfile=None, "exclusive") if keyfile is not None or certfile is not None: import warnings - warnings.warn("keyfile and certfile are deprecated, use a" + warnings.warn("keyfile and certfile are deprecated, use a " "custom context instead", DeprecationWarning, 2) self.keyfile = keyfile self.certfile = certfile diff --git a/Lib/imaplib.py b/Lib/imaplib.py index b9a01d636f78..67b2cc02c40f 100644 --- a/Lib/imaplib.py +++ b/Lib/imaplib.py @@ -1277,7 +1277,7 @@ def __init__(self, host='', port=IMAP4_SSL_PORT, keyfile=None, "exclusive") if keyfile is not None or certfile is not None: import warnings - warnings.warn("keyfile and certfile are deprecated, use a" + warnings.warn("keyfile and certfile are deprecated, use a " "custom ssl_context instead", DeprecationWarning, 2) self.keyfile = keyfile self.certfile = certfile diff --git a/Lib/poplib.py b/Lib/poplib.py index d8a62c034327..9796f0d2f9c5 100644 --- a/Lib/poplib.py +++ b/Lib/poplib.py @@ -436,7 +436,7 @@ def __init__(self, host, port=POP3_SSL_PORT, keyfile=None, certfile=None, "exclusive") if keyfile is not None or certfile is not None: import warnings - warnings.warn("keyfile and certfile are deprecated, use a" + warnings.warn("keyfile and certfile are deprecated, use a " "custom context instead", DeprecationWarning, 2) self.keyfile = keyfile self.certfile = certfile diff --git a/Lib/smtplib.py b/Lib/smtplib.py index 5e1bc0b198ed..6091c7fb7aca 100755 --- a/Lib/smtplib.py +++ b/Lib/smtplib.py @@ -762,7 +762,7 @@ def starttls(self, keyfile=None, certfile=None, context=None): "exclusive") if keyfile is not None or certfile is not None: import warnings - warnings.warn("keyfile and certfile are deprecated, use a" + warnings.warn("keyfile and certfile are deprecated, use a " "custom context instead", DeprecationWarning, 2) if context is None: context = ssl._create_stdlib_context(certfile=certfile, @@ -1019,7 +1019,7 @@ def __init__(self, host='', port=0, local_hostname=None, "exclusive") if keyfile is not None or certfile is not None: import warnings - warnings.warn("keyfile and certfile are deprecated, use a" + warnings.warn("keyfile and certfile are deprecated, use a " "custom context instead", DeprecationWarning, 2) self.keyfile = keyfile self.certfile = certfile From webhook-mailer at python.org Thu Nov 1 08:29:44 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 01 Nov 2018 12:29:44 -0000 Subject: [Python-checkins] bpo-35075: Fix broken url in the pprint documentation (GH-10201) Message-ID: https://github.com/python/cpython/commit/bf46a09dec372b85846216bd692d648dac08ac36 commit: bf46a09dec372b85846216bd692d648dac08ac36 branch: master author: Pablo Galindo committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-11-01T05:29:38-07:00 summary: bpo-35075: Fix broken url in the pprint documentation (GH-10201) https://bugs.python.org/issue35075 files: M Doc/library/pprint.rst M Doc/tools/susp-ignored.csv diff --git a/Doc/library/pprint.rst b/Doc/library/pprint.rst index aa97d3eabafa..3922a768311c 100644 --- a/Doc/library/pprint.rst +++ b/Doc/library/pprint.rst @@ -217,135 +217,156 @@ let's fetch information about a project from `PyPI `_:: >>> import json >>> import pprint >>> from urllib.request import urlopen - >>> with urlopen('http://pypi.org/project/Twisted/json') as url: - ... http_info = url.info() - ... raw_data = url.read().decode(http_info.get_content_charset()) - >>> project_info = json.loads(raw_data) + >>> with urlopen('https://pypi.org/pypi/sampleproject/json') as resp: + ... project_info = json.load(resp)['info'] In its basic form, :func:`pprint` shows the whole object:: >>> pprint.pprint(project_info) - {'info': {'_pypi_hidden': False, - '_pypi_ordering': 125, - 'author': 'Glyph Lefkowitz', - 'author_email': 'glyph at twistedmatrix.com', - 'bugtrack_url': '', - 'cheesecake_code_kwalitee_id': None, - 'cheesecake_documentation_id': None, - 'cheesecake_installability_id': None, - 'classifiers': ['Programming Language :: Python :: 2.6', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 2 :: Only'], - 'description': 'An extensible framework for Python programming, with ' - 'special focus\r\n' - 'on event-based network programming and multiprotocol ' - 'integration.', - 'docs_url': '', - 'download_url': 'UNKNOWN', - 'home_page': 'http://twistedmatrix.com/', - 'keywords': '', - 'license': 'MIT', - 'maintainer': '', - 'maintainer_email': '', - 'name': 'Twisted', - 'package_url': 'http://pypi.org/project/Twisted', - 'platform': 'UNKNOWN', - 'release_url': 'http://pypi.org/project/Twisted/12.3.0', - 'requires_python': None, - 'stable_version': None, - 'summary': 'An asynchronous networking framework written in Python', - 'version': '12.3.0'}, - 'urls': [{'comment_text': '', - 'downloads': 71844, - 'filename': 'Twisted-12.3.0.tar.bz2', - 'has_sig': False, - 'md5_digest': '6e289825f3bf5591cfd670874cc0862d', - 'packagetype': 'sdist', - 'python_version': 'source', - 'size': 2615733, - 'upload_time': '2012-12-26T12:47:03', - 'url': 'https://pypi.org/packages/source/T/Twisted/Twisted-12.3.0.tar.bz2'}, - {'comment_text': '', - 'downloads': 5224, - 'filename': 'Twisted-12.3.0.win32-py2.7.msi', - 'has_sig': False, - 'md5_digest': '6b778f5201b622a5519a2aca1a2fe512', - 'packagetype': 'bdist_msi', - 'python_version': '2.7', - 'size': 2916352, - 'upload_time': '2012-12-26T12:48:15', - 'url': 'https://pypi.org/packages/2.7/T/Twisted/Twisted-12.3.0.win32-py2.7.msi'}]} + {'author': 'The Python Packaging Authority', + 'author_email': 'pypa-dev at googlegroups.com', + 'bugtrack_url': None, + 'classifiers': ['Development Status :: 3 - Alpha', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.6', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.2', + 'Programming Language :: Python :: 3.3', + 'Programming Language :: Python :: 3.4', + 'Topic :: Software Development :: Build Tools'], + 'description': 'A sample Python project\n' + '=======================\n' + '\n' + 'This is the description file for the project.\n' + '\n' + 'The file should use UTF-8 encoding and be written using ' + 'ReStructured Text. It\n' + 'will be used to generate the project webpage on PyPI, and ' + 'should be written for\n' + 'that purpose.\n' + '\n' + 'Typical contents for this file would include an overview of ' + 'the project, basic\n' + 'usage examples, etc. Generally, including the project ' + 'changelog in here is not\n' + 'a good idea, although a simple "What\'s New" section for the ' + 'most recent version\n' + 'may be appropriate.', + 'description_content_type': None, + 'docs_url': None, + 'download_url': 'UNKNOWN', + 'downloads': {'last_day': -1, 'last_month': -1, 'last_week': -1}, + 'home_page': 'https://github.com/pypa/sampleproject', + 'keywords': 'sample setuptools development', + 'license': 'MIT', + 'maintainer': None, + 'maintainer_email': None, + 'name': 'sampleproject', + 'package_url': 'https://pypi.org/project/sampleproject/', + 'platform': 'UNKNOWN', + 'project_url': 'https://pypi.org/project/sampleproject/', + 'project_urls': {'Download': 'UNKNOWN', + 'Homepage': 'https://github.com/pypa/sampleproject'}, + 'release_url': 'https://pypi.org/project/sampleproject/1.2.0/', + 'requires_dist': None, + 'requires_python': None, + 'summary': 'A sample Python project', + 'version': '1.2.0'} The result can be limited to a certain *depth* (ellipsis is used for deeper contents):: - >>> pprint.pprint(project_info, depth=2) - {'info': {'_pypi_hidden': False, - '_pypi_ordering': 125, - 'author': 'Glyph Lefkowitz', - 'author_email': 'glyph at twistedmatrix.com', - 'bugtrack_url': '', - 'cheesecake_code_kwalitee_id': None, - 'cheesecake_documentation_id': None, - 'cheesecake_installability_id': None, - 'classifiers': [...], - 'description': 'An extensible framework for Python programming, with ' - 'special focus\r\n' - 'on event-based network programming and multiprotocol ' - 'integration.', - 'docs_url': '', - 'download_url': 'UNKNOWN', - 'home_page': 'http://twistedmatrix.com/', - 'keywords': '', - 'license': 'MIT', - 'maintainer': '', - 'maintainer_email': '', - 'name': 'Twisted', - 'package_url': 'http://pypi.org/project/Twisted', - 'platform': 'UNKNOWN', - 'release_url': 'http://pypi.org/project/Twisted/12.3.0', - 'requires_python': None, - 'stable_version': None, - 'summary': 'An asynchronous networking framework written in Python', - 'version': '12.3.0'}, - 'urls': [{...}, {...}]} + >>> pprint.pprint(project_info, depth=1) + {'author': 'The Python Packaging Authority', + 'author_email': 'pypa-dev at googlegroups.com', + 'bugtrack_url': None, + 'classifiers': [...], + 'description': 'A sample Python project\n' + '=======================\n' + '\n' + 'This is the description file for the project.\n' + '\n' + 'The file should use UTF-8 encoding and be written using ' + 'ReStructured Text. It\n' + 'will be used to generate the project webpage on PyPI, and ' + 'should be written for\n' + 'that purpose.\n' + '\n' + 'Typical contents for this file would include an overview of ' + 'the project, basic\n' + 'usage examples, etc. Generally, including the project ' + 'changelog in here is not\n' + 'a good idea, although a simple "What\'s New" section for the ' + 'most recent version\n' + 'may be appropriate.', + 'description_content_type': None, + 'docs_url': None, + 'download_url': 'UNKNOWN', + 'downloads': {...}, + 'home_page': 'https://github.com/pypa/sampleproject', + 'keywords': 'sample setuptools development', + 'license': 'MIT', + 'maintainer': None, + 'maintainer_email': None, + 'name': 'sampleproject', + 'package_url': 'https://pypi.org/project/sampleproject/', + 'platform': 'UNKNOWN', + 'project_url': 'https://pypi.org/project/sampleproject/', + 'project_urls': {...}, + 'release_url': 'https://pypi.org/project/sampleproject/1.2.0/', + 'requires_dist': None, + 'requires_python': None, + 'summary': 'A sample Python project', + 'version': '1.2.0'} Additionally, maximum character *width* can be suggested. If a long object cannot be split, the specified width will be exceeded:: - >>> pprint.pprint(project_info, depth=2, width=50) - {'info': {'_pypi_hidden': False, - '_pypi_ordering': 125, - 'author': 'Glyph Lefkowitz', - 'author_email': 'glyph at twistedmatrix.com', - 'bugtrack_url': '', - 'cheesecake_code_kwalitee_id': None, - 'cheesecake_documentation_id': None, - 'cheesecake_installability_id': None, - 'classifiers': [...], - 'description': 'An extensible ' - 'framework for Python ' - 'programming, with ' - 'special focus\r\n' - 'on event-based network ' - 'programming and ' - 'multiprotocol ' - 'integration.', - 'docs_url': '', - 'download_url': 'UNKNOWN', - 'home_page': 'http://twistedmatrix.com/', - 'keywords': '', - 'license': 'MIT', - 'maintainer': '', - 'maintainer_email': '', - 'name': 'Twisted', - 'package_url': 'http://pypi.org/project/Twisted', - 'platform': 'UNKNOWN', - 'release_url': 'http://pypi.org/project/Twisted/12.3.0', - 'requires_python': None, - 'stable_version': None, - 'summary': 'An asynchronous networking ' - 'framework written in ' - 'Python', - 'version': '12.3.0'}, - 'urls': [{...}, {...}]} + >>> pprint.pprint(project_info, depth=1, width=60) + {'author': 'The Python Packaging Authority', + 'author_email': 'pypa-dev at googlegroups.com', + 'bugtrack_url': None, + 'classifiers': [...], + 'description': 'A sample Python project\n' + '=======================\n' + '\n' + 'This is the description file for the ' + 'project.\n' + '\n' + 'The file should use UTF-8 encoding and be ' + 'written using ReStructured Text. It\n' + 'will be used to generate the project ' + 'webpage on PyPI, and should be written ' + 'for\n' + 'that purpose.\n' + '\n' + 'Typical contents for this file would ' + 'include an overview of the project, ' + 'basic\n' + 'usage examples, etc. Generally, including ' + 'the project changelog in here is not\n' + 'a good idea, although a simple "What\'s ' + 'New" section for the most recent version\n' + 'may be appropriate.', + 'description_content_type': None, + 'docs_url': None, + 'download_url': 'UNKNOWN', + 'downloads': {...}, + 'home_page': 'https://github.com/pypa/sampleproject', + 'keywords': 'sample setuptools development', + 'license': 'MIT', + 'maintainer': None, + 'maintainer_email': None, + 'name': 'sampleproject', + 'package_url': 'https://pypi.org/project/sampleproject/', + 'platform': 'UNKNOWN', + 'project_url': 'https://pypi.org/project/sampleproject/', + 'project_urls': {...}, + 'release_url': 'https://pypi.org/project/sampleproject/1.2.0/', + 'requires_dist': None, + 'requires_python': None, + 'summary': 'A sample Python project', + 'version': '1.2.0'} diff --git a/Doc/tools/susp-ignored.csv b/Doc/tools/susp-ignored.csv index bb3310bac75f..118ac1554b59 100644 --- a/Doc/tools/susp-ignored.csv +++ b/Doc/tools/susp-ignored.csv @@ -178,9 +178,17 @@ library/pathlib,,:Program,>>> PureWindowsPath('c:Program Files/').anchor library/pdb,,:lineno,filename:lineno library/pickle,,:memory,"conn = sqlite3.connect("":memory:"")" library/posix,,`,"CFLAGS=""`getconf LFS_CFLAGS`"" OPT=""-g -O2 $CFLAGS""" -library/pprint,,::,"'Programming Language :: Python :: 2 :: Only']," library/pprint,,::,"'Programming Language :: Python :: 2.6'," library/pprint,,::,"'Programming Language :: Python :: 2.7'," +library/pprint,225,::,"'classifiers': ['Development Status :: 3 - Alpha'," +library/pprint,225,::,"'Intended Audience :: Developers'," +library/pprint,225,::,"'License :: OSI Approved :: MIT License'," +library/pprint,225,::,"'Programming Language :: Python :: 2'," +library/pprint,225,::,"'Programming Language :: Python :: 3'," +library/pprint,225,::,"'Programming Language :: Python :: 3.2'," +library/pprint,225,::,"'Programming Language :: Python :: 3.3'," +library/pprint,225,::,"'Programming Language :: Python :: 3.4'," +library/pprint,225,::,"'Topic :: Software Development :: Build Tools']," library/profile,,:lineno,filename:lineno(function) library/pyexpat,,:elem1, library/pyexpat,,:py,"xmlns:py = ""http://www.python.org/ns/"">" From webhook-mailer at python.org Thu Nov 1 09:37:34 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 01 Nov 2018 13:37:34 -0000 Subject: [Python-checkins] bpo-35075: Fix broken url in the pprint documentation (GH-10201) Message-ID: https://github.com/python/cpython/commit/7344b9fa0ef7bd8b902e7aa9a8f74b5dce915e59 commit: 7344b9fa0ef7bd8b902e7aa9a8f74b5dce915e59 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-01T06:37:28-07:00 summary: bpo-35075: Fix broken url in the pprint documentation (GH-10201) https://bugs.python.org/issue35075 (cherry picked from commit bf46a09dec372b85846216bd692d648dac08ac36) Co-authored-by: Pablo Galindo files: M Doc/library/pprint.rst M Doc/tools/susp-ignored.csv diff --git a/Doc/library/pprint.rst b/Doc/library/pprint.rst index aa97d3eabafa..3922a768311c 100644 --- a/Doc/library/pprint.rst +++ b/Doc/library/pprint.rst @@ -217,135 +217,156 @@ let's fetch information about a project from `PyPI `_:: >>> import json >>> import pprint >>> from urllib.request import urlopen - >>> with urlopen('http://pypi.org/project/Twisted/json') as url: - ... http_info = url.info() - ... raw_data = url.read().decode(http_info.get_content_charset()) - >>> project_info = json.loads(raw_data) + >>> with urlopen('https://pypi.org/pypi/sampleproject/json') as resp: + ... project_info = json.load(resp)['info'] In its basic form, :func:`pprint` shows the whole object:: >>> pprint.pprint(project_info) - {'info': {'_pypi_hidden': False, - '_pypi_ordering': 125, - 'author': 'Glyph Lefkowitz', - 'author_email': 'glyph at twistedmatrix.com', - 'bugtrack_url': '', - 'cheesecake_code_kwalitee_id': None, - 'cheesecake_documentation_id': None, - 'cheesecake_installability_id': None, - 'classifiers': ['Programming Language :: Python :: 2.6', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 2 :: Only'], - 'description': 'An extensible framework for Python programming, with ' - 'special focus\r\n' - 'on event-based network programming and multiprotocol ' - 'integration.', - 'docs_url': '', - 'download_url': 'UNKNOWN', - 'home_page': 'http://twistedmatrix.com/', - 'keywords': '', - 'license': 'MIT', - 'maintainer': '', - 'maintainer_email': '', - 'name': 'Twisted', - 'package_url': 'http://pypi.org/project/Twisted', - 'platform': 'UNKNOWN', - 'release_url': 'http://pypi.org/project/Twisted/12.3.0', - 'requires_python': None, - 'stable_version': None, - 'summary': 'An asynchronous networking framework written in Python', - 'version': '12.3.0'}, - 'urls': [{'comment_text': '', - 'downloads': 71844, - 'filename': 'Twisted-12.3.0.tar.bz2', - 'has_sig': False, - 'md5_digest': '6e289825f3bf5591cfd670874cc0862d', - 'packagetype': 'sdist', - 'python_version': 'source', - 'size': 2615733, - 'upload_time': '2012-12-26T12:47:03', - 'url': 'https://pypi.org/packages/source/T/Twisted/Twisted-12.3.0.tar.bz2'}, - {'comment_text': '', - 'downloads': 5224, - 'filename': 'Twisted-12.3.0.win32-py2.7.msi', - 'has_sig': False, - 'md5_digest': '6b778f5201b622a5519a2aca1a2fe512', - 'packagetype': 'bdist_msi', - 'python_version': '2.7', - 'size': 2916352, - 'upload_time': '2012-12-26T12:48:15', - 'url': 'https://pypi.org/packages/2.7/T/Twisted/Twisted-12.3.0.win32-py2.7.msi'}]} + {'author': 'The Python Packaging Authority', + 'author_email': 'pypa-dev at googlegroups.com', + 'bugtrack_url': None, + 'classifiers': ['Development Status :: 3 - Alpha', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.6', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.2', + 'Programming Language :: Python :: 3.3', + 'Programming Language :: Python :: 3.4', + 'Topic :: Software Development :: Build Tools'], + 'description': 'A sample Python project\n' + '=======================\n' + '\n' + 'This is the description file for the project.\n' + '\n' + 'The file should use UTF-8 encoding and be written using ' + 'ReStructured Text. It\n' + 'will be used to generate the project webpage on PyPI, and ' + 'should be written for\n' + 'that purpose.\n' + '\n' + 'Typical contents for this file would include an overview of ' + 'the project, basic\n' + 'usage examples, etc. Generally, including the project ' + 'changelog in here is not\n' + 'a good idea, although a simple "What\'s New" section for the ' + 'most recent version\n' + 'may be appropriate.', + 'description_content_type': None, + 'docs_url': None, + 'download_url': 'UNKNOWN', + 'downloads': {'last_day': -1, 'last_month': -1, 'last_week': -1}, + 'home_page': 'https://github.com/pypa/sampleproject', + 'keywords': 'sample setuptools development', + 'license': 'MIT', + 'maintainer': None, + 'maintainer_email': None, + 'name': 'sampleproject', + 'package_url': 'https://pypi.org/project/sampleproject/', + 'platform': 'UNKNOWN', + 'project_url': 'https://pypi.org/project/sampleproject/', + 'project_urls': {'Download': 'UNKNOWN', + 'Homepage': 'https://github.com/pypa/sampleproject'}, + 'release_url': 'https://pypi.org/project/sampleproject/1.2.0/', + 'requires_dist': None, + 'requires_python': None, + 'summary': 'A sample Python project', + 'version': '1.2.0'} The result can be limited to a certain *depth* (ellipsis is used for deeper contents):: - >>> pprint.pprint(project_info, depth=2) - {'info': {'_pypi_hidden': False, - '_pypi_ordering': 125, - 'author': 'Glyph Lefkowitz', - 'author_email': 'glyph at twistedmatrix.com', - 'bugtrack_url': '', - 'cheesecake_code_kwalitee_id': None, - 'cheesecake_documentation_id': None, - 'cheesecake_installability_id': None, - 'classifiers': [...], - 'description': 'An extensible framework for Python programming, with ' - 'special focus\r\n' - 'on event-based network programming and multiprotocol ' - 'integration.', - 'docs_url': '', - 'download_url': 'UNKNOWN', - 'home_page': 'http://twistedmatrix.com/', - 'keywords': '', - 'license': 'MIT', - 'maintainer': '', - 'maintainer_email': '', - 'name': 'Twisted', - 'package_url': 'http://pypi.org/project/Twisted', - 'platform': 'UNKNOWN', - 'release_url': 'http://pypi.org/project/Twisted/12.3.0', - 'requires_python': None, - 'stable_version': None, - 'summary': 'An asynchronous networking framework written in Python', - 'version': '12.3.0'}, - 'urls': [{...}, {...}]} + >>> pprint.pprint(project_info, depth=1) + {'author': 'The Python Packaging Authority', + 'author_email': 'pypa-dev at googlegroups.com', + 'bugtrack_url': None, + 'classifiers': [...], + 'description': 'A sample Python project\n' + '=======================\n' + '\n' + 'This is the description file for the project.\n' + '\n' + 'The file should use UTF-8 encoding and be written using ' + 'ReStructured Text. It\n' + 'will be used to generate the project webpage on PyPI, and ' + 'should be written for\n' + 'that purpose.\n' + '\n' + 'Typical contents for this file would include an overview of ' + 'the project, basic\n' + 'usage examples, etc. Generally, including the project ' + 'changelog in here is not\n' + 'a good idea, although a simple "What\'s New" section for the ' + 'most recent version\n' + 'may be appropriate.', + 'description_content_type': None, + 'docs_url': None, + 'download_url': 'UNKNOWN', + 'downloads': {...}, + 'home_page': 'https://github.com/pypa/sampleproject', + 'keywords': 'sample setuptools development', + 'license': 'MIT', + 'maintainer': None, + 'maintainer_email': None, + 'name': 'sampleproject', + 'package_url': 'https://pypi.org/project/sampleproject/', + 'platform': 'UNKNOWN', + 'project_url': 'https://pypi.org/project/sampleproject/', + 'project_urls': {...}, + 'release_url': 'https://pypi.org/project/sampleproject/1.2.0/', + 'requires_dist': None, + 'requires_python': None, + 'summary': 'A sample Python project', + 'version': '1.2.0'} Additionally, maximum character *width* can be suggested. If a long object cannot be split, the specified width will be exceeded:: - >>> pprint.pprint(project_info, depth=2, width=50) - {'info': {'_pypi_hidden': False, - '_pypi_ordering': 125, - 'author': 'Glyph Lefkowitz', - 'author_email': 'glyph at twistedmatrix.com', - 'bugtrack_url': '', - 'cheesecake_code_kwalitee_id': None, - 'cheesecake_documentation_id': None, - 'cheesecake_installability_id': None, - 'classifiers': [...], - 'description': 'An extensible ' - 'framework for Python ' - 'programming, with ' - 'special focus\r\n' - 'on event-based network ' - 'programming and ' - 'multiprotocol ' - 'integration.', - 'docs_url': '', - 'download_url': 'UNKNOWN', - 'home_page': 'http://twistedmatrix.com/', - 'keywords': '', - 'license': 'MIT', - 'maintainer': '', - 'maintainer_email': '', - 'name': 'Twisted', - 'package_url': 'http://pypi.org/project/Twisted', - 'platform': 'UNKNOWN', - 'release_url': 'http://pypi.org/project/Twisted/12.3.0', - 'requires_python': None, - 'stable_version': None, - 'summary': 'An asynchronous networking ' - 'framework written in ' - 'Python', - 'version': '12.3.0'}, - 'urls': [{...}, {...}]} + >>> pprint.pprint(project_info, depth=1, width=60) + {'author': 'The Python Packaging Authority', + 'author_email': 'pypa-dev at googlegroups.com', + 'bugtrack_url': None, + 'classifiers': [...], + 'description': 'A sample Python project\n' + '=======================\n' + '\n' + 'This is the description file for the ' + 'project.\n' + '\n' + 'The file should use UTF-8 encoding and be ' + 'written using ReStructured Text. It\n' + 'will be used to generate the project ' + 'webpage on PyPI, and should be written ' + 'for\n' + 'that purpose.\n' + '\n' + 'Typical contents for this file would ' + 'include an overview of the project, ' + 'basic\n' + 'usage examples, etc. Generally, including ' + 'the project changelog in here is not\n' + 'a good idea, although a simple "What\'s ' + 'New" section for the most recent version\n' + 'may be appropriate.', + 'description_content_type': None, + 'docs_url': None, + 'download_url': 'UNKNOWN', + 'downloads': {...}, + 'home_page': 'https://github.com/pypa/sampleproject', + 'keywords': 'sample setuptools development', + 'license': 'MIT', + 'maintainer': None, + 'maintainer_email': None, + 'name': 'sampleproject', + 'package_url': 'https://pypi.org/project/sampleproject/', + 'platform': 'UNKNOWN', + 'project_url': 'https://pypi.org/project/sampleproject/', + 'project_urls': {...}, + 'release_url': 'https://pypi.org/project/sampleproject/1.2.0/', + 'requires_dist': None, + 'requires_python': None, + 'summary': 'A sample Python project', + 'version': '1.2.0'} diff --git a/Doc/tools/susp-ignored.csv b/Doc/tools/susp-ignored.csv index 482ffc0bde8a..e9bee8b5e1b8 100644 --- a/Doc/tools/susp-ignored.csv +++ b/Doc/tools/susp-ignored.csv @@ -180,9 +180,17 @@ library/pathlib,,:Program,>>> PureWindowsPath('c:Program Files/').anchor library/pdb,,:lineno,filename:lineno library/pickle,,:memory,"conn = sqlite3.connect("":memory:"")" library/posix,,`,"CFLAGS=""`getconf LFS_CFLAGS`"" OPT=""-g -O2 $CFLAGS""" -library/pprint,,::,"'Programming Language :: Python :: 2 :: Only']," library/pprint,,::,"'Programming Language :: Python :: 2.6'," library/pprint,,::,"'Programming Language :: Python :: 2.7'," +library/pprint,225,::,"'classifiers': ['Development Status :: 3 - Alpha'," +library/pprint,225,::,"'Intended Audience :: Developers'," +library/pprint,225,::,"'License :: OSI Approved :: MIT License'," +library/pprint,225,::,"'Programming Language :: Python :: 2'," +library/pprint,225,::,"'Programming Language :: Python :: 3'," +library/pprint,225,::,"'Programming Language :: Python :: 3.2'," +library/pprint,225,::,"'Programming Language :: Python :: 3.3'," +library/pprint,225,::,"'Programming Language :: Python :: 3.4'," +library/pprint,225,::,"'Topic :: Software Development :: Build Tools']," library/profile,,:lineno,filename:lineno(function) library/pyexpat,,:elem1, library/pyexpat,,:py,"xmlns:py = ""http://www.python.org/ns/"">" From webhook-mailer at python.org Thu Nov 1 13:25:10 2018 From: webhook-mailer at python.org (Barry Warsaw) Date: Thu, 01 Nov 2018 17:25:10 -0000 Subject: [Python-checkins] Simplify sys.breakpointhook implementation (#9519) Message-ID: https://github.com/python/cpython/commit/dce345c51abd5081679a487315fb47efddc54cdb commit: dce345c51abd5081679a487315fb47efddc54cdb branch: master author: Anthony Sottile committer: Barry Warsaw date: 2018-11-01T10:25:05-07:00 summary: Simplify sys.breakpointhook implementation (#9519) files: M Python/sysmodule.c diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 21647083d683..c0f168c63820 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -151,16 +151,8 @@ sys_breakpointhook(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyOb return NULL; } - PyObject *fromlist = Py_BuildValue("(s)", attrname); - if (fromlist == NULL) { - Py_DECREF(modulepath); - PyMem_RawFree(envar); - return NULL; - } - PyObject *module = PyImport_ImportModuleLevelObject( - modulepath, NULL, NULL, fromlist, 0); + PyObject *module = PyImport_Import(modulepath); Py_DECREF(modulepath); - Py_DECREF(fromlist); if (module == NULL) { goto error; From webhook-mailer at python.org Thu Nov 1 17:33:58 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 01 Nov 2018 21:33:58 -0000 Subject: [Python-checkins] bpo-35075: Fix broken url in the pprint documentation (GH-10201) Message-ID: https://github.com/python/cpython/commit/7d35553138d8b2799ae68601ce836a3647509718 commit: 7d35553138d8b2799ae68601ce836a3647509718 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-01T14:33:52-07:00 summary: bpo-35075: Fix broken url in the pprint documentation (GH-10201) https://bugs.python.org/issue35075 (cherry picked from commit bf46a09dec372b85846216bd692d648dac08ac36) Co-authored-by: Pablo Galindo files: M Doc/library/pprint.rst M Doc/tools/susp-ignored.csv diff --git a/Doc/library/pprint.rst b/Doc/library/pprint.rst index aa97d3eabafa..3922a768311c 100644 --- a/Doc/library/pprint.rst +++ b/Doc/library/pprint.rst @@ -217,135 +217,156 @@ let's fetch information about a project from `PyPI `_:: >>> import json >>> import pprint >>> from urllib.request import urlopen - >>> with urlopen('http://pypi.org/project/Twisted/json') as url: - ... http_info = url.info() - ... raw_data = url.read().decode(http_info.get_content_charset()) - >>> project_info = json.loads(raw_data) + >>> with urlopen('https://pypi.org/pypi/sampleproject/json') as resp: + ... project_info = json.load(resp)['info'] In its basic form, :func:`pprint` shows the whole object:: >>> pprint.pprint(project_info) - {'info': {'_pypi_hidden': False, - '_pypi_ordering': 125, - 'author': 'Glyph Lefkowitz', - 'author_email': 'glyph at twistedmatrix.com', - 'bugtrack_url': '', - 'cheesecake_code_kwalitee_id': None, - 'cheesecake_documentation_id': None, - 'cheesecake_installability_id': None, - 'classifiers': ['Programming Language :: Python :: 2.6', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 2 :: Only'], - 'description': 'An extensible framework for Python programming, with ' - 'special focus\r\n' - 'on event-based network programming and multiprotocol ' - 'integration.', - 'docs_url': '', - 'download_url': 'UNKNOWN', - 'home_page': 'http://twistedmatrix.com/', - 'keywords': '', - 'license': 'MIT', - 'maintainer': '', - 'maintainer_email': '', - 'name': 'Twisted', - 'package_url': 'http://pypi.org/project/Twisted', - 'platform': 'UNKNOWN', - 'release_url': 'http://pypi.org/project/Twisted/12.3.0', - 'requires_python': None, - 'stable_version': None, - 'summary': 'An asynchronous networking framework written in Python', - 'version': '12.3.0'}, - 'urls': [{'comment_text': '', - 'downloads': 71844, - 'filename': 'Twisted-12.3.0.tar.bz2', - 'has_sig': False, - 'md5_digest': '6e289825f3bf5591cfd670874cc0862d', - 'packagetype': 'sdist', - 'python_version': 'source', - 'size': 2615733, - 'upload_time': '2012-12-26T12:47:03', - 'url': 'https://pypi.org/packages/source/T/Twisted/Twisted-12.3.0.tar.bz2'}, - {'comment_text': '', - 'downloads': 5224, - 'filename': 'Twisted-12.3.0.win32-py2.7.msi', - 'has_sig': False, - 'md5_digest': '6b778f5201b622a5519a2aca1a2fe512', - 'packagetype': 'bdist_msi', - 'python_version': '2.7', - 'size': 2916352, - 'upload_time': '2012-12-26T12:48:15', - 'url': 'https://pypi.org/packages/2.7/T/Twisted/Twisted-12.3.0.win32-py2.7.msi'}]} + {'author': 'The Python Packaging Authority', + 'author_email': 'pypa-dev at googlegroups.com', + 'bugtrack_url': None, + 'classifiers': ['Development Status :: 3 - Alpha', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.6', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.2', + 'Programming Language :: Python :: 3.3', + 'Programming Language :: Python :: 3.4', + 'Topic :: Software Development :: Build Tools'], + 'description': 'A sample Python project\n' + '=======================\n' + '\n' + 'This is the description file for the project.\n' + '\n' + 'The file should use UTF-8 encoding and be written using ' + 'ReStructured Text. It\n' + 'will be used to generate the project webpage on PyPI, and ' + 'should be written for\n' + 'that purpose.\n' + '\n' + 'Typical contents for this file would include an overview of ' + 'the project, basic\n' + 'usage examples, etc. Generally, including the project ' + 'changelog in here is not\n' + 'a good idea, although a simple "What\'s New" section for the ' + 'most recent version\n' + 'may be appropriate.', + 'description_content_type': None, + 'docs_url': None, + 'download_url': 'UNKNOWN', + 'downloads': {'last_day': -1, 'last_month': -1, 'last_week': -1}, + 'home_page': 'https://github.com/pypa/sampleproject', + 'keywords': 'sample setuptools development', + 'license': 'MIT', + 'maintainer': None, + 'maintainer_email': None, + 'name': 'sampleproject', + 'package_url': 'https://pypi.org/project/sampleproject/', + 'platform': 'UNKNOWN', + 'project_url': 'https://pypi.org/project/sampleproject/', + 'project_urls': {'Download': 'UNKNOWN', + 'Homepage': 'https://github.com/pypa/sampleproject'}, + 'release_url': 'https://pypi.org/project/sampleproject/1.2.0/', + 'requires_dist': None, + 'requires_python': None, + 'summary': 'A sample Python project', + 'version': '1.2.0'} The result can be limited to a certain *depth* (ellipsis is used for deeper contents):: - >>> pprint.pprint(project_info, depth=2) - {'info': {'_pypi_hidden': False, - '_pypi_ordering': 125, - 'author': 'Glyph Lefkowitz', - 'author_email': 'glyph at twistedmatrix.com', - 'bugtrack_url': '', - 'cheesecake_code_kwalitee_id': None, - 'cheesecake_documentation_id': None, - 'cheesecake_installability_id': None, - 'classifiers': [...], - 'description': 'An extensible framework for Python programming, with ' - 'special focus\r\n' - 'on event-based network programming and multiprotocol ' - 'integration.', - 'docs_url': '', - 'download_url': 'UNKNOWN', - 'home_page': 'http://twistedmatrix.com/', - 'keywords': '', - 'license': 'MIT', - 'maintainer': '', - 'maintainer_email': '', - 'name': 'Twisted', - 'package_url': 'http://pypi.org/project/Twisted', - 'platform': 'UNKNOWN', - 'release_url': 'http://pypi.org/project/Twisted/12.3.0', - 'requires_python': None, - 'stable_version': None, - 'summary': 'An asynchronous networking framework written in Python', - 'version': '12.3.0'}, - 'urls': [{...}, {...}]} + >>> pprint.pprint(project_info, depth=1) + {'author': 'The Python Packaging Authority', + 'author_email': 'pypa-dev at googlegroups.com', + 'bugtrack_url': None, + 'classifiers': [...], + 'description': 'A sample Python project\n' + '=======================\n' + '\n' + 'This is the description file for the project.\n' + '\n' + 'The file should use UTF-8 encoding and be written using ' + 'ReStructured Text. It\n' + 'will be used to generate the project webpage on PyPI, and ' + 'should be written for\n' + 'that purpose.\n' + '\n' + 'Typical contents for this file would include an overview of ' + 'the project, basic\n' + 'usage examples, etc. Generally, including the project ' + 'changelog in here is not\n' + 'a good idea, although a simple "What\'s New" section for the ' + 'most recent version\n' + 'may be appropriate.', + 'description_content_type': None, + 'docs_url': None, + 'download_url': 'UNKNOWN', + 'downloads': {...}, + 'home_page': 'https://github.com/pypa/sampleproject', + 'keywords': 'sample setuptools development', + 'license': 'MIT', + 'maintainer': None, + 'maintainer_email': None, + 'name': 'sampleproject', + 'package_url': 'https://pypi.org/project/sampleproject/', + 'platform': 'UNKNOWN', + 'project_url': 'https://pypi.org/project/sampleproject/', + 'project_urls': {...}, + 'release_url': 'https://pypi.org/project/sampleproject/1.2.0/', + 'requires_dist': None, + 'requires_python': None, + 'summary': 'A sample Python project', + 'version': '1.2.0'} Additionally, maximum character *width* can be suggested. If a long object cannot be split, the specified width will be exceeded:: - >>> pprint.pprint(project_info, depth=2, width=50) - {'info': {'_pypi_hidden': False, - '_pypi_ordering': 125, - 'author': 'Glyph Lefkowitz', - 'author_email': 'glyph at twistedmatrix.com', - 'bugtrack_url': '', - 'cheesecake_code_kwalitee_id': None, - 'cheesecake_documentation_id': None, - 'cheesecake_installability_id': None, - 'classifiers': [...], - 'description': 'An extensible ' - 'framework for Python ' - 'programming, with ' - 'special focus\r\n' - 'on event-based network ' - 'programming and ' - 'multiprotocol ' - 'integration.', - 'docs_url': '', - 'download_url': 'UNKNOWN', - 'home_page': 'http://twistedmatrix.com/', - 'keywords': '', - 'license': 'MIT', - 'maintainer': '', - 'maintainer_email': '', - 'name': 'Twisted', - 'package_url': 'http://pypi.org/project/Twisted', - 'platform': 'UNKNOWN', - 'release_url': 'http://pypi.org/project/Twisted/12.3.0', - 'requires_python': None, - 'stable_version': None, - 'summary': 'An asynchronous networking ' - 'framework written in ' - 'Python', - 'version': '12.3.0'}, - 'urls': [{...}, {...}]} + >>> pprint.pprint(project_info, depth=1, width=60) + {'author': 'The Python Packaging Authority', + 'author_email': 'pypa-dev at googlegroups.com', + 'bugtrack_url': None, + 'classifiers': [...], + 'description': 'A sample Python project\n' + '=======================\n' + '\n' + 'This is the description file for the ' + 'project.\n' + '\n' + 'The file should use UTF-8 encoding and be ' + 'written using ReStructured Text. It\n' + 'will be used to generate the project ' + 'webpage on PyPI, and should be written ' + 'for\n' + 'that purpose.\n' + '\n' + 'Typical contents for this file would ' + 'include an overview of the project, ' + 'basic\n' + 'usage examples, etc. Generally, including ' + 'the project changelog in here is not\n' + 'a good idea, although a simple "What\'s ' + 'New" section for the most recent version\n' + 'may be appropriate.', + 'description_content_type': None, + 'docs_url': None, + 'download_url': 'UNKNOWN', + 'downloads': {...}, + 'home_page': 'https://github.com/pypa/sampleproject', + 'keywords': 'sample setuptools development', + 'license': 'MIT', + 'maintainer': None, + 'maintainer_email': None, + 'name': 'sampleproject', + 'package_url': 'https://pypi.org/project/sampleproject/', + 'platform': 'UNKNOWN', + 'project_url': 'https://pypi.org/project/sampleproject/', + 'project_urls': {...}, + 'release_url': 'https://pypi.org/project/sampleproject/1.2.0/', + 'requires_dist': None, + 'requires_python': None, + 'summary': 'A sample Python project', + 'version': '1.2.0'} diff --git a/Doc/tools/susp-ignored.csv b/Doc/tools/susp-ignored.csv index 33cd48f3d81e..0c78f8d3b333 100644 --- a/Doc/tools/susp-ignored.csv +++ b/Doc/tools/susp-ignored.csv @@ -180,9 +180,17 @@ library/pathlib,,:Program,>>> PureWindowsPath('c:Program Files/').anchor library/pdb,,:lineno,filename:lineno library/pickle,,:memory,"conn = sqlite3.connect("":memory:"")" library/posix,,`,"CFLAGS=""`getconf LFS_CFLAGS`"" OPT=""-g -O2 $CFLAGS""" -library/pprint,,::,"'Programming Language :: Python :: 2 :: Only']," library/pprint,,::,"'Programming Language :: Python :: 2.6'," library/pprint,,::,"'Programming Language :: Python :: 2.7'," +library/pprint,225,::,"'classifiers': ['Development Status :: 3 - Alpha'," +library/pprint,225,::,"'Intended Audience :: Developers'," +library/pprint,225,::,"'License :: OSI Approved :: MIT License'," +library/pprint,225,::,"'Programming Language :: Python :: 2'," +library/pprint,225,::,"'Programming Language :: Python :: 3'," +library/pprint,225,::,"'Programming Language :: Python :: 3.2'," +library/pprint,225,::,"'Programming Language :: Python :: 3.3'," +library/pprint,225,::,"'Programming Language :: Python :: 3.4'," +library/pprint,225,::,"'Topic :: Software Development :: Build Tools']," library/profile,,:lineno,filename:lineno(function) library/pyexpat,,:elem1, library/pyexpat,,:py,"xmlns:py = ""http://www.python.org/ns/"">" From webhook-mailer at python.org Thu Nov 1 17:34:46 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 01 Nov 2018 21:34:46 -0000 Subject: [Python-checkins] Doc: fix asyncio loop.close() description (GH-10229) Message-ID: https://github.com/python/cpython/commit/d69f015ba5e617f6e15e2dcaefa095b83bc40448 commit: d69f015ba5e617f6e15e2dcaefa095b83bc40448 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-01T14:34:42-07:00 summary: Doc: fix asyncio loop.close() description (GH-10229) Needs backport to 3.7. In 3.6 the description is correct. (cherry picked from commit b83d917fafd87e4130f9c7d5209ad2debc7219cd) Co-authored-by: Andriy Maletsky files: M Doc/library/asyncio-eventloop.rst diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index df453cdfb7d8..8215198ce91f 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -137,7 +137,7 @@ Running and stopping the loop Close the event loop. - The loop must be running when this function is called. + The loop must not be running when this function is called. Any pending callbacks will be discarded. This method clears all queues and shuts down the executor, but does From webhook-mailer at python.org Thu Nov 1 17:35:20 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 01 Nov 2018 21:35:20 -0000 Subject: [Python-checkins] Include memo in the documented signature of copy.deepcopy() Message-ID: https://github.com/python/cpython/commit/b9c48a73bc26ee7c16df2a07e84d330b5474a643 commit: b9c48a73bc26ee7c16df2a07e84d330b5474a643 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-01T14:35:17-07:00 summary: Include memo in the documented signature of copy.deepcopy() * Include memo in the documented signature of copy.deepcopy() The memo argument is mentioned lower on the doc page under writing a `__deepcopy__` method, but is not included in the documented function signature. This makes it easy to miss, and can lead to incorrect/buggy implementations of `__deepcopy__` -- which is exatly what just happpend to me! (cherry picked from commit 0200928e8df012d408530b06a98119024bc82511) Co-authored-by: Stephan Hoyer files: M Doc/library/copy.rst diff --git a/Doc/library/copy.rst b/Doc/library/copy.rst index 2041d9175ea5..c7bd89f96372 100644 --- a/Doc/library/copy.rst +++ b/Doc/library/copy.rst @@ -22,7 +22,7 @@ Interface summary: Return a shallow copy of *x*. -.. function:: deepcopy(x) +.. function:: deepcopy(x[, memo]) Return a deep copy of *x*. @@ -52,7 +52,7 @@ copy operations: The :func:`deepcopy` function avoids these problems by: -* keeping a "memo" dictionary of objects already copied during the current +* keeping a ``memo`` dictionary of objects already copied during the current copying pass; and * letting user-defined classes override the copying operation or the set of @@ -82,7 +82,7 @@ In order for a class to define its own copy implementation, it can define special methods :meth:`__copy__` and :meth:`__deepcopy__`. The former is called to implement the shallow copy operation; no additional arguments are passed. The latter is called to implement the deep copy operation; it is passed one -argument, the memo dictionary. If the :meth:`__deepcopy__` implementation needs +argument, the ``memo`` dictionary. If the :meth:`__deepcopy__` implementation needs to make a deep copy of a component, it should call the :func:`deepcopy` function with the component as first argument and the memo dictionary as second argument. From webhook-mailer at python.org Thu Nov 1 17:35:29 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 01 Nov 2018 21:35:29 -0000 Subject: [Python-checkins] Include memo in the documented signature of copy.deepcopy() Message-ID: https://github.com/python/cpython/commit/49171877ddbbcb9b9a38b30e698ee9f8b826b297 commit: 49171877ddbbcb9b9a38b30e698ee9f8b826b297 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-01T14:35:26-07:00 summary: Include memo in the documented signature of copy.deepcopy() * Include memo in the documented signature of copy.deepcopy() The memo argument is mentioned lower on the doc page under writing a `__deepcopy__` method, but is not included in the documented function signature. This makes it easy to miss, and can lead to incorrect/buggy implementations of `__deepcopy__` -- which is exatly what just happpend to me! (cherry picked from commit 0200928e8df012d408530b06a98119024bc82511) Co-authored-by: Stephan Hoyer files: M Doc/library/copy.rst diff --git a/Doc/library/copy.rst b/Doc/library/copy.rst index 2041d9175ea5..c7bd89f96372 100644 --- a/Doc/library/copy.rst +++ b/Doc/library/copy.rst @@ -22,7 +22,7 @@ Interface summary: Return a shallow copy of *x*. -.. function:: deepcopy(x) +.. function:: deepcopy(x[, memo]) Return a deep copy of *x*. @@ -52,7 +52,7 @@ copy operations: The :func:`deepcopy` function avoids these problems by: -* keeping a "memo" dictionary of objects already copied during the current +* keeping a ``memo`` dictionary of objects already copied during the current copying pass; and * letting user-defined classes override the copying operation or the set of @@ -82,7 +82,7 @@ In order for a class to define its own copy implementation, it can define special methods :meth:`__copy__` and :meth:`__deepcopy__`. The former is called to implement the shallow copy operation; no additional arguments are passed. The latter is called to implement the deep copy operation; it is passed one -argument, the memo dictionary. If the :meth:`__deepcopy__` implementation needs +argument, the ``memo`` dictionary. If the :meth:`__deepcopy__` implementation needs to make a deep copy of a component, it should call the :func:`deepcopy` function with the component as first argument and the memo dictionary as second argument. From webhook-mailer at python.org Thu Nov 1 22:49:50 2018 From: webhook-mailer at python.org (Benjamin Peterson) Date: Fri, 02 Nov 2018 02:49:50 -0000 Subject: [Python-checkins] closes bpo-35139: The `pyexpat` module's macros in `Modules/Setup` now match `setup.py` (GH-10289) Message-ID: https://github.com/python/cpython/commit/318ab63c01f5b8e7562b122ab5ba01258a51277b commit: 318ab63c01f5b8e7562b122ab5ba01258a51277b branch: master author: Max B?langer committer: Benjamin Peterson date: 2018-11-01T19:49:46-07:00 summary: closes bpo-35139: The `pyexpat` module's macros in `Modules/Setup` now match `setup.py` (GH-10289) This could cause compile errors on macOS or other platforms. files: A Misc/NEWS.d/next/Build/2018-11-01-15-01-23.bpo-35139.XZTttb.rst M Modules/Setup diff --git a/Misc/NEWS.d/next/Build/2018-11-01-15-01-23.bpo-35139.XZTttb.rst b/Misc/NEWS.d/next/Build/2018-11-01-15-01-23.bpo-35139.XZTttb.rst new file mode 100644 index 000000000000..aa65088be809 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2018-11-01-15-01-23.bpo-35139.XZTttb.rst @@ -0,0 +1 @@ +Fix a compiler error when statically linking `pyexpat` in `Modules/Setup`. diff --git a/Modules/Setup b/Modules/Setup index c1804630b903..e2b5f86f38e0 100644 --- a/Modules/Setup +++ b/Modules/Setup @@ -336,7 +336,7 @@ _symtable symtablemodule.c # Interface to the Expat XML parser # More information on Expat can be found at www.libexpat.org. # -#pyexpat expat/xmlparse.c expat/xmlrole.c expat/xmltok.c pyexpat.c -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI +#pyexpat expat/xmlparse.c expat/xmlrole.c expat/xmltok.c pyexpat.c -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DXML_POOR_ENTROPY=1 -DUSE_PYEXPAT_CAPI # Hye-Shik Chang's CJKCodecs From webhook-mailer at python.org Thu Nov 1 23:09:08 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 02 Nov 2018 03:09:08 -0000 Subject: [Python-checkins] closes bpo-35139: The `pyexpat` module's macros in `Modules/Setup` now match `setup.py` (GH-10289) Message-ID: https://github.com/python/cpython/commit/04c96669b161d802b7a906c06cd77895cee1864e commit: 04c96669b161d802b7a906c06cd77895cee1864e branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-01T20:09:04-07:00 summary: closes bpo-35139: The `pyexpat` module's macros in `Modules/Setup` now match `setup.py` (GH-10289) This could cause compile errors on macOS or other platforms. (cherry picked from commit 318ab63c01f5b8e7562b122ab5ba01258a51277b) Co-authored-by: Max B?langer files: A Misc/NEWS.d/next/Build/2018-11-01-15-01-23.bpo-35139.XZTttb.rst M Modules/Setup.dist diff --git a/Misc/NEWS.d/next/Build/2018-11-01-15-01-23.bpo-35139.XZTttb.rst b/Misc/NEWS.d/next/Build/2018-11-01-15-01-23.bpo-35139.XZTttb.rst new file mode 100644 index 000000000000..aa65088be809 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2018-11-01-15-01-23.bpo-35139.XZTttb.rst @@ -0,0 +1 @@ +Fix a compiler error when statically linking `pyexpat` in `Modules/Setup`. diff --git a/Modules/Setup.dist b/Modules/Setup.dist index f0eff5d2d0c2..8cc6bf0540d4 100644 --- a/Modules/Setup.dist +++ b/Modules/Setup.dist @@ -340,7 +340,7 @@ _symtable symtablemodule.c # Interface to the Expat XML parser # More information on Expat can be found at www.libexpat.org. # -#pyexpat expat/xmlparse.c expat/xmlrole.c expat/xmltok.c pyexpat.c -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI +#pyexpat expat/xmlparse.c expat/xmlrole.c expat/xmltok.c pyexpat.c -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DXML_POOR_ENTROPY=1 -DUSE_PYEXPAT_CAPI # Hye-Shik Chang's CJKCodecs From webhook-mailer at python.org Thu Nov 1 23:28:39 2018 From: webhook-mailer at python.org (Benjamin Peterson) Date: Fri, 02 Nov 2018 03:28:39 -0000 Subject: [Python-checkins] [2.7] closes bpo-35139: The `pyexpat` module's macros in `Modules/Setup` now match `setup.py` (GH-10293) Message-ID: https://github.com/python/cpython/commit/a614cc92088c4e1b2d90aa03415ee6acf70f03b4 commit: a614cc92088c4e1b2d90aa03415ee6acf70f03b4 branch: 2.7 author: Benjamin Peterson committer: GitHub date: 2018-11-01T20:28:34-07:00 summary: [2.7] closes bpo-35139: The `pyexpat` module's macros in `Modules/Setup` now match `setup.py` (GH-10293) This could cause compile errors on macOS or other platforms.. (cherry picked from commit 318ab63c01f5b8e7562b122ab5ba01258a51277b) Co-authored-by: Max B?langer files: A Misc/NEWS.d/next/Build/2018-11-01-15-01-23.bpo-35139.XZTttb.rst M Modules/Setup.dist diff --git a/Misc/NEWS.d/next/Build/2018-11-01-15-01-23.bpo-35139.XZTttb.rst b/Misc/NEWS.d/next/Build/2018-11-01-15-01-23.bpo-35139.XZTttb.rst new file mode 100644 index 000000000000..aa65088be809 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2018-11-01-15-01-23.bpo-35139.XZTttb.rst @@ -0,0 +1 @@ +Fix a compiler error when statically linking `pyexpat` in `Modules/Setup`. diff --git a/Modules/Setup.dist b/Modules/Setup.dist index bd8b52e1de23..bbc922212964 100644 --- a/Modules/Setup.dist +++ b/Modules/Setup.dist @@ -469,7 +469,7 @@ GLHACK=-Dclear=__GLclear # Interface to the Expat XML parser # More information on Expat can be found at www.libexpat.org. # -#pyexpat expat/xmlparse.c expat/xmlrole.c expat/xmltok.c pyexpat.c -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI +#pyexpat expat/xmlparse.c expat/xmlrole.c expat/xmltok.c pyexpat.c -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DXML_POOR_ENTROPY=1 -DUSE_PYEXPAT_CAPI # Hye-Shik Chang's CJKCodecs From webhook-mailer at python.org Thu Nov 1 23:29:43 2018 From: webhook-mailer at python.org (INADA Naoki) Date: Fri, 02 Nov 2018 03:29:43 -0000 Subject: [Python-checkins] bpo-33578: Fix getstate/setstate for CJK decoder (GH-10290) Message-ID: https://github.com/python/cpython/commit/488c0a6cdf09e21774e63c2a430ecc0de804d147 commit: 488c0a6cdf09e21774e63c2a430ecc0de804d147 branch: master author: Christopher Thorne committer: INADA Naoki date: 2018-11-02T12:29:40+09:00 summary: bpo-33578: Fix getstate/setstate for CJK decoder (GH-10290) Previous version was casting to Py_ssize_t incorrectly and exhibited unexpected behavior on big-endian systems. files: M Lib/test/test_multibytecodec.py M Modules/cjkcodecs/multibytecodec.c diff --git a/Lib/test/test_multibytecodec.py b/Lib/test/test_multibytecodec.py index 8e8362b70fd0..3cf5d7beb144 100644 --- a/Lib/test/test_multibytecodec.py +++ b/Lib/test/test_multibytecodec.py @@ -271,6 +271,10 @@ def test_state_methods(self): pending4, _ = decoder.getstate() self.assertEqual(pending4, b'') + # Ensure state values are preserved correctly + decoder.setstate((b'abc', 123456789)) + self.assertEqual(decoder.getstate(), (b'abc', 123456789)) + def test_setstate_validates_input(self): decoder = codecs.getincrementaldecoder('euc_jp')() self.assertRaises(TypeError, decoder.setstate, 123) diff --git a/Modules/cjkcodecs/multibytecodec.c b/Modules/cjkcodecs/multibytecodec.c index 4633499a8abf..9409456c0d27 100644 --- a/Modules/cjkcodecs/multibytecodec.c +++ b/Modules/cjkcodecs/multibytecodec.c @@ -1218,6 +1218,7 @@ _multibytecodec_MultibyteIncrementalDecoder_getstate_impl(MultibyteIncrementalDe /*[clinic end generated code: output=255009c4713b7f82 input=4006aa49bddbaa75]*/ { PyObject *buffer; + PyObject *statelong; buffer = PyBytes_FromStringAndSize((const char *)self->pending, self->pendingsize); @@ -1225,7 +1226,16 @@ _multibytecodec_MultibyteIncrementalDecoder_getstate_impl(MultibyteIncrementalDe return NULL; } - return make_tuple(buffer, (Py_ssize_t)*self->state.c); + statelong = (PyObject *)_PyLong_FromByteArray(self->state.c, + sizeof(self->state.c), + 1 /* little-endian */ , + 0 /* unsigned */ ); + if (statelong == NULL) { + Py_DECREF(buffer); + return NULL; + } + + return Py_BuildValue("NN", buffer, statelong); } /*[clinic input] @@ -1240,16 +1250,23 @@ _multibytecodec_MultibyteIncrementalDecoder_setstate_impl(MultibyteIncrementalDe /*[clinic end generated code: output=106b2fbca3e2dcc2 input=e5d794e8baba1a47]*/ { PyObject *buffer; + PyLongObject *statelong; Py_ssize_t buffersize; char *bufferstr; - unsigned long long flag; + unsigned char statebytes[8]; - if (!PyArg_ParseTuple(state, "SK;setstate(): illegal state argument", - &buffer, &flag)) + if (!PyArg_ParseTuple(state, "SO!;setstate(): illegal state argument", + &buffer, &PyLong_Type, &statelong)) { return NULL; } + if (_PyLong_AsByteArray(statelong, statebytes, sizeof(statebytes), + 1 /* little-endian */ , + 0 /* unsigned */ ) < 0) { + return NULL; + } + buffersize = PyBytes_Size(buffer); if (buffersize == -1) { return NULL; @@ -1266,7 +1283,7 @@ _multibytecodec_MultibyteIncrementalDecoder_setstate_impl(MultibyteIncrementalDe } self->pendingsize = buffersize; memcpy(self->pending, bufferstr, self->pendingsize); - memcpy(self->state.c, (unsigned char *)&flag, sizeof(flag)); + memcpy(self->state.c, statebytes, sizeof(statebytes)); Py_RETURN_NONE; } From webhook-mailer at python.org Thu Nov 1 23:32:34 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 02 Nov 2018 03:32:34 -0000 Subject: [Python-checkins] closes bpo-35139: The `pyexpat` module's macros in `Modules/Setup` now match `setup.py` (GH-10289) Message-ID: https://github.com/python/cpython/commit/2339fe7cad9a84815fe551fedd6acdc3f2bf0a64 commit: 2339fe7cad9a84815fe551fedd6acdc3f2bf0a64 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-01T20:32:29-07:00 summary: closes bpo-35139: The `pyexpat` module's macros in `Modules/Setup` now match `setup.py` (GH-10289) This could cause compile errors on macOS or other platforms. (cherry picked from commit 318ab63c01f5b8e7562b122ab5ba01258a51277b) Co-authored-by: Max B?langer files: A Misc/NEWS.d/next/Build/2018-11-01-15-01-23.bpo-35139.XZTttb.rst M Modules/Setup.dist diff --git a/Misc/NEWS.d/next/Build/2018-11-01-15-01-23.bpo-35139.XZTttb.rst b/Misc/NEWS.d/next/Build/2018-11-01-15-01-23.bpo-35139.XZTttb.rst new file mode 100644 index 000000000000..aa65088be809 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2018-11-01-15-01-23.bpo-35139.XZTttb.rst @@ -0,0 +1 @@ +Fix a compiler error when statically linking `pyexpat` in `Modules/Setup`. diff --git a/Modules/Setup.dist b/Modules/Setup.dist index acf4433cfe6f..e469d5e4c8e8 100644 --- a/Modules/Setup.dist +++ b/Modules/Setup.dist @@ -368,7 +368,7 @@ _symtable symtablemodule.c # Interface to the Expat XML parser # More information on Expat can be found at www.libexpat.org. # -#pyexpat expat/xmlparse.c expat/xmlrole.c expat/xmltok.c pyexpat.c -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI +#pyexpat expat/xmlparse.c expat/xmlrole.c expat/xmltok.c pyexpat.c -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DXML_POOR_ENTROPY=1 -DUSE_PYEXPAT_CAPI # Hye-Shik Chang's CJKCodecs From solipsis at pitrou.net Fri Nov 2 05:06:49 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Fri, 02 Nov 2018 09:06:49 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=4 Message-ID: <20181102090649.1.BD7A9EE865AB0972@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [0, 7, -7] memory blocks, sum=0 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_forkserver leaked [1, -2, 2] memory blocks, sum=1 test_multiprocessing_spawn leaked [1, 0, -2] memory blocks, sum=-1 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogwp52G0', '--timeout', '7200'] From webhook-mailer at python.org Fri Nov 2 11:20:26 2018 From: webhook-mailer at python.org (Pablo Galindo) Date: Fri, 02 Nov 2018 15:20:26 -0000 Subject: [Python-checkins] bpo-29341: Clarify that path-like objects are accepted in some os methods (GH-10101) Message-ID: https://github.com/python/cpython/commit/b942707fc23454a998323c17e30be78ff1a4f0e7 commit: b942707fc23454a998323c17e30be78ff1a4f0e7 branch: master author: BNMetrics committer: Pablo Galindo date: 2018-11-02T11:20:19-04:00 summary: bpo-29341: Clarify that path-like objects are accepted in some os methods (GH-10101) Some methods in the os module can accept path-like objects. This is documented in the general documentation but not in the function docstrings. To keep both in sync, the docstrings need to be updated to reflect that path-like objects are also accepted. files: A Misc/NEWS.d/next/Core and Builtins/2018-10-25-20-53-32.bpo-29341.jH-AMF.rst M Modules/clinic/posixmodule.c.h M Modules/posixmodule.c diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-10-25-20-53-32.bpo-29341.jH-AMF.rst b/Misc/NEWS.d/next/Core and Builtins/2018-10-25-20-53-32.bpo-29341.jH-AMF.rst new file mode 100644 index 000000000000..954ce8cbc09a --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-10-25-20-53-32.bpo-29341.jH-AMF.rst @@ -0,0 +1,2 @@ +Clarify in the docstrings of :mod:`os` methods that path-like objects are also accepted +as input parameters. diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h index 99a1be70c12a..56010f408ccf 100644 --- a/Modules/clinic/posixmodule.c.h +++ b/Modules/clinic/posixmodule.c.h @@ -9,7 +9,7 @@ PyDoc_STRVAR(os_stat__doc__, "Perform a stat system call on the given path.\n" "\n" " path\n" -" Path to be examined; can be string, bytes, path-like object or\n" +" Path to be examined; can be string, bytes, a path-like object or\n" " open-file-descriptor int.\n" " dir_fd\n" " If not None, it should be a file descriptor open to a directory,\n" @@ -101,7 +101,7 @@ PyDoc_STRVAR(os_access__doc__, "Use the real uid/gid to test for access to a path.\n" "\n" " path\n" -" Path to be tested; can be string or bytes\n" +" Path to be tested; can be string, bytes, or a path-like object.\n" " mode\n" " Operating-system mode bitfield. Can be F_OK to test existence,\n" " or the inclusive-OR of R_OK, W_OK, and X_OK.\n" @@ -304,7 +304,7 @@ PyDoc_STRVAR(os_chmod__doc__, "Change the access permissions of a file.\n" "\n" " path\n" -" Path to be modified. May always be specified as a str or bytes.\n" +" Path to be modified. May always be specified as a str, bytes, or a path-like object.\n" " On some platforms, path may also be specified as an open file descriptor.\n" " If this functionality is unavailable, using it raises an exception.\n" " mode\n" @@ -655,7 +655,7 @@ PyDoc_STRVAR(os_chown__doc__, "Change the owner and group id of path to the numeric uid and gid.\\\n" "\n" " path\n" -" Path to be examined; can be string, bytes, or open-file-descriptor int.\n" +" Path to be examined; can be string, bytes, a path-like object, or open-file-descriptor int.\n" " dir_fd\n" " If not None, it should be a file descriptor open to a directory,\n" " and path should be relative; path will then be relative to that\n" @@ -889,7 +889,7 @@ PyDoc_STRVAR(os_listdir__doc__, "\n" "Return a list containing the names of the files in the directory.\n" "\n" -"path can be specified as either str or bytes. If path is bytes,\n" +"path can be specified as either str, bytes, or a path-like object. If path is bytes,\n" " the filenames returned will also be bytes; in all other circumstances\n" " the filenames returned will be str.\n" "If path is None, uses the path=\'.\'.\n" @@ -5532,7 +5532,7 @@ PyDoc_STRVAR(os_getxattr__doc__, "\n" "Return the value of extended attribute attribute on path.\n" "\n" -"path may be either a string or an open file descriptor.\n" +"path may be either a string, a path-like object, or an open file descriptor.\n" "If follow_symlinks is False, and the last element of the path is a symbolic\n" " link, getxattr will examine the symbolic link itself instead of the file\n" " the link points to."); @@ -5580,7 +5580,7 @@ PyDoc_STRVAR(os_setxattr__doc__, "\n" "Set extended attribute attribute on path to value.\n" "\n" -"path may be either a string or an open file descriptor.\n" +"path may be either a string, a path-like object, or an open file descriptor.\n" "If follow_symlinks is False, and the last element of the path is a symbolic\n" " link, setxattr will modify the symbolic link itself instead of the file\n" " the link points to."); @@ -5633,7 +5633,7 @@ PyDoc_STRVAR(os_removexattr__doc__, "\n" "Remove extended attribute attribute on path.\n" "\n" -"path may be either a string or an open file descriptor.\n" +"path may be either a string, a path-like object, or an open file descriptor.\n" "If follow_symlinks is False, and the last element of the path is a symbolic\n" " link, removexattr will modify the symbolic link itself instead of the file\n" " the link points to."); @@ -5680,7 +5680,7 @@ PyDoc_STRVAR(os_listxattr__doc__, "\n" "Return a list of extended attributes on path.\n" "\n" -"path may be either None, a string, or an open file descriptor.\n" +"path may be either None, a string, a path-like object, or an open file descriptor.\n" "if path is None, listxattr will examine the current directory.\n" "If follow_symlinks is False, and the last element of the path is a symbolic\n" " link, listxattr will examine the symbolic link itself instead of the file\n" @@ -6140,7 +6140,7 @@ PyDoc_STRVAR(os_scandir__doc__, "\n" "Return an iterator of DirEntry objects for given path.\n" "\n" -"path can be specified as either str, bytes or path-like object. If path\n" +"path can be specified as either str, bytes, or a path-like object. If path\n" "is bytes, the names of yielded DirEntry objects will also be bytes; in\n" "all other circumstances they will be str.\n" "\n" @@ -6757,4 +6757,4 @@ os_getrandom(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #ifndef OS_GETRANDOM_METHODDEF #define OS_GETRANDOM_METHODDEF #endif /* !defined(OS_GETRANDOM_METHODDEF) */ -/*[clinic end generated code: output=1603fddefffa1fb9 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f2951c34e0907fb6 input=a9049054013a1b77]*/ diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 0307436e3d59..bf886e31d762 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -2480,7 +2480,7 @@ class sched_param_converter(CConverter): os.stat path : path_t(allow_fd=True) - Path to be examined; can be string, bytes, path-like object or + Path to be examined; can be string, bytes, a path-like object or open-file-descriptor int. * @@ -2508,7 +2508,7 @@ It's an error to use dir_fd or follow_symlinks when specifying path as static PyObject * os_stat_impl(PyObject *module, path_t *path, int dir_fd, int follow_symlinks) -/*[clinic end generated code: output=7d4976e6f18a59c5 input=270bd64e7bb3c8f7]*/ +/*[clinic end generated code: output=7d4976e6f18a59c5 input=01d362ebcc06996b]*/ { return posix_do_stat("stat", path, dir_fd, follow_symlinks); } @@ -2542,7 +2542,7 @@ os_lstat_impl(PyObject *module, path_t *path, int dir_fd) os.access -> bool path: path_t - Path to be tested; can be string or bytes + Path to be tested; can be string, bytes, or a path-like object. mode: int Operating-system mode bitfield. Can be F_OK to test existence, @@ -2580,7 +2580,7 @@ Note that most operations will use the effective uid/gid, therefore this static int os_access_impl(PyObject *module, path_t *path, int mode, int dir_fd, int effective_ids, int follow_symlinks) -/*[clinic end generated code: output=cf84158bc90b1a77 input=8e8c3a6ba791fee3]*/ +/*[clinic end generated code: output=cf84158bc90b1a77 input=3ffe4e650ee3bf20]*/ { int return_value; @@ -2772,7 +2772,7 @@ os_fchdir_impl(PyObject *module, int fd) os.chmod path: path_t(allow_fd='PATH_HAVE_FCHMOD') - Path to be modified. May always be specified as a str or bytes. + Path to be modified. May always be specified as a str, bytes, or a path-like object. On some platforms, path may also be specified as an open file descriptor. If this functionality is unavailable, using it raises an exception. @@ -2803,7 +2803,7 @@ dir_fd and follow_symlinks may not be implemented on your platform. static PyObject * os_chmod_impl(PyObject *module, path_t *path, int mode, int dir_fd, int follow_symlinks) -/*[clinic end generated code: output=5cf6a94915cc7bff input=7f1618e5e15cc196]*/ +/*[clinic end generated code: output=5cf6a94915cc7bff input=989081551c00293b]*/ { int result; @@ -3123,7 +3123,7 @@ os_fdatasync_impl(PyObject *module, int fd) os.chown path : path_t(allow_fd='PATH_HAVE_FCHOWN') - Path to be examined; can be string, bytes, or open-file-descriptor int. + Path to be examined; can be string, bytes, a path-like object, or open-file-descriptor int. uid: uid_t @@ -3161,7 +3161,7 @@ dir_fd and follow_symlinks may not be implemented on your platform. static PyObject * os_chown_impl(PyObject *module, path_t *path, uid_t uid, gid_t gid, int dir_fd, int follow_symlinks) -/*[clinic end generated code: output=4beadab0db5f70cd input=a61cc35574814d5d]*/ +/*[clinic end generated code: output=4beadab0db5f70cd input=b08c5ec67996a97d]*/ { int result; @@ -3688,7 +3688,7 @@ os.listdir Return a list containing the names of the files in the directory. -path can be specified as either str or bytes. If path is bytes, +path can be specified as either str, bytes, or a path-like object. If path is bytes, the filenames returned will also be bytes; in all other circumstances the filenames returned will be str. If path is None, uses the path='.'. @@ -3704,7 +3704,7 @@ entries '.' and '..' even if they are present in the directory. static PyObject * os_listdir_impl(PyObject *module, path_t *path) -/*[clinic end generated code: output=293045673fcd1a75 input=09e300416e3cd729]*/ +/*[clinic end generated code: output=293045673fcd1a75 input=e3f58030f538295d]*/ { #if defined(MS_WINDOWS) && !defined(HAVE_OPENDIR) return _listdir_windows_no_opendir(path, NULL); @@ -11415,7 +11415,7 @@ os.getxattr Return the value of extended attribute attribute on path. -path may be either a string or an open file descriptor. +path may be either a string, a path-like object, or an open file descriptor. If follow_symlinks is False, and the last element of the path is a symbolic link, getxattr will examine the symbolic link itself instead of the file the link points to. @@ -11425,7 +11425,7 @@ If follow_symlinks is False, and the last element of the path is a symbolic static PyObject * os_getxattr_impl(PyObject *module, path_t *path, path_t *attribute, int follow_symlinks) -/*[clinic end generated code: output=5f2f44200a43cff2 input=8c8ea3bab78d89c2]*/ +/*[clinic end generated code: output=5f2f44200a43cff2 input=025789491708f7eb]*/ { Py_ssize_t i; PyObject *buffer = NULL; @@ -11487,7 +11487,7 @@ os.setxattr Set extended attribute attribute on path to value. -path may be either a string or an open file descriptor. +path may be either a string, a path-like object, or an open file descriptor. If follow_symlinks is False, and the last element of the path is a symbolic link, setxattr will modify the symbolic link itself instead of the file the link points to. @@ -11497,7 +11497,7 @@ If follow_symlinks is False, and the last element of the path is a symbolic static PyObject * os_setxattr_impl(PyObject *module, path_t *path, path_t *attribute, Py_buffer *value, int flags, int follow_symlinks) -/*[clinic end generated code: output=98b83f63fdde26bb input=f0d26833992015c2]*/ +/*[clinic end generated code: output=98b83f63fdde26bb input=c17c0103009042f0]*/ { ssize_t result; @@ -11535,7 +11535,7 @@ os.removexattr Remove extended attribute attribute on path. -path may be either a string or an open file descriptor. +path may be either a string, a path-like object, or an open file descriptor. If follow_symlinks is False, and the last element of the path is a symbolic link, removexattr will modify the symbolic link itself instead of the file the link points to. @@ -11545,7 +11545,7 @@ If follow_symlinks is False, and the last element of the path is a symbolic static PyObject * os_removexattr_impl(PyObject *module, path_t *path, path_t *attribute, int follow_symlinks) -/*[clinic end generated code: output=521a51817980cda6 input=cdb54834161e3329]*/ +/*[clinic end generated code: output=521a51817980cda6 input=3d9a7d36fe2f7c4e]*/ { ssize_t result; @@ -11578,7 +11578,7 @@ os.listxattr Return a list of extended attributes on path. -path may be either None, a string, or an open file descriptor. +path may be either None, a string, a path-like object, or an open file descriptor. if path is None, listxattr will examine the current directory. If follow_symlinks is False, and the last element of the path is a symbolic link, listxattr will examine the symbolic link itself instead of the file @@ -11587,7 +11587,7 @@ If follow_symlinks is False, and the last element of the path is a symbolic static PyObject * os_listxattr_impl(PyObject *module, path_t *path, int follow_symlinks) -/*[clinic end generated code: output=bebdb4e2ad0ce435 input=08cca53ac0b07c13]*/ +/*[clinic end generated code: output=bebdb4e2ad0ce435 input=9826edf9fdb90869]*/ { Py_ssize_t i; PyObject *result = NULL; @@ -12836,7 +12836,7 @@ os.scandir Return an iterator of DirEntry objects for given path. -path can be specified as either str, bytes or path-like object. If path +path can be specified as either str, bytes, or a path-like object. If path is bytes, the names of yielded DirEntry objects will also be bytes; in all other circumstances they will be str. @@ -12845,7 +12845,7 @@ If path is None, uses the path='.'. static PyObject * os_scandir_impl(PyObject *module, path_t *path) -/*[clinic end generated code: output=6eb2668b675ca89e input=b139dc1c57f60846]*/ +/*[clinic end generated code: output=6eb2668b675ca89e input=6bdd312708fc3bb0]*/ { ScandirIterator *iterator; #ifdef MS_WINDOWS From webhook-mailer at python.org Fri Nov 2 12:32:31 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 02 Nov 2018 16:32:31 -0000 Subject: [Python-checkins] bpo-35147: Fix _Py_NO_RETURN for GCC (GH-10300) Message-ID: https://github.com/python/cpython/commit/e2ed5adcb5db2d70cfa72da1ba8446f7aa9e05cd commit: e2ed5adcb5db2d70cfa72da1ba8446f7aa9e05cd branch: master author: Alexey Izbyshev committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-11-02T09:32:26-07:00 summary: bpo-35147: Fix _Py_NO_RETURN for GCC (GH-10300) Use `__GNUC__` instead of non-existing `__GNUC_MAJOR__`. https://bugs.python.org/issue35147 files: M Include/pyerrors.h diff --git a/Include/pyerrors.h b/Include/pyerrors.h index 4e2995469f3c..808e0def06b4 100644 --- a/Include/pyerrors.h +++ b/Include/pyerrors.h @@ -94,9 +94,9 @@ PyAPI_FUNC(void) PyErr_SetExcInfo(PyObject *, PyObject *, PyObject *); #endif #if defined(__clang__) || \ - (defined(__GNUC_MAJOR__) && \ - ((__GNUC_MAJOR__ >= 3) || \ - (__GNUC_MAJOR__ == 2) && (__GNUC_MINOR__ >= 5))) + (defined(__GNUC__) && \ + ((__GNUC__ >= 3) || \ + (__GNUC__ == 2) && (__GNUC_MINOR__ >= 5))) # define _Py_NO_RETURN __attribute__((__noreturn__)) #elif defined(_MSC_VER) # define _Py_NO_RETURN __declspec(noreturn) From webhook-mailer at python.org Fri Nov 2 13:55:46 2018 From: webhook-mailer at python.org (Pablo Galindo) Date: Fri, 02 Nov 2018 17:55:46 -0000 Subject: [Python-checkins] [3.6]bpo-29341: Backport b942707 3.6 (GH-10299) Message-ID: https://github.com/python/cpython/commit/8d2f88fb17468642813108977bb9ec5f7a065b84 commit: 8d2f88fb17468642813108977bb9ec5f7a065b84 branch: 3.6 author: BNMetrics committer: Pablo Galindo date: 2018-11-02T13:55:31-04:00 summary: [3.6]bpo-29341: Backport b942707 3.6 (GH-10299) Some methods in the os module can accept path-like objects. This is documented in the general documentation but not in the function docstrings. To keep both in sync, the docstrings need to be updated to reflect that path-like objects are also accepted.. (cherry picked from commit b942707fc23454a998323c17e30be78ff1a4f0e7) Co-authored-by: BNMetrics files: A Misc/NEWS.d/next/Core and Builtins/2018-10-25-20-53-32.bpo-29341.jH-AMF.rst M Modules/clinic/posixmodule.c.h M Modules/posixmodule.c diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-10-25-20-53-32.bpo-29341.jH-AMF.rst b/Misc/NEWS.d/next/Core and Builtins/2018-10-25-20-53-32.bpo-29341.jH-AMF.rst new file mode 100644 index 000000000000..954ce8cbc09a --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-10-25-20-53-32.bpo-29341.jH-AMF.rst @@ -0,0 +1,2 @@ +Clarify in the docstrings of :mod:`os` methods that path-like objects are also accepted +as input parameters. diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h index 0d3ce6eed65d..e615e00b33c1 100644 --- a/Modules/clinic/posixmodule.c.h +++ b/Modules/clinic/posixmodule.c.h @@ -9,7 +9,7 @@ PyDoc_STRVAR(os_stat__doc__, "Perform a stat system call on the given path.\n" "\n" " path\n" -" Path to be examined; can be string, bytes, path-like object or\n" +" Path to be examined; can be string, bytes, a path-like object or\n" " open-file-descriptor int.\n" " dir_fd\n" " If not None, it should be a file descriptor open to a directory,\n" @@ -101,7 +101,7 @@ PyDoc_STRVAR(os_access__doc__, "Use the real uid/gid to test for access to a path.\n" "\n" " path\n" -" Path to be tested; can be string or bytes\n" +" Path to be tested; can be string, bytes, or a path-like object.\n" " mode\n" " Operating-system mode bitfield. Can be F_OK to test existence,\n" " or the inclusive-OR of R_OK, W_OK, and X_OK.\n" @@ -304,7 +304,7 @@ PyDoc_STRVAR(os_chmod__doc__, "Change the access permissions of a file.\n" "\n" " path\n" -" Path to be modified. May always be specified as a str or bytes.\n" +" Path to be modified. May always be specified as a str, bytes, or a path-like object.\n" " On some platforms, path may also be specified as an open file descriptor.\n" " If this functionality is unavailable, using it raises an exception.\n" " mode\n" @@ -655,7 +655,7 @@ PyDoc_STRVAR(os_chown__doc__, "Change the owner and group id of path to the numeric uid and gid.\\\n" "\n" " path\n" -" Path to be examined; can be string, bytes, or open-file-descriptor int.\n" +" Path to be examined; can be string, bytes, a path-like object, or open-file-descriptor int.\n" " dir_fd\n" " If not None, it should be a file descriptor open to a directory,\n" " and path should be relative; path will then be relative to that\n" @@ -889,7 +889,7 @@ PyDoc_STRVAR(os_listdir__doc__, "\n" "Return a list containing the names of the files in the directory.\n" "\n" -"path can be specified as either str or bytes. If path is bytes,\n" +"path can be specified as either str, bytes, or a path-like object. If path is bytes,\n" " the filenames returned will also be bytes; in all other circumstances\n" " the filenames returned will be str.\n" "If path is None, uses the path=\'.\'.\n" @@ -5234,7 +5234,7 @@ PyDoc_STRVAR(os_getxattr__doc__, "\n" "Return the value of extended attribute attribute on path.\n" "\n" -"path may be either a string or an open file descriptor.\n" +"path may be either a string, a path-like object, or an open file descriptor.\n" "If follow_symlinks is False, and the last element of the path is a symbolic\n" " link, getxattr will examine the symbolic link itself instead of the file\n" " the link points to."); @@ -5282,7 +5282,7 @@ PyDoc_STRVAR(os_setxattr__doc__, "\n" "Set extended attribute attribute on path to value.\n" "\n" -"path may be either a string or an open file descriptor.\n" +"path may be either a string, a path-like object, or an open file descriptor.\n" "If follow_symlinks is False, and the last element of the path is a symbolic\n" " link, setxattr will modify the symbolic link itself instead of the file\n" " the link points to."); @@ -5335,7 +5335,7 @@ PyDoc_STRVAR(os_removexattr__doc__, "\n" "Remove extended attribute attribute on path.\n" "\n" -"path may be either a string or an open file descriptor.\n" +"path may be either a string, a path-like object, or an open file descriptor.\n" "If follow_symlinks is False, and the last element of the path is a symbolic\n" " link, removexattr will modify the symbolic link itself instead of the file\n" " the link points to."); @@ -5382,7 +5382,7 @@ PyDoc_STRVAR(os_listxattr__doc__, "\n" "Return a list of extended attributes on path.\n" "\n" -"path may be either None, a string, or an open file descriptor.\n" +"path may be either None, a string, a path-like object, or an open file descriptor.\n" "if path is None, listxattr will examine the current directory.\n" "If follow_symlinks is False, and the last element of the path is a symbolic\n" " link, listxattr will examine the symbolic link itself instead of the file\n" @@ -6150,4 +6150,4 @@ os_getrandom(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwna #ifndef OS_GETRANDOM_METHODDEF #define OS_GETRANDOM_METHODDEF #endif /* !defined(OS_GETRANDOM_METHODDEF) */ -/*[clinic end generated code: output=455def991740915a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=92026f29ec925950 input=a9049054013a1b77]*/ diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 7358c393b1a0..f5642d267299 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -2391,7 +2391,7 @@ class sched_param_converter(CConverter): os.stat path : path_t(allow_fd=True) - Path to be examined; can be string, bytes, path-like object or + Path to be examined; can be string, bytes, a path-like object or open-file-descriptor int. * @@ -2419,7 +2419,7 @@ It's an error to use dir_fd or follow_symlinks when specifying path as static PyObject * os_stat_impl(PyObject *module, path_t *path, int dir_fd, int follow_symlinks) -/*[clinic end generated code: output=7d4976e6f18a59c5 input=270bd64e7bb3c8f7]*/ +/*[clinic end generated code: output=7d4976e6f18a59c5 input=01d362ebcc06996b]*/ { return posix_do_stat("stat", path, dir_fd, follow_symlinks); } @@ -2453,7 +2453,7 @@ os_lstat_impl(PyObject *module, path_t *path, int dir_fd) os.access -> bool path: path_t - Path to be tested; can be string or bytes + Path to be tested; can be string, bytes, or a path-like object. mode: int Operating-system mode bitfield. Can be F_OK to test existence, @@ -2491,7 +2491,7 @@ Note that most operations will use the effective uid/gid, therefore this static int os_access_impl(PyObject *module, path_t *path, int mode, int dir_fd, int effective_ids, int follow_symlinks) -/*[clinic end generated code: output=cf84158bc90b1a77 input=8e8c3a6ba791fee3]*/ +/*[clinic end generated code: output=cf84158bc90b1a77 input=3ffe4e650ee3bf20]*/ { int return_value; @@ -2683,7 +2683,7 @@ os_fchdir_impl(PyObject *module, int fd) os.chmod path: path_t(allow_fd='PATH_HAVE_FCHMOD') - Path to be modified. May always be specified as a str or bytes. + Path to be modified. May always be specified as a str, bytes, or a path-like object. On some platforms, path may also be specified as an open file descriptor. If this functionality is unavailable, using it raises an exception. @@ -2714,7 +2714,7 @@ dir_fd and follow_symlinks may not be implemented on your platform. static PyObject * os_chmod_impl(PyObject *module, path_t *path, int mode, int dir_fd, int follow_symlinks) -/*[clinic end generated code: output=5cf6a94915cc7bff input=7f1618e5e15cc196]*/ +/*[clinic end generated code: output=5cf6a94915cc7bff input=989081551c00293b]*/ { int result; @@ -3034,7 +3034,7 @@ os_fdatasync_impl(PyObject *module, int fd) os.chown path : path_t(allow_fd='PATH_HAVE_FCHOWN') - Path to be examined; can be string, bytes, or open-file-descriptor int. + Path to be examined; can be string, bytes, a path-like object, or open-file-descriptor int. uid: uid_t @@ -3072,7 +3072,7 @@ dir_fd and follow_symlinks may not be implemented on your platform. static PyObject * os_chown_impl(PyObject *module, path_t *path, uid_t uid, gid_t gid, int dir_fd, int follow_symlinks) -/*[clinic end generated code: output=4beadab0db5f70cd input=a61cc35574814d5d]*/ +/*[clinic end generated code: output=4beadab0db5f70cd input=b08c5ec67996a97d]*/ { int result; @@ -3599,7 +3599,7 @@ os.listdir Return a list containing the names of the files in the directory. -path can be specified as either str or bytes. If path is bytes, +path can be specified as either str, bytes, or a path-like object. If path is bytes, the filenames returned will also be bytes; in all other circumstances the filenames returned will be str. If path is None, uses the path='.'. @@ -3615,7 +3615,7 @@ entries '.' and '..' even if they are present in the directory. static PyObject * os_listdir_impl(PyObject *module, path_t *path) -/*[clinic end generated code: output=293045673fcd1a75 input=09e300416e3cd729]*/ +/*[clinic end generated code: output=293045673fcd1a75 input=e3f58030f538295d]*/ { #if defined(MS_WINDOWS) && !defined(HAVE_OPENDIR) return _listdir_windows_no_opendir(path, NULL); @@ -10667,7 +10667,7 @@ os.getxattr Return the value of extended attribute attribute on path. -path may be either a string or an open file descriptor. +path may be either a string, a path-like object, or an open file descriptor. If follow_symlinks is False, and the last element of the path is a symbolic link, getxattr will examine the symbolic link itself instead of the file the link points to. @@ -10677,7 +10677,7 @@ If follow_symlinks is False, and the last element of the path is a symbolic static PyObject * os_getxattr_impl(PyObject *module, path_t *path, path_t *attribute, int follow_symlinks) -/*[clinic end generated code: output=5f2f44200a43cff2 input=8c8ea3bab78d89c2]*/ +/*[clinic end generated code: output=5f2f44200a43cff2 input=025789491708f7eb]*/ { Py_ssize_t i; PyObject *buffer = NULL; @@ -10739,7 +10739,7 @@ os.setxattr Set extended attribute attribute on path to value. -path may be either a string or an open file descriptor. +path may be either a string, a path-like object, or an open file descriptor. If follow_symlinks is False, and the last element of the path is a symbolic link, setxattr will modify the symbolic link itself instead of the file the link points to. @@ -10749,7 +10749,7 @@ If follow_symlinks is False, and the last element of the path is a symbolic static PyObject * os_setxattr_impl(PyObject *module, path_t *path, path_t *attribute, Py_buffer *value, int flags, int follow_symlinks) -/*[clinic end generated code: output=98b83f63fdde26bb input=f0d26833992015c2]*/ +/*[clinic end generated code: output=98b83f63fdde26bb input=c17c0103009042f0]*/ { ssize_t result; @@ -10787,7 +10787,7 @@ os.removexattr Remove extended attribute attribute on path. -path may be either a string or an open file descriptor. +path may be either a string, a path-like object, or an open file descriptor. If follow_symlinks is False, and the last element of the path is a symbolic link, removexattr will modify the symbolic link itself instead of the file the link points to. @@ -10797,7 +10797,7 @@ If follow_symlinks is False, and the last element of the path is a symbolic static PyObject * os_removexattr_impl(PyObject *module, path_t *path, path_t *attribute, int follow_symlinks) -/*[clinic end generated code: output=521a51817980cda6 input=cdb54834161e3329]*/ +/*[clinic end generated code: output=521a51817980cda6 input=3d9a7d36fe2f7c4e]*/ { ssize_t result; @@ -10830,7 +10830,7 @@ os.listxattr Return a list of extended attributes on path. -path may be either None, a string, or an open file descriptor. +path may be either None, a string, a path-like object, or an open file descriptor. if path is None, listxattr will examine the current directory. If follow_symlinks is False, and the last element of the path is a symbolic link, listxattr will examine the symbolic link itself instead of the file @@ -10839,7 +10839,7 @@ If follow_symlinks is False, and the last element of the path is a symbolic static PyObject * os_listxattr_impl(PyObject *module, path_t *path, int follow_symlinks) -/*[clinic end generated code: output=bebdb4e2ad0ce435 input=08cca53ac0b07c13]*/ +/*[clinic end generated code: output=bebdb4e2ad0ce435 input=9826edf9fdb90869]*/ { Py_ssize_t i; PyObject *result = NULL; From webhook-mailer at python.org Fri Nov 2 13:56:29 2018 From: webhook-mailer at python.org (Pablo Galindo) Date: Fri, 02 Nov 2018 17:56:29 -0000 Subject: [Python-checkins] [3.7]bpo-29341: Backport b942707 3.7 (#10298) Message-ID: https://github.com/python/cpython/commit/08026b103ea8f4c9f2b5045ef7806dd8b760da2b commit: 08026b103ea8f4c9f2b5045ef7806dd8b760da2b branch: 3.7 author: BNMetrics committer: Pablo Galindo date: 2018-11-02T13:56:25-04:00 summary: [3.7]bpo-29341: Backport b942707 3.7 (#10298) Some methods in the os module can accept path-like objects. This is documented in the general documentation but not in the function docstrings. To keep both in sync, the docstrings need to be updated to reflect that path-like objects are also accepted.. (cherry picked from commit b942707fc23454a998323c17e30be78ff1a4f0e7) Co-authored-by: BNMetrics files: A Misc/NEWS.d/next/Core and Builtins/2018-10-25-20-53-32.bpo-29341.jH-AMF.rst M Modules/clinic/posixmodule.c.h M Modules/posixmodule.c diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-10-25-20-53-32.bpo-29341.jH-AMF.rst b/Misc/NEWS.d/next/Core and Builtins/2018-10-25-20-53-32.bpo-29341.jH-AMF.rst new file mode 100644 index 000000000000..954ce8cbc09a --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-10-25-20-53-32.bpo-29341.jH-AMF.rst @@ -0,0 +1,2 @@ +Clarify in the docstrings of :mod:`os` methods that path-like objects are also accepted +as input parameters. diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h index ab1f75350340..3230cd700972 100644 --- a/Modules/clinic/posixmodule.c.h +++ b/Modules/clinic/posixmodule.c.h @@ -9,7 +9,7 @@ PyDoc_STRVAR(os_stat__doc__, "Perform a stat system call on the given path.\n" "\n" " path\n" -" Path to be examined; can be string, bytes, path-like object or\n" +" Path to be examined; can be string, bytes, a path-like object or\n" " open-file-descriptor int.\n" " dir_fd\n" " If not None, it should be a file descriptor open to a directory,\n" @@ -101,7 +101,7 @@ PyDoc_STRVAR(os_access__doc__, "Use the real uid/gid to test for access to a path.\n" "\n" " path\n" -" Path to be tested; can be string or bytes\n" +" Path to be tested; can be string, bytes, or a path-like object.\n" " mode\n" " Operating-system mode bitfield. Can be F_OK to test existence,\n" " or the inclusive-OR of R_OK, W_OK, and X_OK.\n" @@ -304,7 +304,7 @@ PyDoc_STRVAR(os_chmod__doc__, "Change the access permissions of a file.\n" "\n" " path\n" -" Path to be modified. May always be specified as a str or bytes.\n" +" Path to be modified. May always be specified as a str, bytes, or a path-like object.\n" " On some platforms, path may also be specified as an open file descriptor.\n" " If this functionality is unavailable, using it raises an exception.\n" " mode\n" @@ -655,7 +655,7 @@ PyDoc_STRVAR(os_chown__doc__, "Change the owner and group id of path to the numeric uid and gid.\\\n" "\n" " path\n" -" Path to be examined; can be string, bytes, or open-file-descriptor int.\n" +" Path to be examined; can be string, bytes, a path-like object, or open-file-descriptor int.\n" " dir_fd\n" " If not None, it should be a file descriptor open to a directory,\n" " and path should be relative; path will then be relative to that\n" @@ -889,7 +889,7 @@ PyDoc_STRVAR(os_listdir__doc__, "\n" "Return a list containing the names of the files in the directory.\n" "\n" -"path can be specified as either str or bytes. If path is bytes,\n" +"path can be specified as either str, bytes, or a path-like object. If path is bytes,\n" " the filenames returned will also be bytes; in all other circumstances\n" " the filenames returned will be str.\n" "If path is None, uses the path=\'.\'.\n" @@ -5406,7 +5406,7 @@ PyDoc_STRVAR(os_getxattr__doc__, "\n" "Return the value of extended attribute attribute on path.\n" "\n" -"path may be either a string or an open file descriptor.\n" +"path may be either a string, a path-like object, or an open file descriptor.\n" "If follow_symlinks is False, and the last element of the path is a symbolic\n" " link, getxattr will examine the symbolic link itself instead of the file\n" " the link points to."); @@ -5454,7 +5454,7 @@ PyDoc_STRVAR(os_setxattr__doc__, "\n" "Set extended attribute attribute on path to value.\n" "\n" -"path may be either a string or an open file descriptor.\n" +"path may be either a string, a path-like object, or an open file descriptor.\n" "If follow_symlinks is False, and the last element of the path is a symbolic\n" " link, setxattr will modify the symbolic link itself instead of the file\n" " the link points to."); @@ -5507,7 +5507,7 @@ PyDoc_STRVAR(os_removexattr__doc__, "\n" "Remove extended attribute attribute on path.\n" "\n" -"path may be either a string or an open file descriptor.\n" +"path may be either a string, a path-like object, or an open file descriptor.\n" "If follow_symlinks is False, and the last element of the path is a symbolic\n" " link, removexattr will modify the symbolic link itself instead of the file\n" " the link points to."); @@ -5554,7 +5554,7 @@ PyDoc_STRVAR(os_listxattr__doc__, "\n" "Return a list of extended attributes on path.\n" "\n" -"path may be either None, a string, or an open file descriptor.\n" +"path may be either None, a string, a path-like object, or an open file descriptor.\n" "if path is None, listxattr will examine the current directory.\n" "If follow_symlinks is False, and the last element of the path is a symbolic\n" " link, listxattr will examine the symbolic link itself instead of the file\n" @@ -5940,7 +5940,7 @@ PyDoc_STRVAR(os_scandir__doc__, "\n" "Return an iterator of DirEntry objects for given path.\n" "\n" -"path can be specified as either str, bytes or path-like object. If path\n" +"path can be specified as either str, bytes, or a path-like object. If path\n" "is bytes, the names of yielded DirEntry objects will also be bytes; in\n" "all other circumstances they will be str.\n" "\n" @@ -6537,4 +6537,4 @@ os_getrandom(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #ifndef OS_GETRANDOM_METHODDEF #define OS_GETRANDOM_METHODDEF #endif /* !defined(OS_GETRANDOM_METHODDEF) */ -/*[clinic end generated code: output=c966c821d557b7c0 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c6ca6ad4afa64454 input=a9049054013a1b77]*/ diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 0c48a66a64dd..8ff487d8cc1f 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -2446,7 +2446,7 @@ class sched_param_converter(CConverter): os.stat path : path_t(allow_fd=True) - Path to be examined; can be string, bytes, path-like object or + Path to be examined; can be string, bytes, a path-like object or open-file-descriptor int. * @@ -2474,7 +2474,7 @@ It's an error to use dir_fd or follow_symlinks when specifying path as static PyObject * os_stat_impl(PyObject *module, path_t *path, int dir_fd, int follow_symlinks) -/*[clinic end generated code: output=7d4976e6f18a59c5 input=270bd64e7bb3c8f7]*/ +/*[clinic end generated code: output=7d4976e6f18a59c5 input=01d362ebcc06996b]*/ { return posix_do_stat("stat", path, dir_fd, follow_symlinks); } @@ -2508,7 +2508,7 @@ os_lstat_impl(PyObject *module, path_t *path, int dir_fd) os.access -> bool path: path_t - Path to be tested; can be string or bytes + Path to be tested; can be string, bytes, or a path-like object. mode: int Operating-system mode bitfield. Can be F_OK to test existence, @@ -2546,7 +2546,7 @@ Note that most operations will use the effective uid/gid, therefore this static int os_access_impl(PyObject *module, path_t *path, int mode, int dir_fd, int effective_ids, int follow_symlinks) -/*[clinic end generated code: output=cf84158bc90b1a77 input=8e8c3a6ba791fee3]*/ +/*[clinic end generated code: output=cf84158bc90b1a77 input=3ffe4e650ee3bf20]*/ { int return_value; @@ -2738,7 +2738,7 @@ os_fchdir_impl(PyObject *module, int fd) os.chmod path: path_t(allow_fd='PATH_HAVE_FCHMOD') - Path to be modified. May always be specified as a str or bytes. + Path to be modified. May always be specified as a str, bytes, or a path-like object. On some platforms, path may also be specified as an open file descriptor. If this functionality is unavailable, using it raises an exception. @@ -2769,7 +2769,7 @@ dir_fd and follow_symlinks may not be implemented on your platform. static PyObject * os_chmod_impl(PyObject *module, path_t *path, int mode, int dir_fd, int follow_symlinks) -/*[clinic end generated code: output=5cf6a94915cc7bff input=7f1618e5e15cc196]*/ +/*[clinic end generated code: output=5cf6a94915cc7bff input=989081551c00293b]*/ { int result; @@ -3089,7 +3089,7 @@ os_fdatasync_impl(PyObject *module, int fd) os.chown path : path_t(allow_fd='PATH_HAVE_FCHOWN') - Path to be examined; can be string, bytes, or open-file-descriptor int. + Path to be examined; can be string, bytes, a path-like object, or open-file-descriptor int. uid: uid_t @@ -3127,7 +3127,7 @@ dir_fd and follow_symlinks may not be implemented on your platform. static PyObject * os_chown_impl(PyObject *module, path_t *path, uid_t uid, gid_t gid, int dir_fd, int follow_symlinks) -/*[clinic end generated code: output=4beadab0db5f70cd input=a61cc35574814d5d]*/ +/*[clinic end generated code: output=4beadab0db5f70cd input=b08c5ec67996a97d]*/ { int result; @@ -3654,7 +3654,7 @@ os.listdir Return a list containing the names of the files in the directory. -path can be specified as either str or bytes. If path is bytes, +path can be specified as either str, bytes, or a path-like object. If path is bytes, the filenames returned will also be bytes; in all other circumstances the filenames returned will be str. If path is None, uses the path='.'. @@ -3670,7 +3670,7 @@ entries '.' and '..' even if they are present in the directory. static PyObject * os_listdir_impl(PyObject *module, path_t *path) -/*[clinic end generated code: output=293045673fcd1a75 input=09e300416e3cd729]*/ +/*[clinic end generated code: output=293045673fcd1a75 input=e3f58030f538295d]*/ { #if defined(MS_WINDOWS) && !defined(HAVE_OPENDIR) return _listdir_windows_no_opendir(path, NULL); @@ -10973,7 +10973,7 @@ os.getxattr Return the value of extended attribute attribute on path. -path may be either a string or an open file descriptor. +path may be either a string, a path-like object, or an open file descriptor. If follow_symlinks is False, and the last element of the path is a symbolic link, getxattr will examine the symbolic link itself instead of the file the link points to. @@ -10983,7 +10983,7 @@ If follow_symlinks is False, and the last element of the path is a symbolic static PyObject * os_getxattr_impl(PyObject *module, path_t *path, path_t *attribute, int follow_symlinks) -/*[clinic end generated code: output=5f2f44200a43cff2 input=8c8ea3bab78d89c2]*/ +/*[clinic end generated code: output=5f2f44200a43cff2 input=025789491708f7eb]*/ { Py_ssize_t i; PyObject *buffer = NULL; @@ -11045,7 +11045,7 @@ os.setxattr Set extended attribute attribute on path to value. -path may be either a string or an open file descriptor. +path may be either a string, a path-like object, or an open file descriptor. If follow_symlinks is False, and the last element of the path is a symbolic link, setxattr will modify the symbolic link itself instead of the file the link points to. @@ -11055,7 +11055,7 @@ If follow_symlinks is False, and the last element of the path is a symbolic static PyObject * os_setxattr_impl(PyObject *module, path_t *path, path_t *attribute, Py_buffer *value, int flags, int follow_symlinks) -/*[clinic end generated code: output=98b83f63fdde26bb input=f0d26833992015c2]*/ +/*[clinic end generated code: output=98b83f63fdde26bb input=c17c0103009042f0]*/ { ssize_t result; @@ -11093,7 +11093,7 @@ os.removexattr Remove extended attribute attribute on path. -path may be either a string or an open file descriptor. +path may be either a string, a path-like object, or an open file descriptor. If follow_symlinks is False, and the last element of the path is a symbolic link, removexattr will modify the symbolic link itself instead of the file the link points to. @@ -11103,7 +11103,7 @@ If follow_symlinks is False, and the last element of the path is a symbolic static PyObject * os_removexattr_impl(PyObject *module, path_t *path, path_t *attribute, int follow_symlinks) -/*[clinic end generated code: output=521a51817980cda6 input=cdb54834161e3329]*/ +/*[clinic end generated code: output=521a51817980cda6 input=3d9a7d36fe2f7c4e]*/ { ssize_t result; @@ -11136,7 +11136,7 @@ os.listxattr Return a list of extended attributes on path. -path may be either None, a string, or an open file descriptor. +path may be either None, a string, a path-like object, or an open file descriptor. if path is None, listxattr will examine the current directory. If follow_symlinks is False, and the last element of the path is a symbolic link, listxattr will examine the symbolic link itself instead of the file @@ -11145,7 +11145,7 @@ If follow_symlinks is False, and the last element of the path is a symbolic static PyObject * os_listxattr_impl(PyObject *module, path_t *path, int follow_symlinks) -/*[clinic end generated code: output=bebdb4e2ad0ce435 input=08cca53ac0b07c13]*/ +/*[clinic end generated code: output=bebdb4e2ad0ce435 input=9826edf9fdb90869]*/ { Py_ssize_t i; PyObject *result = NULL; @@ -12392,7 +12392,7 @@ os.scandir Return an iterator of DirEntry objects for given path. -path can be specified as either str, bytes or path-like object. If path +path can be specified as either str, bytes, or a path-like object. If path is bytes, the names of yielded DirEntry objects will also be bytes; in all other circumstances they will be str. @@ -12401,7 +12401,7 @@ If path is None, uses the path='.'. static PyObject * os_scandir_impl(PyObject *module, path_t *path) -/*[clinic end generated code: output=6eb2668b675ca89e input=b139dc1c57f60846]*/ +/*[clinic end generated code: output=6eb2668b675ca89e input=6bdd312708fc3bb0]*/ { ScandirIterator *iterator; #ifdef MS_WINDOWS From webhook-mailer at python.org Fri Nov 2 14:23:59 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 02 Nov 2018 18:23:59 -0000 Subject: [Python-checkins] [3.6] bpo-35147: Fix _Py_NO_RETURN for GCC (GH-10300) (GH-10302) Message-ID: https://github.com/python/cpython/commit/29abad099535f4bcb1531df93bafbd75b26d6adc commit: 29abad099535f4bcb1531df93bafbd75b26d6adc branch: 3.6 author: Alexey Izbyshev committer: Victor Stinner date: 2018-11-02T19:23:51+01:00 summary: [3.6] bpo-35147: Fix _Py_NO_RETURN for GCC (GH-10300) (GH-10302) Use `__GNUC__` instead of non-existing `__GNUC_MAJOR__`. (cherry picked from commit e2ed5adcb5db2d70cfa72da1ba8446f7aa9e05cd) files: M Include/pyerrors.h diff --git a/Include/pyerrors.h b/Include/pyerrors.h index c28c1373f82f..44f20303c299 100644 --- a/Include/pyerrors.h +++ b/Include/pyerrors.h @@ -93,9 +93,9 @@ PyAPI_FUNC(void) PyErr_SetExcInfo(PyObject *, PyObject *, PyObject *); #endif #if defined(__clang__) || \ - (defined(__GNUC_MAJOR__) && \ - ((__GNUC_MAJOR__ >= 3) || \ - (__GNUC_MAJOR__ == 2) && (__GNUC_MINOR__ >= 5))) + (defined(__GNUC__) && \ + ((__GNUC__ >= 3) || \ + (__GNUC__ == 2) && (__GNUC_MINOR__ >= 5))) #define _Py_NO_RETURN __attribute__((__noreturn__)) #else #define _Py_NO_RETURN From webhook-mailer at python.org Fri Nov 2 21:30:16 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 03 Nov 2018 01:30:16 -0000 Subject: [Python-checkins] [3.7] bpo-35147: Fix _Py_NO_RETURN for GCC (GH-10300) (GH-10301) Message-ID: https://github.com/python/cpython/commit/a9122d183b1fbc4484d72aec69fc0979c7fd91f2 commit: a9122d183b1fbc4484d72aec69fc0979c7fd91f2 branch: 3.7 author: Alexey Izbyshev committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-11-02T18:30:11-07:00 summary: [3.7] bpo-35147: Fix _Py_NO_RETURN for GCC (GH-10300) (GH-10301) Use `__GNUC__` instead of non-existing `__GNUC_MAJOR__`. (cherry picked from commit e2ed5adcb5db2d70cfa72da1ba8446f7aa9e05cd) https://bugs.python.org/issue35147 files: M Include/pyerrors.h diff --git a/Include/pyerrors.h b/Include/pyerrors.h index f289471be20c..f49d4e8bd08c 100644 --- a/Include/pyerrors.h +++ b/Include/pyerrors.h @@ -94,9 +94,9 @@ PyAPI_FUNC(void) PyErr_SetExcInfo(PyObject *, PyObject *, PyObject *); #endif #if defined(__clang__) || \ - (defined(__GNUC_MAJOR__) && \ - ((__GNUC_MAJOR__ >= 3) || \ - (__GNUC_MAJOR__ == 2) && (__GNUC_MINOR__ >= 5))) + (defined(__GNUC__) && \ + ((__GNUC__ >= 3) || \ + (__GNUC__ == 2) && (__GNUC_MINOR__ >= 5))) #define _Py_NO_RETURN __attribute__((__noreturn__)) #else #define _Py_NO_RETURN From solipsis at pitrou.net Sat Nov 3 05:09:19 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Sat, 03 Nov 2018 09:09:19 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=12 Message-ID: <20181103090919.1.527F4B46337036B8@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [7, -7, 8] memory blocks, sum=8 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_forkserver leaked [-1, 2, -1] memory blocks, sum=0 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogcl6rDp', '--timeout', '7200'] From webhook-mailer at python.org Sat Nov 3 11:06:04 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sat, 03 Nov 2018 15:06:04 -0000 Subject: [Python-checkins] Fix a typo about a comma. (GH-10306) Message-ID: https://github.com/python/cpython/commit/fe62d877e300e1ee4145fff8f2bdba498b685f91 commit: fe62d877e300e1ee4145fff8f2bdba498b685f91 branch: master author: ?smail Ar?l?k committer: Serhiy Storchaka date: 2018-11-03T17:05:59+02:00 summary: Fix a typo about a comma. (GH-10306) files: M Doc/tutorial/errors.rst diff --git a/Doc/tutorial/errors.rst b/Doc/tutorial/errors.rst index aba61da5f7c3..957cbf962b20 100644 --- a/Doc/tutorial/errors.rst +++ b/Doc/tutorial/errors.rst @@ -314,7 +314,7 @@ to create specific exception classes for different error conditions:: self.next = next self.message = message -Most exceptions are defined with names that end in "Error," similar to the +Most exceptions are defined with names that end in "Error", similar to the naming of the standard exceptions. Many standard modules define their own exceptions to report errors that may From webhook-mailer at python.org Sat Nov 3 11:24:27 2018 From: webhook-mailer at python.org (Julien Palard) Date: Sat, 03 Nov 2018 15:24:27 -0000 Subject: [Python-checkins] bpo-34969: Add --fast, --best on the gzip CLI (GH-9833) Message-ID: https://github.com/python/cpython/commit/3e28eed9ec2249bb11ad0db4629271b7ce9b7918 commit: 3e28eed9ec2249bb11ad0db4629271b7ce9b7918 branch: master author: St?phane Wirtel committer: Julien Palard date: 2018-11-03T16:24:23+01:00 summary: bpo-34969: Add --fast, --best on the gzip CLI (GH-9833) files: A Misc/NEWS.d/next/Library/2018-10-13-07-46-50.bpo-34969.Mfnhjb.rst M Doc/library/gzip.rst M Lib/gzip.py M Lib/test/test_gzip.py diff --git a/Doc/library/gzip.rst b/Doc/library/gzip.rst index b52dd1a11aa9..a93f37743854 100644 --- a/Doc/library/gzip.rst +++ b/Doc/library/gzip.rst @@ -222,25 +222,26 @@ Once executed the :mod:`gzip` module keeps the input file(s). .. versionchanged:: 3.8 Add a new command line interface with a usage. + By default, when you will execute the CLI, the default compression level is 6. Command line options ^^^^^^^^^^^^^^^^^^^^ .. cmdoption:: file - .. code-block:: shell-session + If *file* is not specified, read from :attr:`sys.stdin`. - $ python -m gzip file +.. cmdoption:: --fast - If *file* is not specified, read from :attr:`sys.stdin`. + Indicates the fastest compression method (less compression). -.. cmdoption:: -d, --decompress +.. cmdoption:: --best - Decompress the given file + Indicates the slowest compression method (best compression). - .. code-block:: shell-session +.. cmdoption:: -d, --decompress - $ python -m gzip -d file.gz + Decompress the given file. .. cmdoption:: -h, --help diff --git a/Lib/gzip.py b/Lib/gzip.py index a34d01ae36e1..151ff1405b16 100644 --- a/Lib/gzip.py +++ b/Lib/gzip.py @@ -17,7 +17,12 @@ READ, WRITE = 1, 2 -def open(filename, mode="rb", compresslevel=9, +_COMPRESS_LEVEL_FAST = 1 +_COMPRESS_LEVEL_TRADEOFF = 6 +_COMPRESS_LEVEL_BEST = 9 + + +def open(filename, mode="rb", compresslevel=_COMPRESS_LEVEL_BEST, encoding=None, errors=None, newline=None): """Open a gzip-compressed file in binary or text mode. @@ -121,7 +126,7 @@ class GzipFile(_compression.BaseStream): myfileobj = None def __init__(self, filename=None, mode=None, - compresslevel=9, fileobj=None, mtime=None): + compresslevel=_COMPRESS_LEVEL_BEST, fileobj=None, mtime=None): """Constructor for the GzipFile class. At least one of fileobj and filename must be given a @@ -515,7 +520,7 @@ def _rewind(self): super()._rewind() self._new_member = True -def compress(data, compresslevel=9): +def compress(data, compresslevel=_COMPRESS_LEVEL_BEST): """Compress data in one shot and return the compressed string. Optional argument is the compression level, in range of 0-9. """ @@ -537,10 +542,21 @@ def main(): parser = ArgumentParser(description= "A simple command line interface for the gzip module: act like gzip, " "but do not delete the input file.") - parser.add_argument("-d", "--decompress", action="store_true", + group = parser.add_mutually_exclusive_group() + group.add_argument('--fast', action='store_true', help='compress faster') + group.add_argument('--best', action='store_true', help='compress better') + group.add_argument("-d", "--decompress", action="store_true", help="act like gunzip instead of gzip") + parser.add_argument("args", nargs="*", default=["-"], metavar='file') args = parser.parse_args() + + compresslevel = _COMPRESS_LEVEL_TRADEOFF + if args.fast: + compresslevel = _COMPRESS_LEVEL_FAST + elif args.best: + compresslevel = _COMPRESS_LEVEL_BEST + for arg in args.args: if args.decompress: if arg == "-": @@ -555,7 +571,8 @@ def main(): else: if arg == "-": f = sys.stdin.buffer - g = GzipFile(filename="", mode="wb", fileobj=sys.stdout.buffer) + g = GzipFile(filename="", mode="wb", fileobj=sys.stdout.buffer, + compresslevel=compresslevel) else: f = builtins.open(arg, "rb") g = open(arg + ".gz", "wb") diff --git a/Lib/test/test_gzip.py b/Lib/test/test_gzip.py index b072ce4682c0..1e8b41f07b3e 100644 --- a/Lib/test/test_gzip.py +++ b/Lib/test/test_gzip.py @@ -12,7 +12,7 @@ from subprocess import PIPE, Popen from test import support from test.support import _4G, bigmemtest -from test.support.script_helper import assert_python_ok +from test.support.script_helper import assert_python_ok, assert_python_failure gzip = support.import_module('gzip') @@ -746,10 +746,38 @@ def test_compress_infile_outfile(self): rc, out, err = assert_python_ok('-m', 'gzip', local_testgzip) self.assertTrue(os.path.exists(gzipname)) - self.assertEqual(rc, 0) self.assertEqual(out, b'') self.assertEqual(err, b'') + @create_and_remove_directory(TEMPDIR) + def test_compress_infile_outfile(self): + for compress_level in ('--fast', '--best'): + with self.subTest(compress_level=compress_level): + local_testgzip = os.path.join(TEMPDIR, 'testgzip') + gzipname = local_testgzip + '.gz' + self.assertFalse(os.path.exists(gzipname)) + + with open(local_testgzip, 'wb') as fp: + fp.write(self.data) + + rc, out, err = assert_python_ok('-m', 'gzip', compress_level, local_testgzip) + + self.assertTrue(os.path.exists(gzipname)) + self.assertEqual(out, b'') + self.assertEqual(err, b'') + os.remove(gzipname) + self.assertFalse(os.path.exists(gzipname)) + + def test_compress_fast_best_are_exclusive(self): + rc, out, err = assert_python_failure('-m', 'gzip', '--fast', '--best') + self.assertIn(b"error: argument --best: not allowed with argument --fast", err) + self.assertEqual(out, b'') + + def test_decompress_cannot_have_flags_compression(self): + rc, out, err = assert_python_failure('-m', 'gzip', '--fast', '-d') + self.assertIn(b'error: argument -d/--decompress: not allowed with argument --fast', err) + self.assertEqual(out, b'') + def test_main(verbose=None): support.run_unittest(TestGzip, TestOpen, TestCommandLine) diff --git a/Misc/NEWS.d/next/Library/2018-10-13-07-46-50.bpo-34969.Mfnhjb.rst b/Misc/NEWS.d/next/Library/2018-10-13-07-46-50.bpo-34969.Mfnhjb.rst new file mode 100644 index 000000000000..e3b713261406 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-13-07-46-50.bpo-34969.Mfnhjb.rst @@ -0,0 +1,3 @@ +gzip: Add --fast, --best on the gzip CLI, these parameters will be used for the +fast compression method (quick) or the best method compress (slower, but smaller +file). Also, change the default compression level to 6 (tradeoff). From webhook-mailer at python.org Sat Nov 3 13:41:42 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 03 Nov 2018 17:41:42 -0000 Subject: [Python-checkins] Fix a typo about a comma. (GH-10306) Message-ID: https://github.com/python/cpython/commit/133fd6527d66e0e744210e0494762a67ff02a6c4 commit: 133fd6527d66e0e744210e0494762a67ff02a6c4 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-03T10:41:38-07:00 summary: Fix a typo about a comma. (GH-10306) (cherry picked from commit fe62d877e300e1ee4145fff8f2bdba498b685f91) Co-authored-by: ?smail Ar?l?k files: M Doc/tutorial/errors.rst diff --git a/Doc/tutorial/errors.rst b/Doc/tutorial/errors.rst index aba61da5f7c3..957cbf962b20 100644 --- a/Doc/tutorial/errors.rst +++ b/Doc/tutorial/errors.rst @@ -314,7 +314,7 @@ to create specific exception classes for different error conditions:: self.next = next self.message = message -Most exceptions are defined with names that end in "Error," similar to the +Most exceptions are defined with names that end in "Error", similar to the naming of the standard exceptions. Many standard modules define their own exceptions to report errors that may From webhook-mailer at python.org Sat Nov 3 13:41:48 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 03 Nov 2018 17:41:48 -0000 Subject: [Python-checkins] Fix a typo about a comma. (GH-10306) Message-ID: https://github.com/python/cpython/commit/4614b983b600425ed198d2d2407ca77316762531 commit: 4614b983b600425ed198d2d2407ca77316762531 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-03T10:41:45-07:00 summary: Fix a typo about a comma. (GH-10306) (cherry picked from commit fe62d877e300e1ee4145fff8f2bdba498b685f91) Co-authored-by: ?smail Ar?l?k files: M Doc/tutorial/errors.rst diff --git a/Doc/tutorial/errors.rst b/Doc/tutorial/errors.rst index aba61da5f7c3..957cbf962b20 100644 --- a/Doc/tutorial/errors.rst +++ b/Doc/tutorial/errors.rst @@ -314,7 +314,7 @@ to create specific exception classes for different error conditions:: self.next = next self.message = message -Most exceptions are defined with names that end in "Error," similar to the +Most exceptions are defined with names that end in "Error", similar to the naming of the standard exceptions. Many standard modules define their own exceptions to report errors that may From webhook-mailer at python.org Sat Nov 3 13:41:59 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 03 Nov 2018 17:41:59 -0000 Subject: [Python-checkins] Fix a typo about a comma. (GH-10306) Message-ID: https://github.com/python/cpython/commit/421b41b096fa953819e223dc3e0bcce5d57231ea commit: 421b41b096fa953819e223dc3e0bcce5d57231ea branch: 2.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-03T10:41:56-07:00 summary: Fix a typo about a comma. (GH-10306) (cherry picked from commit fe62d877e300e1ee4145fff8f2bdba498b685f91) Co-authored-by: ?smail Ar?l?k files: M Doc/tutorial/errors.rst diff --git a/Doc/tutorial/errors.rst b/Doc/tutorial/errors.rst index 466009e51e7b..247dda761c00 100644 --- a/Doc/tutorial/errors.rst +++ b/Doc/tutorial/errors.rst @@ -315,7 +315,7 @@ to create specific exception classes for different error conditions:: self.next = next self.msg = msg -Most exceptions are defined with names that end in "Error," similar to the +Most exceptions are defined with names that end in "Error", similar to the naming of the standard exceptions. Many standard modules define their own exceptions to report errors that may From webhook-mailer at python.org Sat Nov 3 14:06:37 2018 From: webhook-mailer at python.org (Julien Palard) Date: Sat, 03 Nov 2018 18:06:37 -0000 Subject: [Python-checkins] Doc: -W flag for sphinx-build can be disabled (GH-10303) Message-ID: https://github.com/python/cpython/commit/f98c1623ec90508937afc1b58556e38214d70892 commit: f98c1623ec90508937afc1b58556e38214d70892 branch: master author: Julien Palard committer: GitHub date: 2018-11-03T19:06:33+01:00 summary: Doc: -W flag for sphinx-build can be disabled (GH-10303) files: M Doc/Makefile diff --git a/Doc/Makefile b/Doc/Makefile index 50beac58ec38..4b85e9eb6058 100644 --- a/Doc/Makefile +++ b/Doc/Makefile @@ -11,9 +11,10 @@ BLURB = PATH=$(VENVDIR)/bin:$$PATH blurb PAPER = SOURCES = DISTVERSION = $(shell $(PYTHON) tools/extensions/patchlevel.py) +SPHINXERRORHANDLING = -W -ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -W -D latex_elements.papersize=$(PAPER) \ - $(SPHINXOPTS) . build/$(BUILDER) $(SOURCES) +ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_elements.papersize=$(PAPER) \ + $(SPHINXOPTS) $(SPHINXERRORHANDLING) . build/$(BUILDER) $(SOURCES) .PHONY: help build html htmlhelp latex text changes linkcheck \ suspicious coverage doctest pydoc-topics htmlview clean dist check serve \ From solipsis at pitrou.net Sun Nov 4 04:08:40 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Sun, 04 Nov 2018 09:08:40 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=3 Message-ID: <20181104090840.1.65E1BD18079D5480@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_spawn leaked [0, 1, -2] memory blocks, sum=-1 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogGHvho7', '--timeout', '7200'] From webhook-mailer at python.org Sun Nov 4 09:50:59 2018 From: webhook-mailer at python.org (Julien Palard) Date: Sun, 04 Nov 2018 14:50:59 -0000 Subject: [Python-checkins] Explain that the orderness of the result of glob is system-dependant (GH-6587) Message-ID: https://github.com/python/cpython/commit/52465e1b8bb7af23d642dbb43c8173d079b7ec30 commit: 52465e1b8bb7af23d642dbb43c8173d079b7ec30 branch: master author: Elena Oat committer: Julien Palard date: 2018-11-04T15:50:55+01:00 summary: Explain that the orderness of the result of glob is system-dependant (GH-6587) Thanks! files: M Doc/library/glob.rst diff --git a/Doc/library/glob.rst b/Doc/library/glob.rst index 0db10b5efc10..2a5f0ddc4ef3 100644 --- a/Doc/library/glob.rst +++ b/Doc/library/glob.rst @@ -42,7 +42,8 @@ For example, ``'[?]'`` matches the character ``'?'``. a string containing a path specification. *pathname* can be either absolute (like :file:`/usr/src/Python-1.5/Makefile`) or relative (like :file:`../../Tools/\*/\*.gif`), and can contain shell-style wildcards. Broken - symlinks are included in the results (as in the shell). + symlinks are included in the results (as in the shell). Whether or not the + results are sorted depends on the file system. .. index:: single: **; in glob-style wildcards From webhook-mailer at python.org Sun Nov 4 10:44:25 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sun, 04 Nov 2018 15:44:25 -0000 Subject: [Python-checkins] bpo-35161: Fix stack-use-after-scope in grp.getgr{nam, gid} and pwd.getpw{nam, uid}. (GH-10319) Message-ID: https://github.com/python/cpython/commit/e359bc24b1f3a6ce311b9ef3043d1fdf5f1bf1cd commit: e359bc24b1f3a6ce311b9ef3043d1fdf5f1bf1cd branch: master author: Alexey Izbyshev committer: Serhiy Storchaka date: 2018-11-04T17:44:16+02:00 summary: bpo-35161: Fix stack-use-after-scope in grp.getgr{nam,gid} and pwd.getpw{nam,uid}. (GH-10319) Reported by ASAN. files: M Modules/grpmodule.c M Modules/pwdmodule.c diff --git a/Modules/grpmodule.c b/Modules/grpmodule.c index 74286ab3974d..d426f083111e 100644 --- a/Modules/grpmodule.c +++ b/Modules/grpmodule.c @@ -124,11 +124,12 @@ grp_getgrgid_impl(PyObject *module, PyObject *id) Py_DECREF(py_int_id); } #ifdef HAVE_GETGRGID_R - Py_BEGIN_ALLOW_THREADS int status; Py_ssize_t bufsize; + /* Note: 'grp' will be used via pointer 'p' on getgrgid_r success. */ struct group grp; + Py_BEGIN_ALLOW_THREADS bufsize = sysconf(_SC_GETGR_R_SIZE_MAX); if (bufsize == -1) { bufsize = DEFAULT_BUFFER_SIZE; @@ -204,11 +205,12 @@ grp_getgrnam_impl(PyObject *module, PyObject *name) if (PyBytes_AsStringAndSize(bytes, &name_chars, NULL) == -1) goto out; #ifdef HAVE_GETGRNAM_R - Py_BEGIN_ALLOW_THREADS int status; Py_ssize_t bufsize; + /* Note: 'grp' will be used via pointer 'p' on getgrnam_r success. */ struct group grp; + Py_BEGIN_ALLOW_THREADS bufsize = sysconf(_SC_GETGR_R_SIZE_MAX); if (bufsize == -1) { bufsize = DEFAULT_BUFFER_SIZE; diff --git a/Modules/pwdmodule.c b/Modules/pwdmodule.c index d15286dc10fc..1286e7d5ce59 100644 --- a/Modules/pwdmodule.c +++ b/Modules/pwdmodule.c @@ -131,11 +131,12 @@ pwd_getpwuid(PyObject *module, PyObject *uidobj) return NULL; } #ifdef HAVE_GETPWUID_R - Py_BEGIN_ALLOW_THREADS int status; Py_ssize_t bufsize; + /* Note: 'pwd' will be used via pointer 'p' on getpwuid_r success. */ struct passwd pwd; + Py_BEGIN_ALLOW_THREADS bufsize = sysconf(_SC_GETPW_R_SIZE_MAX); if (bufsize == -1) { bufsize = DEFAULT_BUFFER_SIZE; @@ -212,11 +213,12 @@ pwd_getpwnam_impl(PyObject *module, PyObject *name) if (PyBytes_AsStringAndSize(bytes, &name_chars, NULL) == -1) goto out; #ifdef HAVE_GETPWNAM_R - Py_BEGIN_ALLOW_THREADS int status; Py_ssize_t bufsize; + /* Note: 'pwd' will be used via pointer 'p' on getpwnam_r success. */ struct passwd pwd; + Py_BEGIN_ALLOW_THREADS bufsize = sysconf(_SC_GETPW_R_SIZE_MAX); if (bufsize == -1) { bufsize = DEFAULT_BUFFER_SIZE; From webhook-mailer at python.org Sun Nov 4 14:38:53 2018 From: webhook-mailer at python.org (Ned Deily) Date: Sun, 04 Nov 2018 19:38:53 -0000 Subject: [Python-checkins] [2.7] Docs: fix some wrong words (GH-6987) (GH-10315) Message-ID: https://github.com/python/cpython/commit/6bf85acf601fddc27ae2941af1f1fde7c5fccb89 commit: 6bf85acf601fddc27ae2941af1f1fde7c5fccb89 branch: 2.7 author: St?phane Wirtel committer: Ned Deily date: 2018-11-04T14:38:50-05:00 summary: [2.7] Docs: fix some wrong words (GH-6987) (GH-10315) files: M aclocal.m4 M configure M configure.ac diff --git a/aclocal.m4 b/aclocal.m4 index 5e29449ae2a1..df7895b88496 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -12,9 +12,9 @@ # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) -dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -dnl serial 11 (pkg-config-0.29.1) -dnl +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 11 (pkg-config-0.29.1) + dnl Copyright ? 2004 Scott James Remnant . dnl Copyright ? 2012-2015 Dan Nicholson dnl @@ -288,3 +288,71 @@ 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 + diff --git a/configure b/configure index ea8527fea18b..3d9a8392ff59 100755 --- a/configure +++ b/configure @@ -769,7 +769,6 @@ infodir docdir oldincludedir includedir -runstatedir localstatedir sharedstatedir sysconfdir @@ -881,7 +880,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}' @@ -1134,15 +1132,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=* \ @@ -1280,7 +1269,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. @@ -1433,7 +1422,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] @@ -3052,7 +3040,7 @@ if test "${enable_universalsdk+set}" = set; then : enableval=$enable_universalsdk; case $enableval in yes) - # Locate the best usable SDK, see Mac/README.txt for more + # Locate the best usable SDK, see Mac/README for more # information enableval="`/usr/bin/xcodebuild -version -sdk macosx Path 2>/dev/null`" if ! ( echo $enableval | grep -E '\.sdk' 1>/dev/null ) diff --git a/configure.ac b/configure.ac index 5dfb824b93f1..aecf6066e8ae 100644 --- a/configure.ac +++ b/configure.ac @@ -117,7 +117,7 @@ AC_ARG_ENABLE(universalsdk, [ case $enableval in yes) - # Locate the best usable SDK, see Mac/README.txt for more + # Locate the best usable SDK, see Mac/README for more # information enableval="`/usr/bin/xcodebuild -version -sdk macosx Path 2>/dev/null`" if ! ( echo $enableval | grep -E '\.sdk' 1>/dev/null ) From webhook-mailer at python.org Sun Nov 4 15:41:37 2018 From: webhook-mailer at python.org (Julien Palard) Date: Sun, 04 Nov 2018 20:41:37 -0000 Subject: [Python-checkins] bpo-35159: Add a link to the devguide in the sidebar of the index (Doc/) (GH-10316) Message-ID: https://github.com/python/cpython/commit/0edc7b1b1a2b22d4d200f80995454d01927bf93e commit: 0edc7b1b1a2b22d4d200f80995454d01927bf93e branch: master author: St?phane Wirtel committer: Julien Palard date: 2018-11-04T21:41:34+01:00 summary: bpo-35159: Add a link to the devguide in the sidebar of the index (Doc/) (GH-10316) files: M Doc/tools/templates/indexsidebar.html diff --git a/Doc/tools/templates/indexsidebar.html b/Doc/tools/templates/indexsidebar.html index 327452484cc8..8abce8ed6a87 100644 --- a/Doc/tools/templates/indexsidebar.html +++ b/Doc/tools/templates/indexsidebar.html @@ -16,4 +16,5 @@

{% trans %}Other resources{% endtrans %}

  • {% trans %}Beginner's Guide{% endtrans %}
  • {% trans %}Book List{% endtrans %}
  • {% trans %}Audio/Visual Talks{% endtrans %}
  • +
  • {% trans %}Python Developer?s Guide{% endtrans %}
  • From webhook-mailer at python.org Sun Nov 4 16:04:54 2018 From: webhook-mailer at python.org (Julien Palard) Date: Sun, 04 Nov 2018 21:04:54 -0000 Subject: [Python-checkins] Doc: Disable smartquotes for zh-tw, zh-cn, fr and ja translations (GH-9423) Message-ID: https://github.com/python/cpython/commit/c03bf0ae794c3bec9b56f38164535fd1f5bfc04a commit: c03bf0ae794c3bec9b56f38164535fd1f5bfc04a branch: master author: Adrian Liaw committer: Julien Palard date: 2018-11-04T22:04:51+01:00 summary: Doc: Disable smartquotes for zh-tw, zh-cn, fr and ja translations (GH-9423) files: D Doc/docutils.conf M Doc/conf.py diff --git a/Doc/conf.py b/Doc/conf.py index 6060ac176c95..eb57ee0c9339 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -41,13 +41,18 @@ # By default, highlight as Python 3. highlight_language = 'python3' -# Require Sphinx 1.2 for build. -needs_sphinx = '1.2' +# Require Sphinx 1.7 for build. +needs_sphinx = '1.7' # Ignore any .rst files in the venv/ directory. venvdir = os.getenv('VENVDIR', 'venv') exclude_patterns = [venvdir+'/*', 'README.rst'] +# Disable Docutils smartquotes for several translations +smartquotes_excludes = { + 'languages': ['ja', 'fr', 'zh_TW', 'zh_CN'], 'builders': ['man', 'text'], +} + # Options for HTML output # ----------------------- diff --git a/Doc/docutils.conf b/Doc/docutils.conf deleted file mode 100644 index bda4f5dc2351..000000000000 --- a/Doc/docutils.conf +++ /dev/null @@ -1,2 +0,0 @@ -[restructuredtext parser] -smartquotes-locales: ja: ""'' From webhook-mailer at python.org Sun Nov 4 16:21:31 2018 From: webhook-mailer at python.org (Ned Deily) Date: Sun, 04 Nov 2018 21:21:31 -0000 Subject: [Python-checkins] bpo-21263: Skip test_gdb when python has been compiled with LLVM clang (GH-10318) Message-ID: https://github.com/python/cpython/commit/59668aa8b7f174b59304eab833c1c1181886c3c6 commit: 59668aa8b7f174b59304eab833c1c1181886c3c6 branch: master author: Lysandros Nikolaou committer: Ned Deily date: 2018-11-04T16:21:28-05:00 summary: bpo-21263: Skip test_gdb when python has been compiled with LLVM clang (GH-10318) files: A Misc/NEWS.d/next/Tests/2018-11-04-20-17-09.bpo-21263.T3qo9r.rst M Lib/test/test_gdb.py M Misc/ACKS diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py index 0f950b232533..711fb69ebdff 100644 --- a/Lib/test/test_gdb.py +++ b/Lib/test/test_gdb.py @@ -5,6 +5,7 @@ import locale import os +import platform import re import subprocess import sys @@ -48,6 +49,10 @@ def get_gdb_version(): if not sysconfig.is_python_build(): raise unittest.SkipTest("test_gdb only works on source builds at the moment.") +if 'Clang' in platform.python_compiler() and sys.platform == 'darwin': + raise unittest.SkipTest("test_gdb doesn't work correctly when python is" + " built with LLVM clang") + # Location of custom hooks file in a repository checkout. checkout_hook_path = os.path.join(os.path.dirname(sys.executable), 'python-gdb.py') diff --git a/Misc/ACKS b/Misc/ACKS index 08ff6d11fdd0..89fb0c7000b4 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -1147,6 +1147,7 @@ Samuel Nicolary Jonathan Niehof Gustavo Niemeyer Oscar Nierstrasz +Lysandros Nikolaou Hrvoje Nik?i? Gregory Nofi Jesse Noller diff --git a/Misc/NEWS.d/next/Tests/2018-11-04-20-17-09.bpo-21263.T3qo9r.rst b/Misc/NEWS.d/next/Tests/2018-11-04-20-17-09.bpo-21263.T3qo9r.rst new file mode 100644 index 000000000000..9c6b4ef90706 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2018-11-04-20-17-09.bpo-21263.T3qo9r.rst @@ -0,0 +1,4 @@ +After several reports that test_gdb does not work properly on macOS and +since gdb is not shipped by default anymore, test_gdb is now skipped on +macOS when LLVM Clang has been used to compile Python. Patch by +Lysandros Nikolaou From webhook-mailer at python.org Sun Nov 4 16:40:06 2018 From: webhook-mailer at python.org (Ned Deily) Date: Sun, 04 Nov 2018 21:40:06 -0000 Subject: [Python-checkins] bpo-21263: Skip test_gdb when python has been compiled with LLVM clang (GH-10318) (GH-10325) Message-ID: https://github.com/python/cpython/commit/96fb350bfd2c9b66d7804ae27ea8c4adbfabad5b commit: 96fb350bfd2c9b66d7804ae27ea8c4adbfabad5b branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Ned Deily date: 2018-11-04T16:40:02-05:00 summary: bpo-21263: Skip test_gdb when python has been compiled with LLVM clang (GH-10318) (GH-10325) (cherry picked from commit 59668aa8b7f174b59304eab833c1c1181886c3c6) Co-authored-by: Lysandros Nikolaou files: A Misc/NEWS.d/next/Tests/2018-11-04-20-17-09.bpo-21263.T3qo9r.rst M Lib/test/test_gdb.py M Misc/ACKS diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py index 0f950b232533..711fb69ebdff 100644 --- a/Lib/test/test_gdb.py +++ b/Lib/test/test_gdb.py @@ -5,6 +5,7 @@ import locale import os +import platform import re import subprocess import sys @@ -48,6 +49,10 @@ def get_gdb_version(): if not sysconfig.is_python_build(): raise unittest.SkipTest("test_gdb only works on source builds at the moment.") +if 'Clang' in platform.python_compiler() and sys.platform == 'darwin': + raise unittest.SkipTest("test_gdb doesn't work correctly when python is" + " built with LLVM clang") + # Location of custom hooks file in a repository checkout. checkout_hook_path = os.path.join(os.path.dirname(sys.executable), 'python-gdb.py') diff --git a/Misc/ACKS b/Misc/ACKS index 7cd8ebf26fbf..c35ef1c0fa35 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -1136,6 +1136,7 @@ Samuel Nicolary Jonathan Niehof Gustavo Niemeyer Oscar Nierstrasz +Lysandros Nikolaou Hrvoje Nik?i? Gregory Nofi Jesse Noller diff --git a/Misc/NEWS.d/next/Tests/2018-11-04-20-17-09.bpo-21263.T3qo9r.rst b/Misc/NEWS.d/next/Tests/2018-11-04-20-17-09.bpo-21263.T3qo9r.rst new file mode 100644 index 000000000000..9c6b4ef90706 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2018-11-04-20-17-09.bpo-21263.T3qo9r.rst @@ -0,0 +1,4 @@ +After several reports that test_gdb does not work properly on macOS and +since gdb is not shipped by default anymore, test_gdb is now skipped on +macOS when LLVM Clang has been used to compile Python. Patch by +Lysandros Nikolaou From webhook-mailer at python.org Sun Nov 4 16:40:28 2018 From: webhook-mailer at python.org (Ned Deily) Date: Sun, 04 Nov 2018 21:40:28 -0000 Subject: [Python-checkins] bpo-21263: Skip test_gdb when python has been compiled with LLVM clang (GH-10318) (GH-10326) Message-ID: https://github.com/python/cpython/commit/f574ce79729ecb01f1f5b3e1a34c8aa7480b79e8 commit: f574ce79729ecb01f1f5b3e1a34c8aa7480b79e8 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Ned Deily date: 2018-11-04T16:40:25-05:00 summary: bpo-21263: Skip test_gdb when python has been compiled with LLVM clang (GH-10318) (GH-10326) (cherry picked from commit 59668aa8b7f174b59304eab833c1c1181886c3c6) Co-authored-by: Lysandros Nikolaou files: A Misc/NEWS.d/next/Tests/2018-11-04-20-17-09.bpo-21263.T3qo9r.rst M Lib/test/test_gdb.py M Misc/ACKS diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py index b33d007acbdf..9c15fca43293 100644 --- a/Lib/test/test_gdb.py +++ b/Lib/test/test_gdb.py @@ -5,6 +5,7 @@ import locale import os +import platform import re import subprocess import sys @@ -54,6 +55,10 @@ def get_gdb_version(): if not sysconfig.is_python_build(): raise unittest.SkipTest("test_gdb only works on source builds at the moment.") +if 'Clang' in platform.python_compiler() and sys.platform == 'darwin': + raise unittest.SkipTest("test_gdb doesn't work correctly when python is" + " built with LLVM clang") + # Location of custom hooks file in a repository checkout. checkout_hook_path = os.path.join(os.path.dirname(sys.executable), 'python-gdb.py') diff --git a/Misc/ACKS b/Misc/ACKS index 94731b493c51..c78df75f0dcb 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -1107,6 +1107,7 @@ Samuel Nicolary Jonathan Niehof Gustavo Niemeyer Oscar Nierstrasz +Lysandros Nikolaou Hrvoje Nik?i? Gregory Nofi Jesse Noller diff --git a/Misc/NEWS.d/next/Tests/2018-11-04-20-17-09.bpo-21263.T3qo9r.rst b/Misc/NEWS.d/next/Tests/2018-11-04-20-17-09.bpo-21263.T3qo9r.rst new file mode 100644 index 000000000000..9c6b4ef90706 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2018-11-04-20-17-09.bpo-21263.T3qo9r.rst @@ -0,0 +1,4 @@ +After several reports that test_gdb does not work properly on macOS and +since gdb is not shipped by default anymore, test_gdb is now skipped on +macOS when LLVM Clang has been used to compile Python. Patch by +Lysandros Nikolaou From webhook-mailer at python.org Sun Nov 4 17:12:37 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sun, 04 Nov 2018 22:12:37 -0000 Subject: [Python-checkins] bpo-31887: Adds documentations for special multipart/signed handling (GH-4268) Message-ID: https://github.com/python/cpython/commit/622935d9a69d12e125e470ce9a9ff3cad9e8e296 commit: 622935d9a69d12e125e470ce9a9ff3cad9e8e296 branch: master author: Saptak Sengupta committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-11-04T14:12:34-08:00 summary: bpo-31887: Adds documentations for special multipart/signed handling (GH-4268) This pull request adds some information about the special multipart/signed handling to clear about disabling header folding. https://bugs.python.org/issue31887 files: M Doc/library/email.generator.rst diff --git a/Doc/library/email.generator.rst b/Doc/library/email.generator.rst index 2575a5130070..fc535a3e4399 100644 --- a/Doc/library/email.generator.rst +++ b/Doc/library/email.generator.rst @@ -36,6 +36,10 @@ something that contains only ASCII characters, using the standard email RFC Content Transfer Encoding techniques for encoding email messages for transport over channels that are not "8 bit clean". +To accomodate reproducible processing of SMIME-signed messages +:class:`Generator` disables header folding for message parts of type +``multipart/signed`` and all subparts. + .. class:: BytesGenerator(outfp, mangle_from_=None, maxheaderlen=None, *, \ policy=None) From webhook-mailer at python.org Sun Nov 4 17:24:44 2018 From: webhook-mailer at python.org (Julien Palard) Date: Sun, 04 Nov 2018 22:24:44 -0000 Subject: [Python-checkins] bpo-10536: Enhancements to gettext docs (GH-10324) Message-ID: https://github.com/python/cpython/commit/55f3317e984cc35bd18ba0326ed98766a2750ffd commit: 55f3317e984cc35bd18ba0326ed98766a2750ffd branch: master author: St?phane Wirtel committer: Julien Palard date: 2018-11-04T23:24:41+01:00 summary: bpo-10536: Enhancements to gettext docs (GH-10324) files: A Misc/NEWS.d/next/Documentation/2018-11-04-22-03-56.bpo-10536.a0IsfE.rst M Doc/library/gettext.rst diff --git a/Doc/library/gettext.rst b/Doc/library/gettext.rst index ef315e041e13..38515ebdf591 100644 --- a/Doc/library/gettext.rst +++ b/Doc/library/gettext.rst @@ -13,7 +13,7 @@ The :mod:`gettext` module provides internationalization (I18N) and localization (L10N) services for your Python modules and applications. It supports both the -GNU ``gettext`` message catalog API and a higher level, class-based API that may +GNU :program:`gettext` message catalog API and a higher level, class-based API that may be more appropriate for Python files. The interface described below allows you to write your module and application messages in one natural language, and provide a catalog of translated messages for running under different natural @@ -38,7 +38,7 @@ class-based API instead. Bind the *domain* to the locale directory *localedir*. More concretely, :mod:`gettext` will look for binary :file:`.mo` files for the given domain using - the path (on Unix): :file:`localedir/language/LC_MESSAGES/domain.mo`, where + the path (on Unix): :file:`{localedir}/{language}/LC_MESSAGES/{domain}.mo`, where *languages* is searched for in the environment variables :envvar:`LANGUAGE`, :envvar:`LC_ALL`, :envvar:`LC_MESSAGES`, and :envvar:`LANG` respectively. @@ -138,17 +138,16 @@ Class-based API The class-based API of the :mod:`gettext` module gives you more flexibility and greater convenience than the GNU :program:`gettext` API. It is the recommended way of localizing your Python applications and modules. :mod:`!gettext` defines -a "translations" class which implements the parsing of GNU :file:`.mo` format -files, and has methods for returning strings. Instances of this "translations" -class can also install themselves in the built-in namespace as the function -:func:`_`. +a :class:`GNUTranslations` class which implements the parsing of GNU :file:`.mo` format +files, and has methods for returning strings. Instances of this class can also +install themselves in the built-in namespace as the function :func:`_`. .. function:: find(domain, localedir=None, languages=None, all=False) This function implements the standard :file:`.mo` file search algorithm. It takes a *domain*, identical to what :func:`textdomain` takes. Optional - *localedir* is as in :func:`bindtextdomain` Optional *languages* is a list of + *localedir* is as in :func:`bindtextdomain`. Optional *languages* is a list of strings, where each string is a language code. If *localedir* is not given, then the default system locale directory is used. @@ -172,10 +171,10 @@ class can also install themselves in the built-in namespace as the function .. function:: translation(domain, localedir=None, languages=None, class_=None, fallback=False, codeset=None) - Return a :class:`Translations` instance based on the *domain*, *localedir*, + Return a :class:`*Translations` instance based on the *domain*, *localedir*, and *languages*, which are first passed to :func:`find` to get a list of the associated :file:`.mo` file paths. Instances with identical :file:`.mo` file - names are cached. The actual class instantiated is either *class_* if + names are cached. The actual class instantiated is *class_* if provided, otherwise :class:`GNUTranslations`. The class's constructor must take a single :term:`file object` argument. If provided, *codeset* will change the charset used to encode translated strings in the @@ -241,7 +240,7 @@ are the methods of :class:`!NullTranslations`: .. method:: _parse(fp) - No-op'd in the base class, this method takes file object *fp*, and reads + No-op in the base class, this method takes file object *fp*, and reads the data from the file, initializing its message catalog. If you have an unsupported message catalog file format, you should override this method to parse your format. @@ -285,7 +284,8 @@ are the methods of :class:`!NullTranslations`: .. method:: info() - Return the "protected" :attr:`_info` variable. + Return the "protected" :attr:`_info` variable, a dictionary containing + the metadata found in the message catalog file. .. method:: charset() @@ -340,15 +340,15 @@ The :mod:`gettext` module provides one additional class derived from :meth:`_parse` to enable reading GNU :program:`gettext` format :file:`.mo` files in both big-endian and little-endian format. -:class:`GNUTranslations` parses optional meta-data out of the translation -catalog. It is convention with GNU :program:`gettext` to include meta-data as -the translation for the empty string. This meta-data is in :rfc:`822`\ -style +:class:`GNUTranslations` parses optional metadata out of the translation +catalog. It is convention with GNU :program:`gettext` to include metadata as +the translation for the empty string. This metadata is in :rfc:`822`\ -style ``key: value`` pairs, and should contain the ``Project-Id-Version`` key. If the key ``Content-Type`` is found, then the ``charset`` property is used to initialize the "protected" :attr:`_charset` instance variable, defaulting to ``None`` if not found. If the charset encoding is specified, then all message ids and message strings read from the catalog are converted to Unicode using -this encoding, else ASCII encoding is assumed. +this encoding, else ASCII is assumed. Since message ids are read as Unicode strings too, all :meth:`*gettext` methods will assume message ids as Unicode strings, not byte strings. @@ -452,7 +452,7 @@ take the following steps: #. run a suite of tools over your marked files to generate raw messages catalogs -#. create language specific translations of the message catalogs +#. create language-specific translations of the message catalogs #. use the :mod:`gettext` module so that message strings are properly translated @@ -462,9 +462,8 @@ it in ``_('...')`` --- that is, a call to the function :func:`_`. For example:: filename = 'mylog.txt' message = _('writing a log message') - fp = open(filename, 'w') - fp.write(message) - fp.close() + with open(filename, 'w') as fp: + fp.write(message) In this example, the string ``'writing a log message'`` is marked as a candidate for translation, while the strings ``'mylog.txt'`` and ``'w'`` are not. @@ -515,7 +514,7 @@ Localizing your module ^^^^^^^^^^^^^^^^^^^^^^ If you are localizing your module, you must take care not to make global -changes, e.g. to the built-in namespace. You should not use the GNU ``gettext`` +changes, e.g. to the built-in namespace. You should not use the GNU :program:`gettext` API but instead the class-based API. Let's say your module is called "spam" and the module's various natural language @@ -669,8 +668,9 @@ implementations, and valuable experience to the creation of this module: .. [#] The default locale directory is system dependent; for example, on RedHat Linux it is :file:`/usr/share/locale`, but on Solaris it is :file:`/usr/lib/locale`. The :mod:`gettext` module does not try to support these system dependent - defaults; instead its default is :file:`sys.prefix/share/locale`. For this - reason, it is always best to call :func:`bindtextdomain` with an explicit - absolute path at the start of your application. + defaults; instead its default is :file:`{sys.prefix}/share/locale` (see + :data:`sys.prefix`). For this reason, it is always best to call + :func:`bindtextdomain` with an explicit absolute path at the start of your + application. .. [#] See the footnote for :func:`bindtextdomain` above. diff --git a/Misc/NEWS.d/next/Documentation/2018-11-04-22-03-56.bpo-10536.a0IsfE.rst b/Misc/NEWS.d/next/Documentation/2018-11-04-22-03-56.bpo-10536.a0IsfE.rst new file mode 100644 index 000000000000..b5036481fb65 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2018-11-04-22-03-56.bpo-10536.a0IsfE.rst @@ -0,0 +1 @@ +Enhance the gettext docs. Patch by ?ric Araujo From webhook-mailer at python.org Sun Nov 4 17:34:25 2018 From: webhook-mailer at python.org (Raymond Hettinger) Date: Sun, 04 Nov 2018 22:34:25 -0000 Subject: [Python-checkins] bpo-35118: Improve docs regarding indexing (GH-10265) Message-ID: https://github.com/python/cpython/commit/98b85354153883b0a080f678f213729cd0764fee commit: 98b85354153883b0a080f678f213729cd0764fee branch: master author: Windson yang committer: Raymond Hettinger date: 2018-11-04T14:34:22-08:00 summary: bpo-35118: Improve docs regarding indexing (GH-10265) files: M Doc/library/collections.rst M Doc/library/queue.rst diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index 495cfc2c234f..6b9d85abaae7 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -531,9 +531,9 @@ or subtracting from an empty counter. In addition to the above, deques support iteration, pickling, ``len(d)``, ``reversed(d)``, ``copy.copy(d)``, ``copy.deepcopy(d)``, membership testing with -the :keyword:`in` operator, and subscript references such as ``d[-1]``. Indexed -access is O(1) at both ends but slows to O(n) in the middle. For fast random -access, use lists instead. +the :keyword:`in` operator, and subscript references such as ``d[0]`` to access +the first element. Indexed access is O(1) at both ends but slows to O(n) in +the middle. For fast random access, use lists instead. Starting in version 3.5, deques support ``__add__()``, ``__mul__()``, and ``__imul__()``. diff --git a/Doc/library/queue.rst b/Doc/library/queue.rst index 1fea86bfc5cd..f99f6ffb05f6 100644 --- a/Doc/library/queue.rst +++ b/Doc/library/queue.rst @@ -275,4 +275,5 @@ SimpleQueue Objects :class:`collections.deque` is an alternative implementation of unbounded queues with fast atomic :meth:`~collections.deque.append` and - :meth:`~collections.deque.popleft` operations that do not require locking. + :meth:`~collections.deque.popleft` operations that do not require locking + and also support indexing. From webhook-mailer at python.org Sun Nov 4 17:36:28 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sun, 04 Nov 2018 22:36:28 -0000 Subject: [Python-checkins] bpo-9842: Add cross-reference to the ellipsis object (GH-4063) Message-ID: https://github.com/python/cpython/commit/b4db249c9544fc4425c32feb86d610f3224ca3d8 commit: b4db249c9544fc4425c32feb86d610f3224ca3d8 branch: master author: Pablo Galindo committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-11-04T14:36:25-08:00 summary: bpo-9842: Add cross-reference to the ellipsis object (GH-4063) This PR adds a cross-reference to the ellipsis object and the representation of recursive item in containers as indicated in [issue 9842](https://bugs.python.org/issue9842) by @bitdancer. https://bugs.python.org/issue9842 files: M Doc/glossary.rst diff --git a/Doc/glossary.rst b/Doc/glossary.rst index b8e773741ce7..02adc0c56ece 100644 --- a/Doc/glossary.rst +++ b/Doc/glossary.rst @@ -13,10 +13,14 @@ Glossary examples which can be executed interactively in the interpreter. ``...`` - The default Python prompt of the interactive shell when entering code for - an indented code block, when within a pair of matching left and right - delimiters (parentheses, square brackets, curly braces or triple quotes), - or after specifying a decorator. + Can refer to: + + * The default Python prompt of the interactive shell when entering code for + an indented code block, when within a pair of matching left and right + delimiters (parentheses, square brackets, curly braces or triple quotes), + or after specifying a decorator. + + * The :const:`Ellipsis` built-in constant. 2to3 A tool that tries to convert Python 2.x code to Python 3.x code by From webhook-mailer at python.org Sun Nov 4 17:40:35 2018 From: webhook-mailer at python.org (Julien Palard) Date: Sun, 04 Nov 2018 22:40:35 -0000 Subject: [Python-checkins] bpo-19675: Terminate processes if construction of a pool is failing. (GH-5614) Message-ID: https://github.com/python/cpython/commit/5d236cafd7126e640fb25541fcc7e0a494450143 commit: 5d236cafd7126e640fb25541fcc7e0a494450143 branch: master author: Julien Palard committer: GitHub date: 2018-11-04T23:40:32+01:00 summary: bpo-19675: Terminate processes if construction of a pool is failing. (GH-5614) files: A Misc/NEWS.d/next/Library/2018-02-10-23-41-05.bpo-19675.-dj35-.rst M Lib/multiprocessing/pool.py M Lib/test/_test_multiprocessing.py diff --git a/Lib/multiprocessing/pool.py b/Lib/multiprocessing/pool.py index 574b5db5afb6..7a6d01490146 100644 --- a/Lib/multiprocessing/pool.py +++ b/Lib/multiprocessing/pool.py @@ -174,7 +174,15 @@ def __init__(self, processes=None, initializer=None, initargs=(), self._processes = processes self._pool = [] - self._repopulate_pool() + try: + self._repopulate_pool() + except Exception: + for p in self._pool: + if p.exitcode is None: + p.terminate() + for p in self._pool: + p.join() + raise self._worker_handler = threading.Thread( target=Pool._handle_workers, @@ -251,10 +259,10 @@ def _repopulate_pool_static(ctx, Process, processes, pool, inqueue, initargs, maxtasksperchild, wrap_exception) ) - pool.append(w) w.name = w.name.replace('Process', 'PoolWorker') w.daemon = True w.start() + pool.append(w) util.debug('added worker') @staticmethod diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index dc59e9fd740a..7993fcb08e46 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -3,6 +3,7 @@ # import unittest +import unittest.mock import queue as pyqueue import contextlib import time @@ -4635,6 +4636,48 @@ def test_empty(self): proc.join() +class TestPoolNotLeakOnFailure(unittest.TestCase): + + def test_release_unused_processes(self): + # Issue #19675: During pool creation, if we can't create a process, + # don't leak already created ones. + will_fail_in = 3 + forked_processes = [] + + class FailingForkProcess: + def __init__(self, **kwargs): + self.name = 'Fake Process' + self.exitcode = None + self.state = None + forked_processes.append(self) + + def start(self): + nonlocal will_fail_in + if will_fail_in <= 0: + raise OSError("Manually induced OSError") + will_fail_in -= 1 + self.state = 'started' + + def terminate(self): + self.state = 'stopping' + + def join(self): + if self.state == 'stopping': + self.state = 'stopped' + + def is_alive(self): + return self.state == 'started' or self.state == 'stopping' + + with self.assertRaisesRegex(OSError, 'Manually induced OSError'): + p = multiprocessing.pool.Pool(5, context=unittest.mock.MagicMock( + Process=FailingForkProcess)) + p.close() + p.join() + self.assertFalse( + any(process.is_alive() for process in forked_processes)) + + + class MiscTestCase(unittest.TestCase): def test__all__(self): # Just make sure names in blacklist are excluded diff --git a/Misc/NEWS.d/next/Library/2018-02-10-23-41-05.bpo-19675.-dj35-.rst b/Misc/NEWS.d/next/Library/2018-02-10-23-41-05.bpo-19675.-dj35-.rst new file mode 100644 index 000000000000..958550d3e8d7 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-02-10-23-41-05.bpo-19675.-dj35-.rst @@ -0,0 +1 @@ +``multiprocessing.Pool`` no longer leaks processes if its initialization fails. From webhook-mailer at python.org Sun Nov 4 18:58:28 2018 From: webhook-mailer at python.org (Benjamin Peterson) Date: Sun, 04 Nov 2018 23:58:28 -0000 Subject: [Python-checkins] closes bpo-32285: Add unicodedata.is_normalized. (GH-4806) Message-ID: https://github.com/python/cpython/commit/2810dd7be9876236f74ac80716d113572c9098dd commit: 2810dd7be9876236f74ac80716d113572c9098dd branch: master author: Max B?langer committer: Benjamin Peterson date: 2018-11-04T15:58:24-08:00 summary: closes bpo-32285: Add unicodedata.is_normalized. (GH-4806) files: A Misc/NEWS.d/next/Core and Builtins/2017-12-12-13-43-13.bpo-32285.LzKSwz.rst M Doc/library/unicodedata.rst M Doc/whatsnew/3.8.rst M Lib/test/test_normalization.py M Modules/clinic/unicodedata.c.h M Modules/unicodedata.c diff --git a/Doc/library/unicodedata.rst b/Doc/library/unicodedata.rst index 59548f3e8b4a..17e848bf552b 100644 --- a/Doc/library/unicodedata.rst +++ b/Doc/library/unicodedata.rst @@ -133,6 +133,13 @@ following functions: a human reader, if one has combining characters and the other doesn't, they may not compare equal. +.. function:: is_normalized(form, unistr) + + Return whether the Unicode string *unistr* is in the normal form *form*. Valid + values for *form* are 'NFC', 'NFKC', 'NFD', and 'NFKD'. + + .. versionadded:: 3.8 + In addition, the module exposes the following constant: diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index 5397206030fe..566c369c85bd 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -204,6 +204,13 @@ Added method :meth:`~tkinter.Canvas.moveto` in the :class:`tkinter.Canvas` class. (Contributed by Juliette Monsel in :issue:`23831`.) +unicodedata +----------- + +* New function :func:`~unicodedata.is_normalized` can be used to verify a string + is in a specific normal form. (Contributed by Max Belanger and David Euresti in + :issue:`32285`). + venv ---- diff --git a/Lib/test/test_normalization.py b/Lib/test/test_normalization.py index 304245644502..ba877e73f7d9 100644 --- a/Lib/test/test_normalization.py +++ b/Lib/test/test_normalization.py @@ -3,7 +3,7 @@ from http.client import HTTPException import sys -from unicodedata import normalize, unidata_version +from unicodedata import normalize, is_normalized, unidata_version TESTDATAFILE = "NormalizationTest.txt" TESTDATAURL = "http://www.pythontest.net/unicode/" + unidata_version + "/" + TESTDATAFILE @@ -88,6 +88,15 @@ def run_normalization_tests(self, testdata): NFKD(c3) == NFKD(c4) == NFKD(c5), line) + self.assertTrue(is_normalized("NFC", c2)) + self.assertTrue(is_normalized("NFC", c4)) + + self.assertTrue(is_normalized("NFD", c3)) + self.assertTrue(is_normalized("NFD", c5)) + + self.assertTrue(is_normalized("NFKC", c4)) + self.assertTrue(is_normalized("NFKD", c5)) + # Record part 1 data if part == "@Part1": part1_data[c1] = 1 diff --git a/Misc/NEWS.d/next/Core and Builtins/2017-12-12-13-43-13.bpo-32285.LzKSwz.rst b/Misc/NEWS.d/next/Core and Builtins/2017-12-12-13-43-13.bpo-32285.LzKSwz.rst new file mode 100644 index 000000000000..87f84b02eb84 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2017-12-12-13-43-13.bpo-32285.LzKSwz.rst @@ -0,0 +1,2 @@ +New function unicodedata.is_normalized, which can check whether a string is +in a specific normal form. diff --git a/Modules/clinic/unicodedata.c.h b/Modules/clinic/unicodedata.c.h index 72e3f6545778..54021fedba41 100644 --- a/Modules/clinic/unicodedata.c.h +++ b/Modules/clinic/unicodedata.c.h @@ -284,6 +284,38 @@ unicodedata_UCD_decomposition(PyObject *self, PyObject *arg) return return_value; } +PyDoc_STRVAR(unicodedata_UCD_is_normalized__doc__, +"is_normalized($self, form, unistr, /)\n" +"--\n" +"\n" +"Return whether the Unicode string unistr is in the normal form \'form\'.\n" +"\n" +"Valid values for form are \'NFC\', \'NFKC\', \'NFD\', and \'NFKD\'."); + +#define UNICODEDATA_UCD_IS_NORMALIZED_METHODDEF \ + {"is_normalized", (PyCFunction)unicodedata_UCD_is_normalized, METH_FASTCALL, unicodedata_UCD_is_normalized__doc__}, + +static PyObject * +unicodedata_UCD_is_normalized_impl(PyObject *self, PyObject *form, + PyObject *input); + +static PyObject * +unicodedata_UCD_is_normalized(PyObject *self, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *form; + PyObject *input; + + if (!_PyArg_ParseStack(args, nargs, "UU:is_normalized", + &form, &input)) { + goto exit; + } + return_value = unicodedata_UCD_is_normalized_impl(self, form, input); + +exit: + return return_value; +} + PyDoc_STRVAR(unicodedata_UCD_normalize__doc__, "normalize($self, form, unistr, /)\n" "--\n" @@ -296,17 +328,17 @@ PyDoc_STRVAR(unicodedata_UCD_normalize__doc__, {"normalize", (PyCFunction)unicodedata_UCD_normalize, METH_FASTCALL, unicodedata_UCD_normalize__doc__}, static PyObject * -unicodedata_UCD_normalize_impl(PyObject *self, const char *form, +unicodedata_UCD_normalize_impl(PyObject *self, PyObject *form, PyObject *input); static PyObject * unicodedata_UCD_normalize(PyObject *self, PyObject *const *args, Py_ssize_t nargs) { PyObject *return_value = NULL; - const char *form; + PyObject *form; PyObject *input; - if (!_PyArg_ParseStack(args, nargs, "sU:normalize", + if (!_PyArg_ParseStack(args, nargs, "UU:normalize", &form, &input)) { goto exit; } @@ -379,4 +411,4 @@ unicodedata_UCD_lookup(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=dc899bff0ecd14c1 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=2c5fbf597c18f6b8 input=a9049054013a1b77]*/ diff --git a/Modules/unicodedata.c b/Modules/unicodedata.c index e8788f5036dd..9ceab1b3db4f 100644 --- a/Modules/unicodedata.c +++ b/Modules/unicodedata.c @@ -19,6 +19,11 @@ #include "ucnhash.h" #include "structmember.h" +_Py_IDENTIFIER(NFC); +_Py_IDENTIFIER(NFD); +_Py_IDENTIFIER(NFKC); +_Py_IDENTIFIER(NFKD); + /*[clinic input] module unicodedata class unicodedata.UCD 'PreviousDBVersion *' '&UCD_Type' @@ -770,8 +775,10 @@ nfc_nfkc(PyObject *self, PyObject *input, int k) return result; } -/* Return 1 if the input is certainly normalized, 0 if it might not be. */ -static int +typedef enum {YES, NO, MAYBE} NormalMode; + +/* Return YES if the input is certainly normalized, NO or MAYBE if it might not be. */ +static NormalMode is_normalized(PyObject *self, PyObject *input, int nfc, int k) { Py_ssize_t i, len; @@ -782,7 +789,7 @@ is_normalized(PyObject *self, PyObject *input, int nfc, int k) /* An older version of the database is requested, quickchecks must be disabled. */ if (self && UCD_Check(self)) - return 0; + return NO; /* The two quickcheck bits at this shift mean 0=Yes, 1=Maybe, 2=No, as described in http://unicode.org/reports/tr15/#Annex8. */ @@ -799,19 +806,92 @@ is_normalized(PyObject *self, PyObject *input, int nfc, int k) unsigned char quickcheck = record->normalization_quick_check; if (quickcheck & quickcheck_mask) - return 0; /* this string might need normalization */ + return MAYBE; /* this string might need normalization */ if (combining && prev_combining > combining) - return 0; /* non-canonical sort order, not normalized */ + return NO; /* non-canonical sort order, not normalized */ prev_combining = combining; } - return 1; /* certainly normalized */ + return YES; /* certainly normalized */ +} + +/*[clinic input] +unicodedata.UCD.is_normalized + + self: self + form: unicode + unistr as input: unicode + / + +Return whether the Unicode string unistr is in the normal form 'form'. + +Valid values for form are 'NFC', 'NFKC', 'NFD', and 'NFKD'. +[clinic start generated code]*/ + +static PyObject * +unicodedata_UCD_is_normalized_impl(PyObject *self, PyObject *form, + PyObject *input) +/*[clinic end generated code: output=11e5a3694e723ca5 input=a544f14cea79e508]*/ +{ + if (PyUnicode_READY(input) == -1) { + return NULL; + } + + if (PyUnicode_GET_LENGTH(input) == 0) { + /* special case empty input strings. */ + Py_RETURN_TRUE; + } + + PyObject *result; + int nfc = 0; + int k = 0; + NormalMode m; + + PyObject *cmp; + int match = 0; + + if (_PyUnicode_EqualToASCIIId(form, &PyId_NFC)) { + nfc = 1; + } + else if (_PyUnicode_EqualToASCIIId(form, &PyId_NFKC)) { + nfc = 1; + k = 1; + } + else if (_PyUnicode_EqualToASCIIId(form, &PyId_NFD)) { + /* matches default values for `nfc` and `k` */ + } + else if (_PyUnicode_EqualToASCIIId(form, &PyId_NFKD)) { + k = 1; + } + else { + PyErr_SetString(PyExc_ValueError, "invalid normalization form"); + return NULL; + } + + m = is_normalized(self, input, nfc, k); + + if (m == MAYBE) { + cmp = (nfc ? nfc_nfkc : nfd_nfkd)(self, input, k); + if (cmp == NULL) { + return NULL; + } + match = PyUnicode_Compare(input, cmp); + Py_DECREF(cmp); + result = (match == 0) ? Py_True : Py_False; + } + else { + result = (m == YES) ? Py_True : Py_False; + } + + Py_INCREF(result); + return result; } + /*[clinic input] unicodedata.UCD.normalize self: self - form: str + form: unicode unistr as input: unicode / @@ -821,9 +901,9 @@ Valid values for form are 'NFC', 'NFKC', 'NFD', and 'NFKD'. [clinic start generated code]*/ static PyObject * -unicodedata_UCD_normalize_impl(PyObject *self, const char *form, +unicodedata_UCD_normalize_impl(PyObject *self, PyObject *form, PyObject *input) -/*[clinic end generated code: output=62d1f8870027efdc input=1744c55f4ab79bf0]*/ +/*[clinic end generated code: output=05ca4385a2ad6983 input=3a5206c0ad2833fb]*/ { if (PyUnicode_GET_LENGTH(input) == 0) { /* Special case empty input strings, since resizing @@ -832,29 +912,29 @@ unicodedata_UCD_normalize_impl(PyObject *self, const char *form, return input; } - if (strcmp(form, "NFC") == 0) { - if (is_normalized(self, input, 1, 0)) { + if (_PyUnicode_EqualToASCIIId(form, &PyId_NFC)) { + if (is_normalized(self, input, 1, 0) == YES) { Py_INCREF(input); return input; } return nfc_nfkc(self, input, 0); } - if (strcmp(form, "NFKC") == 0) { - if (is_normalized(self, input, 1, 1)) { + if (_PyUnicode_EqualToASCIIId(form, &PyId_NFKC)) { + if (is_normalized(self, input, 1, 1) == YES) { Py_INCREF(input); return input; } return nfc_nfkc(self, input, 1); } - if (strcmp(form, "NFD") == 0) { - if (is_normalized(self, input, 0, 0)) { + if (_PyUnicode_EqualToASCIIId(form, &PyId_NFD)) { + if (is_normalized(self, input, 0, 0) == YES) { Py_INCREF(input); return input; } return nfd_nfkd(self, input, 0); } - if (strcmp(form, "NFKD") == 0) { - if (is_normalized(self, input, 0, 1)) { + if (_PyUnicode_EqualToASCIIId(form, &PyId_NFKD)) { + if (is_normalized(self, input, 0, 1) == YES) { Py_INCREF(input); return input; } @@ -1271,6 +1351,7 @@ static PyMethodDef unicodedata_functions[] = { UNICODEDATA_UCD_DECOMPOSITION_METHODDEF UNICODEDATA_UCD_NAME_METHODDEF UNICODEDATA_UCD_LOOKUP_METHODDEF + UNICODEDATA_UCD_IS_NORMALIZED_METHODDEF UNICODEDATA_UCD_NORMALIZE_METHODDEF {NULL, NULL} /* sentinel */ }; From solipsis at pitrou.net Mon Nov 5 04:08:22 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Mon, 05 Nov 2018 09:08:22 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=5 Message-ID: <20181105090822.1.C4799BC288E7A51B@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [7, -7, 1] memory blocks, sum=1 test_functools leaked [0, 3, 1] memory blocks, sum=4 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogFILtoQ', '--timeout', '7200'] From webhook-mailer at python.org Mon Nov 5 07:03:51 2018 From: webhook-mailer at python.org (Nick Coghlan) Date: Mon, 05 Nov 2018 12:03:51 -0000 Subject: [Python-checkins] bpo-32512: Add -m option to profile for profiling modules (#5132) Message-ID: https://github.com/python/cpython/commit/ad1a25f499362eaf9cbfcafa0b8e2454eb43dcf1 commit: ad1a25f499362eaf9cbfcafa0b8e2454eb43dcf1 branch: master author: Mario Corchero committer: Nick Coghlan date: 2018-11-05T22:03:46+10:00 summary: bpo-32512: Add -m option to profile for profiling modules (#5132) The new option in the CLI of the profile module allow to profile executable modules. This change follows the same implementation as the one already present in `cProfile`. As the argument is now present on both modules, move the tests to the common test case to be run with profile as well. files: A Misc/NEWS.d/next/Library/2018-01-07-17-43-10.bpo-32512.flC-dE.rst M Doc/library/profile.rst M Lib/profile.py M Lib/test/test_cprofile.py M Lib/test/test_profile.py diff --git a/Doc/library/profile.rst b/Doc/library/profile.rst index 1a772fb7f941..9ceb81603c95 100644 --- a/Doc/library/profile.rst +++ b/Doc/library/profile.rst @@ -120,8 +120,8 @@ results to a file by specifying a filename to the :func:`run` function:: The :class:`pstats.Stats` class reads profile results from a file and formats them in various ways. -The file :mod:`cProfile` can also be invoked as a script to profile another -script. For example:: +The files :mod:`cProfile` and :mod:`profile` can also be invoked as a script to +profile another script. For example:: python -m cProfile [-o output_file] [-s sort_order] (-m module | myscript.py) @@ -133,7 +133,10 @@ the output by. This only applies when ``-o`` is not supplied. ``-m`` specifies that a module is being profiled instead of a script. .. versionadded:: 3.7 - Added the ``-m`` option. + Added the ``-m`` option to :mod:`cProfile`. + + .. versionadded:: 3.8 + Added the ``-m`` option to :mod:`profile`. The :mod:`pstats` module's :class:`~pstats.Stats` class has a variety of methods for manipulating and printing the data saved into a profile results file:: diff --git a/Lib/profile.py b/Lib/profile.py index 0340a7907bfd..5df43604acdd 100755 --- a/Lib/profile.py +++ b/Lib/profile.py @@ -553,11 +553,13 @@ def main(): import os from optparse import OptionParser - usage = "profile.py [-o output_file_path] [-s sort] scriptfile [arg] ..." + usage = "profile.py [-o output_file_path] [-s sort] [-m module | scriptfile] [arg] ..." parser = OptionParser(usage=usage) parser.allow_interspersed_args = False parser.add_option('-o', '--outfile', dest="outfile", help="Save stats to ", default=None) + parser.add_option('-m', dest="module", action="store_true", + help="Profile a library module.", default=False) parser.add_option('-s', '--sort', dest="sort", help="Sort order when printing to stdout, based on pstats.Stats class", default=-1) @@ -570,16 +572,24 @@ def main(): sys.argv[:] = args if len(args) > 0: - progname = args[0] - sys.path.insert(0, os.path.dirname(progname)) - with open(progname, 'rb') as fp: - code = compile(fp.read(), progname, 'exec') - globs = { - '__file__': progname, - '__name__': '__main__', - '__package__': None, - '__cached__': None, - } + if options.module: + import runpy + code = "run_module(modname, run_name='__main__')" + globs = { + 'run_module': runpy.run_module, + 'modname': args[0] + } + else: + progname = args[0] + sys.path.insert(0, os.path.dirname(progname)) + with open(progname, 'rb') as fp: + code = compile(fp.read(), progname, 'exec') + globs = { + '__file__': progname, + '__name__': '__main__', + '__package__': None, + '__cached__': None, + } runctx(code, globs, None, options.outfile, options.sort) else: parser.print_usage() diff --git a/Lib/test/test_cprofile.py b/Lib/test/test_cprofile.py index 406d70305f9e..efcf6bc92803 100644 --- a/Lib/test/test_cprofile.py +++ b/Lib/test/test_cprofile.py @@ -37,19 +37,6 @@ def test_bad_counter_during_dealloc(self): finally: unlink(TESTFN) - # Issue 21862 - def test_module_path_option(self): - # Test -m switch with modules - - # Test that -m switch needs an argument - assert_python_failure('-m', 'cProfile', '-m') - - # Test failure for not-existent module - assert_python_failure('-m', 'cProfile', '-m', 'random_module_xyz') - - # Test successful run - assert_python_ok('-m', 'cProfile', '-m', 'timeit', '-n', '1') - def test_profile_enable_disable(self): prof = self.profilerclass() # Make sure we clean ourselves up if the test fails for some reason. diff --git a/Lib/test/test_profile.py b/Lib/test/test_profile.py index a9982663175a..01a8a6eaf5a2 100644 --- a/Lib/test/test_profile.py +++ b/Lib/test/test_profile.py @@ -11,6 +11,7 @@ import profile from test.profilee import testfunc, timer +from test.support.script_helper import assert_python_failure, assert_python_ok class ProfileTest(unittest.TestCase): @@ -98,6 +99,18 @@ def test_runctx(self): filename=TESTFN) self.assertTrue(os.path.exists(TESTFN)) + def test_run_profile_as_module(self): + # Test that -m switch needs an argument + assert_python_failure('-m', self.profilermodule.__name__, '-m') + + # Test failure for not-existent module + assert_python_failure('-m', self.profilermodule.__name__, + '-m', 'random_module_xyz') + + # Test successful run + assert_python_ok('-m', self.profilermodule.__name__, + '-m', 'timeit', '-n', '1') + def regenerate_expected_output(filename, cls): filename = filename.rstrip('co') diff --git a/Misc/NEWS.d/next/Library/2018-01-07-17-43-10.bpo-32512.flC-dE.rst b/Misc/NEWS.d/next/Library/2018-01-07-17-43-10.bpo-32512.flC-dE.rst new file mode 100644 index 000000000000..0a7763daffad --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-01-07-17-43-10.bpo-32512.flC-dE.rst @@ -0,0 +1,2 @@ +:mod:`profile` CLI accepts `-m module_name` as an alternative to +script path. From webhook-mailer at python.org Mon Nov 5 09:20:30 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Mon, 05 Nov 2018 14:20:30 -0000 Subject: [Python-checkins] bpo-35133: Fix mistakes when concatenate string literals on different lines. (GH-10284) Message-ID: https://github.com/python/cpython/commit/34fd4c20198dea6ab2fe8dc6d32d744d9bde868d commit: 34fd4c20198dea6ab2fe8dc6d32d744d9bde868d branch: master author: Serhiy Storchaka committer: GitHub date: 2018-11-05T16:20:25+02:00 summary: bpo-35133: Fix mistakes when concatenate string literals on different lines. (GH-10284) Two kind of mistakes: 1. Missed space. After concatenating there is no space between words. 2. Missed comma. Causes unintentional concatenating in a list of strings. files: M Lib/_pydecimal.py M Lib/concurrent/futures/thread.py M Lib/distutils/command/bdist_dumb.py M Lib/distutils/command/bdist_msi.py M Lib/distutils/command/bdist_rpm.py M Lib/distutils/command/bdist_wininst.py M Lib/distutils/command/build_ext.py M Lib/email/_header_value_parser.py M Lib/idlelib/hyperparser.py M Lib/idlelib/idle_test/htest.py M Lib/idlelib/idle_test/mock_tk.py M Lib/importlib/abc.py M Lib/test/test_builtin.py M Lib/test/test_compile.py M Lib/test/test_decimal.py M Lib/test/test_http_cookiejar.py M Lib/test/test_range.py M Lib/test/test_smtplib.py M Lib/test/test_strptime.py M Lib/trace.py M Lib/unittest/mock.py M Modules/_datetimemodule.c M Modules/_io/textio.c M Modules/_pickle.c M Python/import.c M Tools/scripts/texi2html.py diff --git a/Lib/_pydecimal.py b/Lib/_pydecimal.py index 359690003fe1..44ea5b41b2a1 100644 --- a/Lib/_pydecimal.py +++ b/Lib/_pydecimal.py @@ -2021,7 +2021,7 @@ def _power_modulo(self, other, modulo, context=None): if not other and not self: return context._raise_error(InvalidOperation, 'at least one of pow() 1st argument ' - 'and 2nd argument must be nonzero ;' + 'and 2nd argument must be nonzero; ' '0**0 is not defined') # compute sign of result diff --git a/Lib/concurrent/futures/thread.py b/Lib/concurrent/futures/thread.py index b65dee11f727..78359711d5d9 100644 --- a/Lib/concurrent/futures/thread.py +++ b/Lib/concurrent/futures/thread.py @@ -150,7 +150,7 @@ def submit(self, fn, *args, **kwargs): if self._shutdown: raise RuntimeError('cannot schedule new futures after shutdown') if _shutdown: - raise RuntimeError('cannot schedule new futures after' + raise RuntimeError('cannot schedule new futures after ' 'interpreter shutdown') f = _base.Future() diff --git a/Lib/distutils/command/bdist_dumb.py b/Lib/distutils/command/bdist_dumb.py index e9274d925afa..f0d6b5b8cd8a 100644 --- a/Lib/distutils/command/bdist_dumb.py +++ b/Lib/distutils/command/bdist_dumb.py @@ -32,7 +32,7 @@ class bdist_dumb(Command): ('skip-build', None, "skip rebuilding everything (for testing/debugging)"), ('relative', None, - "build the archive using relative paths" + "build the archive using relative paths " "(default: false)"), ('owner=', 'u', "Owner name used when creating a tar file" diff --git a/Lib/distutils/command/bdist_msi.py b/Lib/distutils/command/bdist_msi.py index a4bd5a589d38..80104c372d9a 100644 --- a/Lib/distutils/command/bdist_msi.py +++ b/Lib/distutils/command/bdist_msi.py @@ -98,14 +98,14 @@ class bdist_msi(Command): ('no-target-compile', 'c', "do not compile .py to .pyc on the target system"), ('no-target-optimize', 'o', - "do not compile .py to .pyo (optimized)" + "do not compile .py to .pyo (optimized) " "on the target system"), ('dist-dir=', 'd', "directory to put final built distributions in"), ('skip-build', None, "skip rebuilding everything (for testing/debugging)"), ('install-script=', None, - "basename of installation script to be run after" + "basename of installation script to be run after " "installation or before deinstallation"), ('pre-install-script=', None, "Fully qualified filename of a script to be run before " diff --git a/Lib/distutils/command/bdist_rpm.py b/Lib/distutils/command/bdist_rpm.py index ac4621791d56..02f10dd89d91 100644 --- a/Lib/distutils/command/bdist_rpm.py +++ b/Lib/distutils/command/bdist_rpm.py @@ -58,7 +58,7 @@ class bdist_rpm(Command): "RPM \"vendor\" (eg. \"Joe Blow \") " "[default: maintainer or author from setup script]"), ('packager=', None, - "RPM packager (eg. \"Jane Doe \")" + "RPM packager (eg. \"Jane Doe \") " "[default: vendor]"), ('doc-files=', None, "list of documentation files (space or comma-separated)"), diff --git a/Lib/distutils/command/bdist_wininst.py b/Lib/distutils/command/bdist_wininst.py index 0871a4f7d6b2..fde56754e891 100644 --- a/Lib/distutils/command/bdist_wininst.py +++ b/Lib/distutils/command/bdist_wininst.py @@ -29,7 +29,7 @@ class bdist_wininst(Command): ('no-target-compile', 'c', "do not compile .py to .pyc on the target system"), ('no-target-optimize', 'o', - "do not compile .py to .pyo (optimized)" + "do not compile .py to .pyo (optimized) " "on the target system"), ('dist-dir=', 'd', "directory to put final built distributions in"), @@ -40,7 +40,7 @@ class bdist_wininst(Command): ('skip-build', None, "skip rebuilding everything (for testing/debugging)"), ('install-script=', None, - "basename of installation script to be run after" + "basename of installation script to be run after " "installation or before deinstallation"), ('pre-install-script=', None, "Fully qualified filename of a script to be run before " diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py index 8fad9cdc2b47..158465d2338c 100644 --- a/Lib/distutils/command/build_ext.py +++ b/Lib/distutils/command/build_ext.py @@ -365,7 +365,7 @@ def check_extensions_list(self, extensions): ext_name, build_info = ext log.warn("old-style (ext_name, build_info) tuple found in " - "ext_modules for extension '%s'" + "ext_modules for extension '%s' " "-- please convert to Extension instance", ext_name) if not (isinstance(ext_name, str) and diff --git a/Lib/email/_header_value_parser.py b/Lib/email/_header_value_parser.py index e805a75fbd93..416da1a80d9c 100644 --- a/Lib/email/_header_value_parser.py +++ b/Lib/email/_header_value_parser.py @@ -2209,8 +2209,8 @@ def get_section(value): digits += value[0] value = value[1:] if digits[0] == '0' and digits != '0': - section.defects.append(errors.InvalidHeaderError("section number" - "has an invalid leading 0")) + section.defects.append(errors.InvalidHeaderError( + "section number has an invalid leading 0")) section.number = int(digits) section.append(ValueTerminal(digits, 'digits')) return section, value diff --git a/Lib/idlelib/hyperparser.py b/Lib/idlelib/hyperparser.py index 7581fe274b21..7e7e0ae80247 100644 --- a/Lib/idlelib/hyperparser.py +++ b/Lib/idlelib/hyperparser.py @@ -224,7 +224,7 @@ def get_expression(self): given index, which is empty if there is no real one. """ if not self.is_in_code(): - raise ValueError("get_expression should only be called" + raise ValueError("get_expression should only be called " "if index is inside a code.") rawtext = self.rawtext diff --git a/Lib/idlelib/idle_test/htest.py b/Lib/idlelib/idle_test/htest.py index 8c1c24d070cc..583e607b767e 100644 --- a/Lib/idlelib/idle_test/htest.py +++ b/Lib/idlelib/idle_test/htest.py @@ -117,7 +117,7 @@ def _wrapper(parent): # htest # "font face of the text in the area below it.\nIn the " "'Highlighting' tab, try different color schemes. Clicking " "items in the sample program should update the choices above it." - "\nIn the 'Keys', 'General' and 'Extensions' tabs, test settings" + "\nIn the 'Keys', 'General' and 'Extensions' tabs, test settings " "of interest." "\n[Ok] to close the dialog.[Apply] to apply the settings and " "and [Cancel] to revert all changes.\nRe-run the test to ensure " @@ -152,7 +152,7 @@ def _wrapper(parent): # htest # 'msg': "Test for different key modifier sequences.\n" " is invalid.\n" "No modifier key is invalid.\n" - "Shift key with [a-z],[0-9], function key, move key, tab, space" + "Shift key with [a-z],[0-9], function key, move key, tab, space " "is invalid.\nNo validity checking if advanced key binding " "entry is used." } @@ -234,7 +234,7 @@ def _wrapper(parent): # htest # 'file': 'percolator', 'kwds': {}, 'msg': "There are two tracers which can be toggled using a checkbox.\n" - "Toggling a tracer 'on' by checking it should print tracer" + "Toggling a tracer 'on' by checking it should print tracer " "output to the console or to the IDLE shell.\n" "If both the tracers are 'on', the output from the tracer which " "was switched 'on' later, should be printed first\n" @@ -335,7 +335,7 @@ def _wrapper(parent): # htest # _widget_redirector_spec = { 'file': 'redirector', 'kwds': {}, - 'msg': "Every text insert should be printed to the console." + 'msg': "Every text insert should be printed to the console " "or the IDLE shell." } diff --git a/Lib/idlelib/idle_test/mock_tk.py b/Lib/idlelib/idle_test/mock_tk.py index 6e351297d75d..a54f51f1949c 100644 --- a/Lib/idlelib/idle_test/mock_tk.py +++ b/Lib/idlelib/idle_test/mock_tk.py @@ -260,7 +260,7 @@ def compare(self, index1, op, index2): elif op == '!=': return line1 != line2 or char1 != char2 else: - raise TclError('''bad comparison operator "%s":''' + raise TclError('''bad comparison operator "%s": ''' '''must be <, <=, ==, >=, >, or !=''' % op) # The following Text methods normally do something and return None. diff --git a/Lib/importlib/abc.py b/Lib/importlib/abc.py index dbdd5bf64192..4b2d3de6d96f 100644 --- a/Lib/importlib/abc.py +++ b/Lib/importlib/abc.py @@ -66,7 +66,7 @@ def find_module(self, fullname, path): """ warnings.warn("MetaPathFinder.find_module() is deprecated since Python " - "3.4 in favor of MetaPathFinder.find_spec()" + "3.4 in favor of MetaPathFinder.find_spec() " "(available since 3.4)", DeprecationWarning, stacklevel=2) diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py index dafcf004c095..e2a4f2fa6d2f 100644 --- a/Lib/test/test_builtin.py +++ b/Lib/test/test_builtin.py @@ -1607,7 +1607,7 @@ def test_envar_good_path_empty_string(self): @unittest.skipIf(sys.flags.ignore_environment, '-E was given') def test_envar_unimportable(self): for envar in ( - '.', '..', '.foo', 'foo.', '.int', 'int.' + '.', '..', '.foo', 'foo.', '.int', 'int.', 'nosuchbuiltin', 'nosuchmodule.nosuchcallable', ): diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index 6b45a2433438..6851f84b85a6 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -285,7 +285,7 @@ def test_import(self): 'from sys import stdin)', 'from sys import stdin, stdout,\nstderr', 'from sys import stdin si', - 'from sys import stdin,' + 'from sys import stdin,', 'from sys import (*)', 'from sys import (stdin,, stdout, stderr)', 'from sys import (stdin, stdout),', diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py index 58bde54b0a88..1f37b5372a3e 100644 --- a/Lib/test/test_decimal.py +++ b/Lib/test/test_decimal.py @@ -1172,10 +1172,10 @@ def test_wide_char_separator_decimal_point(self): decimal_point = locale.localeconv()['decimal_point'] thousands_sep = locale.localeconv()['thousands_sep'] if decimal_point != '\u066b': - self.skipTest('inappropriate decimal point separator' + self.skipTest('inappropriate decimal point separator ' '({!a} not {!a})'.format(decimal_point, '\u066b')) if thousands_sep != '\u066c': - self.skipTest('inappropriate thousands separator' + self.skipTest('inappropriate thousands separator ' '({!a} not {!a})'.format(thousands_sep, '\u066c')) self.assertEqual(format(Decimal('100000000.123'), 'n'), diff --git a/Lib/test/test_http_cookiejar.py b/Lib/test/test_http_cookiejar.py index 968725901f22..8dbea3325d9b 100644 --- a/Lib/test/test_http_cookiejar.py +++ b/Lib/test/test_http_cookiejar.py @@ -174,12 +174,10 @@ def test_iso2time_garbage(self): '1980-01-01 00:61:00', '01-01-1980 00:00:62', '01-01-1980T00:00:62', - '19800101T250000Z' - '1980-01-01 00:00:00 -2500', + '19800101T250000Z', ]: self.assertIsNone(iso2time(test), - "iso2time(%s) is not None\n" - "iso2time(test) %s" % (test, iso2time(test))) + "iso2time(%r)" % test) class HeaderTests(unittest.TestCase): diff --git a/Lib/test/test_range.py b/Lib/test/test_range.py index ce1584748d7e..94c96a941b12 100644 --- a/Lib/test/test_range.py +++ b/Lib/test/test_range.py @@ -39,7 +39,7 @@ def assert_iterators_equal(self, xs, ys, test_id, limit=None): self.fail('{}: unexpected excess element {} at ' 'position {}'.format(test_id, x, i)) else: - self.fail('{}: wrong element at position {};' + self.fail('{}: wrong element at position {}; ' 'expected {}, got {}'.format(test_id, i, y, x)) def test_range(self): diff --git a/Lib/test/test_smtplib.py b/Lib/test/test_smtplib.py index 07d760bd01fd..fdcf6f219256 100644 --- a/Lib/test/test_smtplib.py +++ b/Lib/test/test_smtplib.py @@ -805,7 +805,7 @@ def _auth_cram_md5(self, arg=None): try: user, hashed_pass = logpass.split() except ValueError as e: - self.push('535 Splitting response {!r} into user and password' + self.push('535 Splitting response {!r} into user and password ' 'failed: {}'.format(logpass, e)) return False valid_hashed_pass = hmac.HMAC( diff --git a/Lib/test/test_strptime.py b/Lib/test/test_strptime.py index de2773f6aa29..a3358a493e53 100644 --- a/Lib/test/test_strptime.py +++ b/Lib/test/test_strptime.py @@ -506,7 +506,7 @@ def test_gregorian_calculation(self): self.assertTrue(result.tm_year == self.time_tuple.tm_year and result.tm_mon == self.time_tuple.tm_mon and result.tm_mday == self.time_tuple.tm_mday, - "Calculation of Gregorian date failed;" + "Calculation of Gregorian date failed; " "%s-%s-%s != %s-%s-%s" % (result.tm_year, result.tm_mon, result.tm_mday, self.time_tuple.tm_year, self.time_tuple.tm_mon, @@ -518,7 +518,7 @@ def test_day_of_week_calculation(self): result = _strptime._strptime_time(time.strftime(format_string, self.time_tuple), format_string) self.assertTrue(result.tm_wday == self.time_tuple.tm_wday, - "Calculation of day of the week failed;" + "Calculation of day of the week failed; " "%s != %s" % (result.tm_wday, self.time_tuple.tm_wday)) if support.is_android: diff --git a/Lib/trace.py b/Lib/trace.py index 86b2101763bf..0ed7ba95b520 100755 --- a/Lib/trace.py +++ b/Lib/trace.py @@ -299,7 +299,7 @@ def write_results_file(self, path, lines, lnotab, lines_hit, encoding=None): try: outfile = open(path, "w", encoding=encoding) except OSError as err: - print(("trace: Could not open %r for writing: %s" + print(("trace: Could not open %r for writing: %s " "- skipping" % (path, err)), file=sys.stderr) return 0, 0 @@ -644,7 +644,7 @@ def main(): grp = parser.add_argument_group('Filters', 'Can be specified multiple times') grp.add_argument('--ignore-module', action='append', default=[], - help='Ignore the given module(s) and its submodules' + help='Ignore the given module(s) and its submodules ' '(if it is a package). Accepts comma separated list of ' 'module names.') grp.add_argument('--ignore-dir', action='append', default=[], diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index 1977b870834b..a9c82dcb5d3e 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -1772,7 +1772,7 @@ def method(self, *args, **kw): _unsupported_magics = { '__getattr__', '__setattr__', - '__init__', '__new__', '__prepare__' + '__init__', '__new__', '__prepare__', '__instancecheck__', '__subclasscheck__', '__del__' } diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c index bc4caa02d5f1..2db95b45345b 100644 --- a/Modules/_datetimemodule.c +++ b/Modules/_datetimemodule.c @@ -3446,7 +3446,7 @@ tzinfo_fromutc(PyDateTime_TZInfo *self, PyObject *dt) return result; Inconsistent: - PyErr_SetString(PyExc_ValueError, "fromutc: tz.dst() gave" + PyErr_SetString(PyExc_ValueError, "fromutc: tz.dst() gave " "inconsistent results; cannot convert"); /* fall through to failure */ diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c index be427772817a..8924834eb81c 100644 --- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c @@ -1313,7 +1313,7 @@ _io_TextIOWrapper_reconfigure_impl(textio *self, PyObject *encoding, /* Check if something is in the read buffer */ if (self->decoded_chars != NULL) { if (encoding != Py_None || errors != Py_None || newline_obj != NULL) { - _unsupported("It is not possible to set the encoding or newline" + _unsupported("It is not possible to set the encoding or newline " "of stream after the first read"); return NULL; } diff --git a/Modules/_pickle.c b/Modules/_pickle.c index 0e3bd225dbd8..2166d296abe4 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -4612,7 +4612,7 @@ Pickler_set_memo(PicklerObject *self, PyObject *obj) } else { PyErr_Format(PyExc_TypeError, - "'memo' attribute must be a PicklerMemoProxy object" + "'memo' attribute must be a PicklerMemoProxy object " "or dict, not %.200s", Py_TYPE(obj)->tp_name); return -1; } @@ -7048,7 +7048,7 @@ Unpickler_set_memo(UnpicklerObject *self, PyObject *obj) } else { PyErr_Format(PyExc_TypeError, - "'memo' attribute must be an UnpicklerMemoProxy object" + "'memo' attribute must be an UnpicklerMemoProxy object " "or dict, not %.200s", Py_TYPE(obj)->tp_name); return -1; } diff --git a/Python/import.c b/Python/import.c index 67911ff0e41b..c0ea968fb8b0 100644 --- a/Python/import.c +++ b/Python/import.c @@ -839,7 +839,7 @@ remove_module(PyObject *name) if (!PyMapping_HasKey(modules, name)) { return; } - Py_FatalError("import: deleting existing key in" + Py_FatalError("import: deleting existing key in " "sys.modules failed"); } } diff --git a/Tools/scripts/texi2html.py b/Tools/scripts/texi2html.py index 9c1e9fe8d8c4..5565c210dabb 100755 --- a/Tools/scripts/texi2html.py +++ b/Tools/scripts/texi2html.py @@ -1806,7 +1806,7 @@ def finalize(self): print('', file=fp) print('', file=fp) print('', file=fp) - print('', file=fp) print('', file=fp) print('', file=fp) @@ -1831,7 +1831,7 @@ def finalize(self): print('', file=fp) print('', file=fp) print('', file=fp) - print('', file=fp) print('', file=fp) print('', file=fp) From webhook-mailer at python.org Mon Nov 5 09:53:10 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 05 Nov 2018 14:53:10 -0000 Subject: [Python-checkins] bpo-35133: Fix mistakes when concatenate string literals on different lines. (GH-10284) Message-ID: https://github.com/python/cpython/commit/7beb8c54ede7669a59bb9b912ba0ffd8aa3998c6 commit: 7beb8c54ede7669a59bb9b912ba0ffd8aa3998c6 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-05T06:52:58-08:00 summary: bpo-35133: Fix mistakes when concatenate string literals on different lines. (GH-10284) Two kind of mistakes: 1. Missed space. After concatenating there is no space between words. 2. Missed comma. Causes unintentional concatenating in a list of strings. (cherry picked from commit 34fd4c20198dea6ab2fe8dc6d32d744d9bde868d) Co-authored-by: Serhiy Storchaka files: M Lib/_pydecimal.py M Lib/concurrent/futures/thread.py M Lib/distutils/command/bdist_dumb.py M Lib/distutils/command/bdist_msi.py M Lib/distutils/command/bdist_rpm.py M Lib/distutils/command/bdist_wininst.py M Lib/distutils/command/build_ext.py M Lib/email/_header_value_parser.py M Lib/idlelib/hyperparser.py M Lib/idlelib/idle_test/htest.py M Lib/idlelib/idle_test/mock_tk.py M Lib/importlib/abc.py M Lib/test/test_builtin.py M Lib/test/test_compile.py M Lib/test/test_decimal.py M Lib/test/test_http_cookiejar.py M Lib/test/test_range.py M Lib/test/test_smtplib.py M Lib/test/test_strptime.py M Lib/trace.py M Lib/unittest/mock.py M Modules/_datetimemodule.c M Modules/_io/textio.c M Modules/_pickle.c M Python/import.c M Tools/scripts/texi2html.py diff --git a/Lib/_pydecimal.py b/Lib/_pydecimal.py index 359690003fe1..44ea5b41b2a1 100644 --- a/Lib/_pydecimal.py +++ b/Lib/_pydecimal.py @@ -2021,7 +2021,7 @@ def _power_modulo(self, other, modulo, context=None): if not other and not self: return context._raise_error(InvalidOperation, 'at least one of pow() 1st argument ' - 'and 2nd argument must be nonzero ;' + 'and 2nd argument must be nonzero; ' '0**0 is not defined') # compute sign of result diff --git a/Lib/concurrent/futures/thread.py b/Lib/concurrent/futures/thread.py index b65dee11f727..78359711d5d9 100644 --- a/Lib/concurrent/futures/thread.py +++ b/Lib/concurrent/futures/thread.py @@ -150,7 +150,7 @@ def submit(self, fn, *args, **kwargs): if self._shutdown: raise RuntimeError('cannot schedule new futures after shutdown') if _shutdown: - raise RuntimeError('cannot schedule new futures after' + raise RuntimeError('cannot schedule new futures after ' 'interpreter shutdown') f = _base.Future() diff --git a/Lib/distutils/command/bdist_dumb.py b/Lib/distutils/command/bdist_dumb.py index e9274d925afa..f0d6b5b8cd8a 100644 --- a/Lib/distutils/command/bdist_dumb.py +++ b/Lib/distutils/command/bdist_dumb.py @@ -32,7 +32,7 @@ class bdist_dumb(Command): ('skip-build', None, "skip rebuilding everything (for testing/debugging)"), ('relative', None, - "build the archive using relative paths" + "build the archive using relative paths " "(default: false)"), ('owner=', 'u', "Owner name used when creating a tar file" diff --git a/Lib/distutils/command/bdist_msi.py b/Lib/distutils/command/bdist_msi.py index a4bd5a589d38..80104c372d9a 100644 --- a/Lib/distutils/command/bdist_msi.py +++ b/Lib/distutils/command/bdist_msi.py @@ -98,14 +98,14 @@ class bdist_msi(Command): ('no-target-compile', 'c', "do not compile .py to .pyc on the target system"), ('no-target-optimize', 'o', - "do not compile .py to .pyo (optimized)" + "do not compile .py to .pyo (optimized) " "on the target system"), ('dist-dir=', 'd', "directory to put final built distributions in"), ('skip-build', None, "skip rebuilding everything (for testing/debugging)"), ('install-script=', None, - "basename of installation script to be run after" + "basename of installation script to be run after " "installation or before deinstallation"), ('pre-install-script=', None, "Fully qualified filename of a script to be run before " diff --git a/Lib/distutils/command/bdist_rpm.py b/Lib/distutils/command/bdist_rpm.py index ac4621791d56..02f10dd89d91 100644 --- a/Lib/distutils/command/bdist_rpm.py +++ b/Lib/distutils/command/bdist_rpm.py @@ -58,7 +58,7 @@ class bdist_rpm(Command): "RPM \"vendor\" (eg. \"Joe Blow \") " "[default: maintainer or author from setup script]"), ('packager=', None, - "RPM packager (eg. \"Jane Doe \")" + "RPM packager (eg. \"Jane Doe \") " "[default: vendor]"), ('doc-files=', None, "list of documentation files (space or comma-separated)"), diff --git a/Lib/distutils/command/bdist_wininst.py b/Lib/distutils/command/bdist_wininst.py index 0871a4f7d6b2..fde56754e891 100644 --- a/Lib/distutils/command/bdist_wininst.py +++ b/Lib/distutils/command/bdist_wininst.py @@ -29,7 +29,7 @@ class bdist_wininst(Command): ('no-target-compile', 'c', "do not compile .py to .pyc on the target system"), ('no-target-optimize', 'o', - "do not compile .py to .pyo (optimized)" + "do not compile .py to .pyo (optimized) " "on the target system"), ('dist-dir=', 'd', "directory to put final built distributions in"), @@ -40,7 +40,7 @@ class bdist_wininst(Command): ('skip-build', None, "skip rebuilding everything (for testing/debugging)"), ('install-script=', None, - "basename of installation script to be run after" + "basename of installation script to be run after " "installation or before deinstallation"), ('pre-install-script=', None, "Fully qualified filename of a script to be run before " diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py index 8fad9cdc2b47..158465d2338c 100644 --- a/Lib/distutils/command/build_ext.py +++ b/Lib/distutils/command/build_ext.py @@ -365,7 +365,7 @@ def check_extensions_list(self, extensions): ext_name, build_info = ext log.warn("old-style (ext_name, build_info) tuple found in " - "ext_modules for extension '%s'" + "ext_modules for extension '%s' " "-- please convert to Extension instance", ext_name) if not (isinstance(ext_name, str) and diff --git a/Lib/email/_header_value_parser.py b/Lib/email/_header_value_parser.py index e805a75fbd93..416da1a80d9c 100644 --- a/Lib/email/_header_value_parser.py +++ b/Lib/email/_header_value_parser.py @@ -2209,8 +2209,8 @@ def get_section(value): digits += value[0] value = value[1:] if digits[0] == '0' and digits != '0': - section.defects.append(errors.InvalidHeaderError("section number" - "has an invalid leading 0")) + section.defects.append(errors.InvalidHeaderError( + "section number has an invalid leading 0")) section.number = int(digits) section.append(ValueTerminal(digits, 'digits')) return section, value diff --git a/Lib/idlelib/hyperparser.py b/Lib/idlelib/hyperparser.py index 7581fe274b21..7e7e0ae80247 100644 --- a/Lib/idlelib/hyperparser.py +++ b/Lib/idlelib/hyperparser.py @@ -224,7 +224,7 @@ def get_expression(self): given index, which is empty if there is no real one. """ if not self.is_in_code(): - raise ValueError("get_expression should only be called" + raise ValueError("get_expression should only be called " "if index is inside a code.") rawtext = self.rawtext diff --git a/Lib/idlelib/idle_test/htest.py b/Lib/idlelib/idle_test/htest.py index 8c1c24d070cc..583e607b767e 100644 --- a/Lib/idlelib/idle_test/htest.py +++ b/Lib/idlelib/idle_test/htest.py @@ -117,7 +117,7 @@ def _wrapper(parent): # htest # "font face of the text in the area below it.\nIn the " "'Highlighting' tab, try different color schemes. Clicking " "items in the sample program should update the choices above it." - "\nIn the 'Keys', 'General' and 'Extensions' tabs, test settings" + "\nIn the 'Keys', 'General' and 'Extensions' tabs, test settings " "of interest." "\n[Ok] to close the dialog.[Apply] to apply the settings and " "and [Cancel] to revert all changes.\nRe-run the test to ensure " @@ -152,7 +152,7 @@ def _wrapper(parent): # htest # 'msg': "Test for different key modifier sequences.\n" " is invalid.\n" "No modifier key is invalid.\n" - "Shift key with [a-z],[0-9], function key, move key, tab, space" + "Shift key with [a-z],[0-9], function key, move key, tab, space " "is invalid.\nNo validity checking if advanced key binding " "entry is used." } @@ -234,7 +234,7 @@ def _wrapper(parent): # htest # 'file': 'percolator', 'kwds': {}, 'msg': "There are two tracers which can be toggled using a checkbox.\n" - "Toggling a tracer 'on' by checking it should print tracer" + "Toggling a tracer 'on' by checking it should print tracer " "output to the console or to the IDLE shell.\n" "If both the tracers are 'on', the output from the tracer which " "was switched 'on' later, should be printed first\n" @@ -335,7 +335,7 @@ def _wrapper(parent): # htest # _widget_redirector_spec = { 'file': 'redirector', 'kwds': {}, - 'msg': "Every text insert should be printed to the console." + 'msg': "Every text insert should be printed to the console " "or the IDLE shell." } diff --git a/Lib/idlelib/idle_test/mock_tk.py b/Lib/idlelib/idle_test/mock_tk.py index 6e351297d75d..a54f51f1949c 100644 --- a/Lib/idlelib/idle_test/mock_tk.py +++ b/Lib/idlelib/idle_test/mock_tk.py @@ -260,7 +260,7 @@ def compare(self, index1, op, index2): elif op == '!=': return line1 != line2 or char1 != char2 else: - raise TclError('''bad comparison operator "%s":''' + raise TclError('''bad comparison operator "%s": ''' '''must be <, <=, ==, >=, >, or !=''' % op) # The following Text methods normally do something and return None. diff --git a/Lib/importlib/abc.py b/Lib/importlib/abc.py index dbdd5bf64192..4b2d3de6d96f 100644 --- a/Lib/importlib/abc.py +++ b/Lib/importlib/abc.py @@ -66,7 +66,7 @@ def find_module(self, fullname, path): """ warnings.warn("MetaPathFinder.find_module() is deprecated since Python " - "3.4 in favor of MetaPathFinder.find_spec()" + "3.4 in favor of MetaPathFinder.find_spec() " "(available since 3.4)", DeprecationWarning, stacklevel=2) diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py index e7202cd70c9c..7c9768a337bb 100644 --- a/Lib/test/test_builtin.py +++ b/Lib/test/test_builtin.py @@ -1600,7 +1600,7 @@ def test_envar_good_path_empty_string(self): @unittest.skipIf(sys.flags.ignore_environment, '-E was given') def test_envar_unimportable(self): for envar in ( - '.', '..', '.foo', 'foo.', '.int', 'int.' + '.', '..', '.foo', 'foo.', '.int', 'int.', 'nosuchbuiltin', 'nosuchmodule.nosuchcallable', ): diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index acebdbdc4636..d8a57e5e0925 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -285,7 +285,7 @@ def test_import(self): 'from sys import stdin)', 'from sys import stdin, stdout,\nstderr', 'from sys import stdin si', - 'from sys import stdin,' + 'from sys import stdin,', 'from sys import (*)', 'from sys import (stdin,, stdout, stderr)', 'from sys import (stdin, stdout),', diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py index 58bde54b0a88..1f37b5372a3e 100644 --- a/Lib/test/test_decimal.py +++ b/Lib/test/test_decimal.py @@ -1172,10 +1172,10 @@ def test_wide_char_separator_decimal_point(self): decimal_point = locale.localeconv()['decimal_point'] thousands_sep = locale.localeconv()['thousands_sep'] if decimal_point != '\u066b': - self.skipTest('inappropriate decimal point separator' + self.skipTest('inappropriate decimal point separator ' '({!a} not {!a})'.format(decimal_point, '\u066b')) if thousands_sep != '\u066c': - self.skipTest('inappropriate thousands separator' + self.skipTest('inappropriate thousands separator ' '({!a} not {!a})'.format(thousands_sep, '\u066c')) self.assertEqual(format(Decimal('100000000.123'), 'n'), diff --git a/Lib/test/test_http_cookiejar.py b/Lib/test/test_http_cookiejar.py index 6fee4df10a40..abc625d672a7 100644 --- a/Lib/test/test_http_cookiejar.py +++ b/Lib/test/test_http_cookiejar.py @@ -174,12 +174,10 @@ def test_iso2time_garbage(self): '1980-01-01 00:61:00', '01-01-1980 00:00:62', '01-01-1980T00:00:62', - '19800101T250000Z' - '1980-01-01 00:00:00 -2500', + '19800101T250000Z', ]: self.assertIsNone(iso2time(test), - "iso2time(%s) is not None\n" - "iso2time(test) %s" % (test, iso2time(test))) + "iso2time(%r)" % test) class HeaderTests(unittest.TestCase): diff --git a/Lib/test/test_range.py b/Lib/test/test_range.py index ce1584748d7e..94c96a941b12 100644 --- a/Lib/test/test_range.py +++ b/Lib/test/test_range.py @@ -39,7 +39,7 @@ def assert_iterators_equal(self, xs, ys, test_id, limit=None): self.fail('{}: unexpected excess element {} at ' 'position {}'.format(test_id, x, i)) else: - self.fail('{}: wrong element at position {};' + self.fail('{}: wrong element at position {}; ' 'expected {}, got {}'.format(test_id, i, y, x)) def test_range(self): diff --git a/Lib/test/test_smtplib.py b/Lib/test/test_smtplib.py index 8a29e98a4f30..b4149d3ef007 100644 --- a/Lib/test/test_smtplib.py +++ b/Lib/test/test_smtplib.py @@ -770,7 +770,7 @@ def _auth_cram_md5(self, arg=None): try: user, hashed_pass = logpass.split() except ValueError as e: - self.push('535 Splitting response {!r} into user and password' + self.push('535 Splitting response {!r} into user and password ' 'failed: {}'.format(logpass, e)) return False valid_hashed_pass = hmac.HMAC( diff --git a/Lib/test/test_strptime.py b/Lib/test/test_strptime.py index de2773f6aa29..a3358a493e53 100644 --- a/Lib/test/test_strptime.py +++ b/Lib/test/test_strptime.py @@ -506,7 +506,7 @@ def test_gregorian_calculation(self): self.assertTrue(result.tm_year == self.time_tuple.tm_year and result.tm_mon == self.time_tuple.tm_mon and result.tm_mday == self.time_tuple.tm_mday, - "Calculation of Gregorian date failed;" + "Calculation of Gregorian date failed; " "%s-%s-%s != %s-%s-%s" % (result.tm_year, result.tm_mon, result.tm_mday, self.time_tuple.tm_year, self.time_tuple.tm_mon, @@ -518,7 +518,7 @@ def test_day_of_week_calculation(self): result = _strptime._strptime_time(time.strftime(format_string, self.time_tuple), format_string) self.assertTrue(result.tm_wday == self.time_tuple.tm_wday, - "Calculation of day of the week failed;" + "Calculation of day of the week failed; " "%s != %s" % (result.tm_wday, self.time_tuple.tm_wday)) if support.is_android: diff --git a/Lib/trace.py b/Lib/trace.py index 86b2101763bf..0ed7ba95b520 100755 --- a/Lib/trace.py +++ b/Lib/trace.py @@ -299,7 +299,7 @@ def write_results_file(self, path, lines, lnotab, lines_hit, encoding=None): try: outfile = open(path, "w", encoding=encoding) except OSError as err: - print(("trace: Could not open %r for writing: %s" + print(("trace: Could not open %r for writing: %s " "- skipping" % (path, err)), file=sys.stderr) return 0, 0 @@ -644,7 +644,7 @@ def main(): grp = parser.add_argument_group('Filters', 'Can be specified multiple times') grp.add_argument('--ignore-module', action='append', default=[], - help='Ignore the given module(s) and its submodules' + help='Ignore the given module(s) and its submodules ' '(if it is a package). Accepts comma separated list of ' 'module names.') grp.add_argument('--ignore-dir', action='append', default=[], diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index 1a6c251d2cf7..b0c03c03bd6f 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -1749,7 +1749,7 @@ def method(self, *args, **kw): _unsupported_magics = { '__getattr__', '__setattr__', - '__init__', '__new__', '__prepare__' + '__init__', '__new__', '__prepare__', '__instancecheck__', '__subclasscheck__', '__del__' } diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c index f53880808d21..1f15367d3fa3 100644 --- a/Modules/_datetimemodule.c +++ b/Modules/_datetimemodule.c @@ -3443,7 +3443,7 @@ tzinfo_fromutc(PyDateTime_TZInfo *self, PyObject *dt) return result; Inconsistent: - PyErr_SetString(PyExc_ValueError, "fromutc: tz.dst() gave" + PyErr_SetString(PyExc_ValueError, "fromutc: tz.dst() gave " "inconsistent results; cannot convert"); /* fall through to failure */ diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c index 73d1b2e8a23b..9d0d9cac40db 100644 --- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c @@ -1313,7 +1313,7 @@ _io_TextIOWrapper_reconfigure_impl(textio *self, PyObject *encoding, /* Check if something is in the read buffer */ if (self->decoded_chars != NULL) { if (encoding != Py_None || errors != Py_None || newline_obj != NULL) { - _unsupported("It is not possible to set the encoding or newline" + _unsupported("It is not possible to set the encoding or newline " "of stream after the first read"); return NULL; } diff --git a/Modules/_pickle.c b/Modules/_pickle.c index ba8962d686de..03f575e4621c 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -4614,7 +4614,7 @@ Pickler_set_memo(PicklerObject *self, PyObject *obj) } else { PyErr_Format(PyExc_TypeError, - "'memo' attribute must be a PicklerMemoProxy object" + "'memo' attribute must be a PicklerMemoProxy object " "or dict, not %.200s", Py_TYPE(obj)->tp_name); return -1; } @@ -7060,7 +7060,7 @@ Unpickler_set_memo(UnpicklerObject *self, PyObject *obj) } else { PyErr_Format(PyExc_TypeError, - "'memo' attribute must be an UnpicklerMemoProxy object" + "'memo' attribute must be an UnpicklerMemoProxy object " "or dict, not %.200s", Py_TYPE(obj)->tp_name); return -1; } diff --git a/Python/import.c b/Python/import.c index 5d1794720cfc..709fc4324e6f 100644 --- a/Python/import.c +++ b/Python/import.c @@ -833,7 +833,7 @@ remove_module(PyObject *name) if (!PyMapping_HasKey(modules, name)) { return; } - Py_FatalError("import: deleting existing key in" + Py_FatalError("import: deleting existing key in " "sys.modules failed"); } } diff --git a/Tools/scripts/texi2html.py b/Tools/scripts/texi2html.py index 9c1e9fe8d8c4..5565c210dabb 100755 --- a/Tools/scripts/texi2html.py +++ b/Tools/scripts/texi2html.py @@ -1806,7 +1806,7 @@ def finalize(self): print('', file=fp) print('', file=fp) print('', file=fp) - print('', file=fp) print('', file=fp) print('', file=fp) @@ -1831,7 +1831,7 @@ def finalize(self): print('', file=fp) print('', file=fp) print('', file=fp) - print('', file=fp) print('', file=fp) print('', file=fp) From webhook-mailer at python.org Mon Nov 5 10:13:55 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Mon, 05 Nov 2018 15:13:55 -0000 Subject: [Python-checkins] [3.6] bpo-35133: Fix mistakes when concatenate string literals on different lines. (GH-10284) (GH-10335) Message-ID: https://github.com/python/cpython/commit/7054e5c80b6e98cd44e22d1bc2d7f0a94343089d commit: 7054e5c80b6e98cd44e22d1bc2d7f0a94343089d branch: 3.6 author: Serhiy Storchaka committer: GitHub date: 2018-11-05T17:13:50+02:00 summary: [3.6] bpo-35133: Fix mistakes when concatenate string literals on different lines. (GH-10284) (GH-10335) Two kind of mistakes: 1. Missed space. After concatenating there is no space between words. 2. Missed comma. Causes unintentional concatenating in a list of strings.. (cherry picked from commit 34fd4c20198dea6ab2fe8dc6d32d744d9bde868d) files: M Lib/_pydecimal.py M Lib/distutils/command/bdist_dumb.py M Lib/distutils/command/bdist_msi.py M Lib/distutils/command/bdist_rpm.py M Lib/distutils/command/bdist_wininst.py M Lib/distutils/command/build_ext.py M Lib/email/_header_value_parser.py M Lib/idlelib/hyperparser.py M Lib/idlelib/idle_test/htest.py M Lib/idlelib/idle_test/mock_tk.py M Lib/test/test_compile.py M Lib/test/test_decimal.py M Lib/test/test_http_cookiejar.py M Lib/test/test_range.py M Lib/test/test_smtplib.py M Lib/test/test_strptime.py M Lib/trace.py M Lib/unittest/mock.py M Modules/_datetimemodule.c M Modules/_pickle.c M Python/import.c M Tools/scripts/texi2html.py diff --git a/Lib/_pydecimal.py b/Lib/_pydecimal.py index 0b40928ff8d1..e7df67dc9b9d 100644 --- a/Lib/_pydecimal.py +++ b/Lib/_pydecimal.py @@ -2062,7 +2062,7 @@ def _power_modulo(self, other, modulo, context=None): if not other and not self: return context._raise_error(InvalidOperation, 'at least one of pow() 1st argument ' - 'and 2nd argument must be nonzero ;' + 'and 2nd argument must be nonzero; ' '0**0 is not defined') # compute sign of result diff --git a/Lib/distutils/command/bdist_dumb.py b/Lib/distutils/command/bdist_dumb.py index e9274d925afa..f0d6b5b8cd8a 100644 --- a/Lib/distutils/command/bdist_dumb.py +++ b/Lib/distutils/command/bdist_dumb.py @@ -32,7 +32,7 @@ class bdist_dumb(Command): ('skip-build', None, "skip rebuilding everything (for testing/debugging)"), ('relative', None, - "build the archive using relative paths" + "build the archive using relative paths " "(default: false)"), ('owner=', 'u', "Owner name used when creating a tar file" diff --git a/Lib/distutils/command/bdist_msi.py b/Lib/distutils/command/bdist_msi.py index a4bd5a589d38..80104c372d9a 100644 --- a/Lib/distutils/command/bdist_msi.py +++ b/Lib/distutils/command/bdist_msi.py @@ -98,14 +98,14 @@ class bdist_msi(Command): ('no-target-compile', 'c', "do not compile .py to .pyc on the target system"), ('no-target-optimize', 'o', - "do not compile .py to .pyo (optimized)" + "do not compile .py to .pyo (optimized) " "on the target system"), ('dist-dir=', 'd', "directory to put final built distributions in"), ('skip-build', None, "skip rebuilding everything (for testing/debugging)"), ('install-script=', None, - "basename of installation script to be run after" + "basename of installation script to be run after " "installation or before deinstallation"), ('pre-install-script=', None, "Fully qualified filename of a script to be run before " diff --git a/Lib/distutils/command/bdist_rpm.py b/Lib/distutils/command/bdist_rpm.py index ac4621791d56..02f10dd89d91 100644 --- a/Lib/distutils/command/bdist_rpm.py +++ b/Lib/distutils/command/bdist_rpm.py @@ -58,7 +58,7 @@ class bdist_rpm(Command): "RPM \"vendor\" (eg. \"Joe Blow \") " "[default: maintainer or author from setup script]"), ('packager=', None, - "RPM packager (eg. \"Jane Doe \")" + "RPM packager (eg. \"Jane Doe \") " "[default: vendor]"), ('doc-files=', None, "list of documentation files (space or comma-separated)"), diff --git a/Lib/distutils/command/bdist_wininst.py b/Lib/distutils/command/bdist_wininst.py index 0871a4f7d6b2..fde56754e891 100644 --- a/Lib/distutils/command/bdist_wininst.py +++ b/Lib/distutils/command/bdist_wininst.py @@ -29,7 +29,7 @@ class bdist_wininst(Command): ('no-target-compile', 'c', "do not compile .py to .pyc on the target system"), ('no-target-optimize', 'o', - "do not compile .py to .pyo (optimized)" + "do not compile .py to .pyo (optimized) " "on the target system"), ('dist-dir=', 'd', "directory to put final built distributions in"), @@ -40,7 +40,7 @@ class bdist_wininst(Command): ('skip-build', None, "skip rebuilding everything (for testing/debugging)"), ('install-script=', None, - "basename of installation script to be run after" + "basename of installation script to be run after " "installation or before deinstallation"), ('pre-install-script=', None, "Fully qualified filename of a script to be run before " diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py index 74de782d8a66..8ed4065bb5f0 100644 --- a/Lib/distutils/command/build_ext.py +++ b/Lib/distutils/command/build_ext.py @@ -365,7 +365,7 @@ def check_extensions_list(self, extensions): ext_name, build_info = ext log.warn("old-style (ext_name, build_info) tuple found in " - "ext_modules for extension '%s'" + "ext_modules for extension '%s' " "-- please convert to Extension instance", ext_name) if not (isinstance(ext_name, str) and diff --git a/Lib/email/_header_value_parser.py b/Lib/email/_header_value_parser.py index de7ab5d12e78..1fb8cb448a01 100644 --- a/Lib/email/_header_value_parser.py +++ b/Lib/email/_header_value_parser.py @@ -2210,8 +2210,8 @@ def get_section(value): digits += value[0] value = value[1:] if digits[0] == '0' and digits != '0': - section.defects.append(errors.InvalidHeaderError("section number" - "has an invalid leading 0")) + section.defects.append(errors.InvalidHeaderError( + "section number has an invalid leading 0")) section.number = int(digits) section.append(ValueTerminal(digits, 'digits')) return section, value diff --git a/Lib/idlelib/hyperparser.py b/Lib/idlelib/hyperparser.py index 7581fe274b21..7e7e0ae80247 100644 --- a/Lib/idlelib/hyperparser.py +++ b/Lib/idlelib/hyperparser.py @@ -224,7 +224,7 @@ def get_expression(self): given index, which is empty if there is no real one. """ if not self.is_in_code(): - raise ValueError("get_expression should only be called" + raise ValueError("get_expression should only be called " "if index is inside a code.") rawtext = self.rawtext diff --git a/Lib/idlelib/idle_test/htest.py b/Lib/idlelib/idle_test/htest.py index 8c1c24d070cc..583e607b767e 100644 --- a/Lib/idlelib/idle_test/htest.py +++ b/Lib/idlelib/idle_test/htest.py @@ -117,7 +117,7 @@ def _wrapper(parent): # htest # "font face of the text in the area below it.\nIn the " "'Highlighting' tab, try different color schemes. Clicking " "items in the sample program should update the choices above it." - "\nIn the 'Keys', 'General' and 'Extensions' tabs, test settings" + "\nIn the 'Keys', 'General' and 'Extensions' tabs, test settings " "of interest." "\n[Ok] to close the dialog.[Apply] to apply the settings and " "and [Cancel] to revert all changes.\nRe-run the test to ensure " @@ -152,7 +152,7 @@ def _wrapper(parent): # htest # 'msg': "Test for different key modifier sequences.\n" " is invalid.\n" "No modifier key is invalid.\n" - "Shift key with [a-z],[0-9], function key, move key, tab, space" + "Shift key with [a-z],[0-9], function key, move key, tab, space " "is invalid.\nNo validity checking if advanced key binding " "entry is used." } @@ -234,7 +234,7 @@ def _wrapper(parent): # htest # 'file': 'percolator', 'kwds': {}, 'msg': "There are two tracers which can be toggled using a checkbox.\n" - "Toggling a tracer 'on' by checking it should print tracer" + "Toggling a tracer 'on' by checking it should print tracer " "output to the console or to the IDLE shell.\n" "If both the tracers are 'on', the output from the tracer which " "was switched 'on' later, should be printed first\n" @@ -335,7 +335,7 @@ def _wrapper(parent): # htest # _widget_redirector_spec = { 'file': 'redirector', 'kwds': {}, - 'msg': "Every text insert should be printed to the console." + 'msg': "Every text insert should be printed to the console " "or the IDLE shell." } diff --git a/Lib/idlelib/idle_test/mock_tk.py b/Lib/idlelib/idle_test/mock_tk.py index 6e351297d75d..a54f51f1949c 100644 --- a/Lib/idlelib/idle_test/mock_tk.py +++ b/Lib/idlelib/idle_test/mock_tk.py @@ -260,7 +260,7 @@ def compare(self, index1, op, index2): elif op == '!=': return line1 != line2 or char1 != char2 else: - raise TclError('''bad comparison operator "%s":''' + raise TclError('''bad comparison operator "%s": ''' '''must be <, <=, ==, >=, >, or !=''' % op) # The following Text methods normally do something and return None. diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index c9812e46b486..745ce029aa57 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -285,7 +285,7 @@ def test_import(self): 'from sys import stdin)', 'from sys import stdin, stdout,\nstderr', 'from sys import stdin si', - 'from sys import stdin,' + 'from sys import stdin,', 'from sys import (*)', 'from sys import (stdin,, stdout, stderr)', 'from sys import (stdin, stdout),', diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py index 45d80cec810f..8808a670f939 100644 --- a/Lib/test/test_decimal.py +++ b/Lib/test/test_decimal.py @@ -1178,10 +1178,10 @@ def test_wide_char_separator_decimal_point(self): decimal_point = locale.localeconv()['decimal_point'] thousands_sep = locale.localeconv()['thousands_sep'] if decimal_point != '\u066b': - self.skipTest('inappropriate decimal point separator' + self.skipTest('inappropriate decimal point separator ' '({!a} not {!a})'.format(decimal_point, '\u066b')) if thousands_sep != '\u066c': - self.skipTest('inappropriate thousands separator' + self.skipTest('inappropriate thousands separator ' '({!a} not {!a})'.format(thousands_sep, '\u066c')) self.assertEqual(format(Decimal('100000000.123'), 'n'), diff --git a/Lib/test/test_http_cookiejar.py b/Lib/test/test_http_cookiejar.py index 6fee4df10a40..abc625d672a7 100644 --- a/Lib/test/test_http_cookiejar.py +++ b/Lib/test/test_http_cookiejar.py @@ -174,12 +174,10 @@ def test_iso2time_garbage(self): '1980-01-01 00:61:00', '01-01-1980 00:00:62', '01-01-1980T00:00:62', - '19800101T250000Z' - '1980-01-01 00:00:00 -2500', + '19800101T250000Z', ]: self.assertIsNone(iso2time(test), - "iso2time(%s) is not None\n" - "iso2time(test) %s" % (test, iso2time(test))) + "iso2time(%r)" % test) class HeaderTests(unittest.TestCase): diff --git a/Lib/test/test_range.py b/Lib/test/test_range.py index 679759ec6d67..b6f948dc6a8f 100644 --- a/Lib/test/test_range.py +++ b/Lib/test/test_range.py @@ -40,7 +40,7 @@ def assert_iterators_equal(self, xs, ys, test_id, limit=None): self.fail('{}: unexpected excess element {} at ' 'position {}'.format(test_id, x, i)) else: - self.fail('{}: wrong element at position {};' + self.fail('{}: wrong element at position {}; ' 'expected {}, got {}'.format(test_id, i, y, x)) def test_range(self): diff --git a/Lib/test/test_smtplib.py b/Lib/test/test_smtplib.py index 18110191dc3b..87047514e7aa 100644 --- a/Lib/test/test_smtplib.py +++ b/Lib/test/test_smtplib.py @@ -767,7 +767,7 @@ def _auth_cram_md5(self, arg=None): try: user, hashed_pass = logpass.split() except ValueError as e: - self.push('535 Splitting response {!r} into user and password' + self.push('535 Splitting response {!r} into user and password ' 'failed: {}'.format(logpass, e)) return False valid_hashed_pass = hmac.HMAC( diff --git a/Lib/test/test_strptime.py b/Lib/test/test_strptime.py index 2cf0926239c0..1438487161f9 100644 --- a/Lib/test/test_strptime.py +++ b/Lib/test/test_strptime.py @@ -457,7 +457,7 @@ def test_gregorian_calculation(self): self.assertTrue(result.tm_year == self.time_tuple.tm_year and result.tm_mon == self.time_tuple.tm_mon and result.tm_mday == self.time_tuple.tm_mday, - "Calculation of Gregorian date failed;" + "Calculation of Gregorian date failed; " "%s-%s-%s != %s-%s-%s" % (result.tm_year, result.tm_mon, result.tm_mday, self.time_tuple.tm_year, self.time_tuple.tm_mon, @@ -469,7 +469,7 @@ def test_day_of_week_calculation(self): result = _strptime._strptime_time(time.strftime(format_string, self.time_tuple), format_string) self.assertTrue(result.tm_wday == self.time_tuple.tm_wday, - "Calculation of day of the week failed;" + "Calculation of day of the week failed; " "%s != %s" % (result.tm_wday, self.time_tuple.tm_wday)) if support.is_android: diff --git a/Lib/trace.py b/Lib/trace.py index d171577e3991..e5fa94fc948f 100755 --- a/Lib/trace.py +++ b/Lib/trace.py @@ -313,7 +313,7 @@ def write_results_file(self, path, lines, lnotab, lines_hit, encoding=None): try: outfile = open(path, "w", encoding=encoding) except OSError as err: - print(("trace: Could not open %r for writing: %s" + print(("trace: Could not open %r for writing: %s " "- skipping" % (path, err)), file=sys.stderr) return 0, 0 @@ -655,7 +655,7 @@ def main(): grp = parser.add_argument_group('Filters', 'Can be specified multiple times') grp.add_argument('--ignore-module', action='append', default=[], - help='Ignore the given module(s) and its submodules' + help='Ignore the given module(s) and its submodules ' '(if it is a package). Accepts comma separated list of ' 'module names.') grp.add_argument('--ignore-dir', action='append', default=[], diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index 86183adc1905..31b198516161 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -1737,7 +1737,7 @@ def method(self, *args, **kw): _unsupported_magics = { '__getattr__', '__setattr__', - '__init__', '__new__', '__prepare__' + '__init__', '__new__', '__prepare__', '__instancecheck__', '__subclasscheck__', '__del__' } diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c index afc865e466de..b2e0176b3232 100644 --- a/Modules/_datetimemodule.c +++ b/Modules/_datetimemodule.c @@ -3158,7 +3158,7 @@ tzinfo_fromutc(PyDateTime_TZInfo *self, PyObject *dt) return result; Inconsistent: - PyErr_SetString(PyExc_ValueError, "fromutc: tz.dst() gave" + PyErr_SetString(PyExc_ValueError, "fromutc: tz.dst() gave " "inconsistent results; cannot convert"); /* fall through to failure */ diff --git a/Modules/_pickle.c b/Modules/_pickle.c index 0a7e20e10592..6830d93f503e 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -4527,7 +4527,7 @@ Pickler_set_memo(PicklerObject *self, PyObject *obj) } else { PyErr_Format(PyExc_TypeError, - "'memo' attribute must be a PicklerMemoProxy object" + "'memo' attribute must be a PicklerMemoProxy object " "or dict, not %.200s", Py_TYPE(obj)->tp_name); return -1; } @@ -6969,7 +6969,7 @@ Unpickler_set_memo(UnpicklerObject *self, PyObject *obj) } else { PyErr_Format(PyExc_TypeError, - "'memo' attribute must be an UnpicklerMemoProxy object" + "'memo' attribute must be an UnpicklerMemoProxy object " "or dict, not %.200s", Py_TYPE(obj)->tp_name); return -1; } diff --git a/Python/import.c b/Python/import.c index fa0a9e1f2a43..db1650a9ddd2 100644 --- a/Python/import.c +++ b/Python/import.c @@ -715,7 +715,7 @@ remove_module(PyObject *name) if (PyDict_GetItem(modules, name) == NULL) return; if (PyDict_DelItem(modules, name) < 0) - Py_FatalError("import: deleting existing key in" + Py_FatalError("import: deleting existing key in " "sys.modules failed"); } diff --git a/Tools/scripts/texi2html.py b/Tools/scripts/texi2html.py index 9c1e9fe8d8c4..5565c210dabb 100755 --- a/Tools/scripts/texi2html.py +++ b/Tools/scripts/texi2html.py @@ -1806,7 +1806,7 @@ def finalize(self): print('', file=fp) print('', file=fp) print('', file=fp) - print('', file=fp) print('', file=fp) print('', file=fp) @@ -1831,7 +1831,7 @@ def finalize(self): print('', file=fp) print('', file=fp) print('', file=fp) - print('', file=fp) print('', file=fp) print('', file=fp) From webhook-mailer at python.org Mon Nov 5 10:47:30 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Mon, 05 Nov 2018 15:47:30 -0000 Subject: [Python-checkins] bpo-35167: Specify program for gzip and json.tool command line options. (GH-10332) Message-ID: https://github.com/python/cpython/commit/083a7a172b8c8888252d72031f21dcfea3c0d73f commit: 083a7a172b8c8888252d72031f21dcfea3c0d73f branch: master author: Serhiy Storchaka committer: GitHub date: 2018-11-05T17:47:27+02:00 summary: bpo-35167: Specify program for gzip and json.tool command line options. (GH-10332) files: M Doc/library/gzip.rst M Doc/library/json.rst diff --git a/Doc/library/gzip.rst b/Doc/library/gzip.rst index a93f37743854..a57307b0e499 100644 --- a/Doc/library/gzip.rst +++ b/Doc/library/gzip.rst @@ -211,6 +211,9 @@ Example of how to GZIP compress a binary string:: The basic data compression module needed to support the :program:`gzip` file format. + +.. program:: gzip + Command Line Interface ---------------------- diff --git a/Doc/library/json.rst b/Doc/library/json.rst index 8ce493d63995..510e30733fed 100644 --- a/Doc/library/json.rst +++ b/Doc/library/json.rst @@ -648,7 +648,9 @@ when serializing Python :class:`int` values of extremely large magnitude, or when serializing instances of "exotic" numerical types such as :class:`decimal.Decimal`. + .. _json-commandline: +.. program:: json.tool Command Line Interface ---------------------- @@ -680,6 +682,7 @@ specified, :attr:`sys.stdin` and :attr:`sys.stdout` will be used respectively: :option:`--sort-keys` option to sort the output of dictionaries alphabetically by key. + Command line options ^^^^^^^^^^^^^^^^^^^^ From webhook-mailer at python.org Mon Nov 5 11:16:30 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Mon, 05 Nov 2018 16:16:30 -0000 Subject: [Python-checkins] [2.7] bpo-35133: Fix mistakes when concatenate string literals on different lines. (GH-10284) (GH-10335) (GH-10336) Message-ID: https://github.com/python/cpython/commit/3e3e1a27f769b3385853fbcad6749e71ca7f3ce3 commit: 3e3e1a27f769b3385853fbcad6749e71ca7f3ce3 branch: 2.7 author: Serhiy Storchaka committer: GitHub date: 2018-11-05T18:16:26+02:00 summary: [2.7] bpo-35133: Fix mistakes when concatenate string literals on different lines. (GH-10284) (GH-10335) (GH-10336) Two kind of mistakes: 1. Missed space. After concatenating there is no space between words. 2. Missed comma. Causes unintentional concatenating in a list of strings. (cherry picked from commit 34fd4c20198dea6ab2fe8dc6d32d744d9bde868d) (cherry picked from commit 7054e5c80b6e98cd44e22d1bc2d7f0a94343089d) files: M Lib/decimal.py M Lib/distutils/command/bdist_dumb.py M Lib/distutils/command/bdist_msi.py M Lib/distutils/command/bdist_rpm.py M Lib/distutils/command/bdist_wininst.py M Lib/distutils/command/build_ext.py M Lib/idlelib/HyperParser.py M Lib/idlelib/idle_test/htest.py M Lib/idlelib/idle_test/mock_tk.py M Lib/test/test_compile.py M Lib/test/test_decimal.py M Lib/test/test_strptime.py M Lib/trace.py M Python/import.c M Tools/scripts/texi2html.py diff --git a/Lib/decimal.py b/Lib/decimal.py index e5329dde4946..220fa57ac5be 100644 --- a/Lib/decimal.py +++ b/Lib/decimal.py @@ -1909,7 +1909,7 @@ def _power_modulo(self, other, modulo, context=None): if not other and not self: return context._raise_error(InvalidOperation, 'at least one of pow() 1st argument ' - 'and 2nd argument must be nonzero ;' + 'and 2nd argument must be nonzero; ' '0**0 is not defined') # compute sign of result diff --git a/Lib/distutils/command/bdist_dumb.py b/Lib/distutils/command/bdist_dumb.py index 2f3c66829a1b..d8e023dd0584 100644 --- a/Lib/distutils/command/bdist_dumb.py +++ b/Lib/distutils/command/bdist_dumb.py @@ -35,7 +35,7 @@ class bdist_dumb (Command): ('skip-build', None, "skip rebuilding everything (for testing/debugging)"), ('relative', None, - "build the archive using relative paths" + "build the archive using relative paths " "(default: false)"), ('owner=', 'u', "Owner name used when creating a tar file" diff --git a/Lib/distutils/command/bdist_msi.py b/Lib/distutils/command/bdist_msi.py index 703f873b164e..d2401bc4736a 100644 --- a/Lib/distutils/command/bdist_msi.py +++ b/Lib/distutils/command/bdist_msi.py @@ -99,14 +99,14 @@ class bdist_msi (Command): ('no-target-compile', 'c', "do not compile .py to .pyc on the target system"), ('no-target-optimize', 'o', - "do not compile .py to .pyo (optimized)" + "do not compile .py to .pyo (optimized) " "on the target system"), ('dist-dir=', 'd', "directory to put final built distributions in"), ('skip-build', None, "skip rebuilding everything (for testing/debugging)"), ('install-script=', None, - "basename of installation script to be run after" + "basename of installation script to be run after " "installation or before deinstallation"), ('pre-install-script=', None, "Fully qualified filename of a script to be run before " diff --git a/Lib/distutils/command/bdist_rpm.py b/Lib/distutils/command/bdist_rpm.py index 477e0ee064b7..caadf489a938 100644 --- a/Lib/distutils/command/bdist_rpm.py +++ b/Lib/distutils/command/bdist_rpm.py @@ -63,7 +63,7 @@ class bdist_rpm (Command): "RPM \"vendor\" (eg. \"Joe Blow \") " "[default: maintainer or author from setup script]"), ('packager=', None, - "RPM packager (eg. \"Jane Doe \")" + "RPM packager (eg. \"Jane Doe \") " "[default: vendor]"), ('doc-files=', None, "list of documentation files (space or comma-separated)"), diff --git a/Lib/distutils/command/bdist_wininst.py b/Lib/distutils/command/bdist_wininst.py index aa9383af98b6..a1de52027681 100644 --- a/Lib/distutils/command/bdist_wininst.py +++ b/Lib/distutils/command/bdist_wininst.py @@ -35,7 +35,7 @@ class bdist_wininst (Command): ('no-target-compile', 'c', "do not compile .py to .pyc on the target system"), ('no-target-optimize', 'o', - "do not compile .py to .pyo (optimized)" + "do not compile .py to .pyo (optimized) " "on the target system"), ('dist-dir=', 'd', "directory to put final built distributions in"), @@ -46,7 +46,7 @@ class bdist_wininst (Command): ('skip-build', None, "skip rebuilding everything (for testing/debugging)"), ('install-script=', None, - "basename of installation script to be run after" + "basename of installation script to be run after " "installation or before deinstallation"), ('pre-install-script=', None, "Fully qualified filename of a script to be run before " diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py index 2c68be39cdf6..86a85c1a0a01 100644 --- a/Lib/distutils/command/build_ext.py +++ b/Lib/distutils/command/build_ext.py @@ -366,7 +366,7 @@ def check_extensions_list(self, extensions): ext_name, build_info = ext log.warn(("old-style (ext_name, build_info) tuple found in " - "ext_modules for extension '%s'" + "ext_modules for extension '%s' " "-- please convert to Extension instance" % ext_name)) if not (isinstance(ext_name, str) and diff --git a/Lib/idlelib/HyperParser.py b/Lib/idlelib/HyperParser.py index 5816d00f45c8..6e45b161a46d 100644 --- a/Lib/idlelib/HyperParser.py +++ b/Lib/idlelib/HyperParser.py @@ -167,7 +167,7 @@ def get_expression(self): given index, which is empty if there is no real one. """ if not self.is_in_code(): - raise ValueError("get_expression should only be called" + raise ValueError("get_expression should only be called " "if index is inside a code.") rawtext = self.rawtext diff --git a/Lib/idlelib/idle_test/htest.py b/Lib/idlelib/idle_test/htest.py index f34140921c81..9e2ddd2c19e0 100644 --- a/Lib/idlelib/idle_test/htest.py +++ b/Lib/idlelib/idle_test/htest.py @@ -112,7 +112,7 @@ def _wrapper(parent): # htest # "font face of the text in the area below it.\nIn the " "'Highlighting' tab, try different color schemes. Clicking " "items in the sample program should update the choices above it." - "\nIn the 'Keys', 'General' and 'Extensions' tabs, test settings" + "\nIn the 'Keys', 'General' and 'Extensions' tabs, test settings " "of interest." "\n[Ok] to close the dialog.[Apply] to apply the settings and " "and [Cancel] to revert all changes.\nRe-run the test to ensure " @@ -171,7 +171,7 @@ def _wrapper(parent): # htest # 'msg': "Test for different key modifier sequences.\n" " is invalid.\n" "No modifier key is invalid.\n" - "Shift key with [a-z],[0-9], function key, move key, tab, space" + "Shift key with [a-z],[0-9], function key, move key, tab, space " "is invalid.\nNo validitity checking if advanced key binding " "entry is used." } @@ -237,7 +237,7 @@ def _wrapper(parent): # htest # 'file': 'Percolator', 'kwds': {}, 'msg': "There are two tracers which can be toggled using a checkbox.\n" - "Toggling a tracer 'on' by checking it should print tracer" + "Toggling a tracer 'on' by checking it should print tracer " "output to the console or to the IDLE shell.\n" "If both the tracers are 'on', the output from the tracer which " "was switched 'on' later, should be printed first\n" @@ -329,7 +329,7 @@ def _wrapper(parent): # htest # _widget_redirector_spec = { 'file': 'WidgetRedirector', 'kwds': {}, - 'msg': "Every text insert should be printed to the console." + 'msg': "Every text insert should be printed to the console " "or the IDLE shell." } diff --git a/Lib/idlelib/idle_test/mock_tk.py b/Lib/idlelib/idle_test/mock_tk.py index f42a039711b4..56ca87695af6 100644 --- a/Lib/idlelib/idle_test/mock_tk.py +++ b/Lib/idlelib/idle_test/mock_tk.py @@ -260,7 +260,7 @@ def compare(self, index1, op, index2): elif op == '!=': return line1 != line2 or char1 != char2 else: - raise TclError('''bad comparison operator "%s":''' + raise TclError('''bad comparison operator "%s": ''' '''must be <, <=, ==, >=, >, or !=''' % op) # The following Text methods normally do something and return None. diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index e954a0ce7461..15a00f3cf7fc 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -392,7 +392,7 @@ def test_import(self): 'from sys import stdin)', 'from sys import stdin, stdout,\nstderr', 'from sys import stdin si', - 'from sys import stdin,' + 'from sys import stdin,', 'from sys import (*)', 'from sys import (stdin,, stdout, stderr)', 'from sys import (stdin, stdout),', diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py index 14b7f42f5627..f481075cee25 100644 --- a/Lib/test/test_decimal.py +++ b/Lib/test/test_decimal.py @@ -914,10 +914,10 @@ def test_wide_char_separator_decimal_point(self): decimal_point = locale.localeconv()['decimal_point'] thousands_sep = locale.localeconv()['thousands_sep'] if decimal_point != '\xd9\xab': - self.skipTest('inappropriate decimal point separator' + self.skipTest('inappropriate decimal point separator ' '({!r} not {!r})'.format(decimal_point, '\xd9\xab')) if thousands_sep != '\xd9\xac': - self.skipTest('inappropriate thousands separator' + self.skipTest('inappropriate thousands separator ' '({!r} not {!r})'.format(thousands_sep, '\xd9\xac')) self.assertEqual(format(Decimal('100000000.123'), 'n'), diff --git a/Lib/test/test_strptime.py b/Lib/test/test_strptime.py index 3d249419517a..48ad5daec402 100644 --- a/Lib/test/test_strptime.py +++ b/Lib/test/test_strptime.py @@ -428,7 +428,7 @@ def test_gregorian_calculation(self): self.assertTrue(result.tm_year == self.time_tuple.tm_year and result.tm_mon == self.time_tuple.tm_mon and result.tm_mday == self.time_tuple.tm_mday, - "Calculation of Gregorian date failed;" + "Calculation of Gregorian date failed; " "%s-%s-%s != %s-%s-%s" % (result.tm_year, result.tm_mon, result.tm_mday, self.time_tuple.tm_year, self.time_tuple.tm_mon, @@ -440,7 +440,7 @@ def test_day_of_week_calculation(self): result = _strptime._strptime_time(time.strftime(format_string, self.time_tuple), format_string) self.assertTrue(result.tm_wday == self.time_tuple.tm_wday, - "Calculation of day of the week failed;" + "Calculation of day of the week failed; " "%s != %s" % (result.tm_wday, self.time_tuple.tm_wday)) def test_week_of_year_and_day_of_week_calculation(self): diff --git a/Lib/trace.py b/Lib/trace.py index 38a13e2a9f0f..96af2603540e 100755 --- a/Lib/trace.py +++ b/Lib/trace.py @@ -360,7 +360,7 @@ def write_results_file(self, path, lines, lnotab, lines_hit): try: outfile = open(path, "w") except IOError, err: - print >> sys.stderr, ("trace: Could not open %r for writing: %s" + print >> sys.stderr, ("trace: Could not open %r for writing: %s " "- skipping" % (path, err)) return 0, 0 diff --git a/Python/import.c b/Python/import.c index f43a47c1c472..ccbd949e624f 100644 --- a/Python/import.c +++ b/Python/import.c @@ -701,7 +701,7 @@ remove_module(const char *name) if (PyDict_GetItemString(modules, name) == NULL) return; if (PyDict_DelItemString(modules, name) < 0) - Py_FatalError("import: deleting existing key in" + Py_FatalError("import: deleting existing key in " "sys.modules failed"); } diff --git a/Tools/scripts/texi2html.py b/Tools/scripts/texi2html.py index 57db166df1e1..fbf32d608b8d 100755 --- a/Tools/scripts/texi2html.py +++ b/Tools/scripts/texi2html.py @@ -1808,7 +1808,7 @@ def finalize(self): print>>fp, '' print>>fp, '' print>>fp, '' - print>>fp, ('>fp, ('') print>>fp, '' print>>fp, '' @@ -1833,7 +1833,7 @@ def finalize(self): print>>fp, '' print>>fp, '' print>>fp, '' - print>>fp, ('>fp, ('') print>>fp, '' print>>fp, '' From webhook-mailer at python.org Mon Nov 5 11:44:13 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Mon, 05 Nov 2018 16:44:13 -0000 Subject: [Python-checkins] [3.7] bpo-35167: Specify program for json.tool command line options. (GH-10332) (GH-10338) Message-ID: https://github.com/python/cpython/commit/6ad277b2592cfac0f138e9adca4374dd1f354bdf commit: 6ad277b2592cfac0f138e9adca4374dd1f354bdf branch: 3.7 author: Serhiy Storchaka committer: GitHub date: 2018-11-05T18:44:08+02:00 summary: [3.7] bpo-35167: Specify program for json.tool command line options. (GH-10332) (GH-10338) (cherry picked from commit 083a7a172b8c8888252d72031f21dcfea3c0d73f) files: M Doc/library/json.rst diff --git a/Doc/library/json.rst b/Doc/library/json.rst index 8ce493d63995..510e30733fed 100644 --- a/Doc/library/json.rst +++ b/Doc/library/json.rst @@ -648,7 +648,9 @@ when serializing Python :class:`int` values of extremely large magnitude, or when serializing instances of "exotic" numerical types such as :class:`decimal.Decimal`. + .. _json-commandline: +.. program:: json.tool Command Line Interface ---------------------- @@ -680,6 +682,7 @@ specified, :attr:`sys.stdin` and :attr:`sys.stdout` will be used respectively: :option:`--sort-keys` option to sort the output of dictionaries alphabetically by key. + Command line options ^^^^^^^^^^^^^^^^^^^^ From webhook-mailer at python.org Mon Nov 5 12:51:42 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Mon, 05 Nov 2018 17:51:42 -0000 Subject: [Python-checkins] [3.6] bpo-35167: Specify program for json.tool command line options. (GH-10332) (GH-10338) (GH-10339) Message-ID: https://github.com/python/cpython/commit/8c5f14d9c137fbffbb9de7c62ca834df2e9fbf2a commit: 8c5f14d9c137fbffbb9de7c62ca834df2e9fbf2a branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Serhiy Storchaka date: 2018-11-05T19:51:36+02:00 summary: [3.6] bpo-35167: Specify program for json.tool command line options. (GH-10332) (GH-10338) (GH-10339) (cherry picked from commit 083a7a172b8c8888252d72031f21dcfea3c0d73f) (cherry picked from commit 6ad277b2592cfac0f138e9adca4374dd1f354bdf) files: M Doc/library/json.rst diff --git a/Doc/library/json.rst b/Doc/library/json.rst index aa9da9130308..98ca86e4b9af 100644 --- a/Doc/library/json.rst +++ b/Doc/library/json.rst @@ -652,7 +652,9 @@ when serializing Python :class:`int` values of extremely large magnitude, or when serializing instances of "exotic" numerical types such as :class:`decimal.Decimal`. + .. _json-commandline: +.. program:: json.tool Command Line Interface ---------------------- @@ -684,6 +686,7 @@ specified, :attr:`sys.stdin` and :attr:`sys.stdout` will be used respectively: :option:`--sort-keys` option to sort the output of dictionaries alphabetically by key. + Command line options ^^^^^^^^^^^^^^^^^^^^ From webhook-mailer at python.org Mon Nov 5 14:26:43 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Mon, 05 Nov 2018 19:26:43 -0000 Subject: [Python-checkins] Fix possible crashes in pwdmodule.c. (GH-10331) Message-ID: https://github.com/python/cpython/commit/570e371fd6e8615ece9b9e21fbe77149ebeb172e commit: 570e371fd6e8615ece9b9e21fbe77149ebeb172e branch: master author: Zackery Spytz committer: Serhiy Storchaka date: 2018-11-05T21:26:40+02:00 summary: Fix possible crashes in pwdmodule.c. (GH-10331) "p" was not initialized if the first PyMem_RawRealloc() call failed. files: M Modules/pwdmodule.c diff --git a/Modules/pwdmodule.c b/Modules/pwdmodule.c index 1286e7d5ce59..fd11f848b2ce 100644 --- a/Modules/pwdmodule.c +++ b/Modules/pwdmodule.c @@ -145,6 +145,7 @@ pwd_getpwuid(PyObject *module, PyObject *uidobj) while(1) { buf2 = PyMem_RawRealloc(buf, bufsize); if (buf2 == NULL) { + p = NULL; nomem = 1; break; } @@ -227,6 +228,7 @@ pwd_getpwnam_impl(PyObject *module, PyObject *name) while(1) { buf2 = PyMem_RawRealloc(buf, bufsize); if (buf2 == NULL) { + p = NULL; nomem = 1; break; } From webhook-mailer at python.org Mon Nov 5 17:41:28 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 05 Nov 2018 22:41:28 -0000 Subject: [Python-checkins] [Docs] Fix required version of an example of importlib (GH-10118) Message-ID: https://github.com/python/cpython/commit/16c8a53490a22bd4fcde2efaf4694dd06ded882b commit: 16c8a53490a22bd4fcde2efaf4694dd06ded882b branch: master author: E Kawashima committer: Victor Stinner date: 2018-11-05T23:41:17+01:00 summary: [Docs] Fix required version of an example of importlib (GH-10118) ?31.5.6.3. Importing a source file directly: `module_from_spec` is new in Python 3.5. files: M Doc/library/importlib.rst diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst index c6c7160a9d15..0bcfbb1c7263 100644 --- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -1653,7 +1653,7 @@ Importing a source file directly '''''''''''''''''''''''''''''''' To import a Python source file directly, use the following recipe -(Python 3.4 and newer only):: +(Python 3.5 and newer only):: import importlib.util import sys From webhook-mailer at python.org Mon Nov 5 17:46:46 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 05 Nov 2018 22:46:46 -0000 Subject: [Python-checkins] [Docs] Fix required version of an example of importlib (GH-10118) Message-ID: https://github.com/python/cpython/commit/91a19c923c83471f305e64ca021bee2e9171965e commit: 91a19c923c83471f305e64ca021bee2e9171965e branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-05T14:46:42-08:00 summary: [Docs] Fix required version of an example of importlib (GH-10118) ?31.5.6.3. Importing a source file directly: `module_from_spec` is new in Python 3.5. (cherry picked from commit 16c8a53490a22bd4fcde2efaf4694dd06ded882b) Co-authored-by: E Kawashima files: M Doc/library/importlib.rst diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst index c6c7160a9d15..0bcfbb1c7263 100644 --- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -1653,7 +1653,7 @@ Importing a source file directly '''''''''''''''''''''''''''''''' To import a Python source file directly, use the following recipe -(Python 3.4 and newer only):: +(Python 3.5 and newer only):: import importlib.util import sys From webhook-mailer at python.org Mon Nov 5 17:47:54 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 05 Nov 2018 22:47:54 -0000 Subject: [Python-checkins] [Docs] Fix required version of an example of importlib (GH-10118) Message-ID: https://github.com/python/cpython/commit/47a940e83b2482d17c92deebf6b7c9be8cec979d commit: 47a940e83b2482d17c92deebf6b7c9be8cec979d branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-05T14:47:51-08:00 summary: [Docs] Fix required version of an example of importlib (GH-10118) ?31.5.6.3. Importing a source file directly: `module_from_spec` is new in Python 3.5. (cherry picked from commit 16c8a53490a22bd4fcde2efaf4694dd06ded882b) Co-authored-by: E Kawashima files: M Doc/library/importlib.rst diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst index 760489ae5560..25055f7ce39c 100644 --- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -1404,7 +1404,7 @@ Importing a source file directly '''''''''''''''''''''''''''''''' To import a Python source file directly, use the following recipe -(Python 3.4 and newer only):: +(Python 3.5 and newer only):: import importlib.util import sys From webhook-mailer at python.org Mon Nov 5 19:38:58 2018 From: webhook-mailer at python.org (INADA Naoki) Date: Tue, 06 Nov 2018 00:38:58 -0000 Subject: [Python-checkins] bpo-33462: Add __reversed__ to dict and dict views (GH-6827) Message-ID: https://github.com/python/cpython/commit/6531bf6309c8fda1954060a0fb5ea930b1efb656 commit: 6531bf6309c8fda1954060a0fb5ea930b1efb656 branch: master author: R?mi Lapeyre committer: INADA Naoki date: 2018-11-06T09:38:54+09:00 summary: bpo-33462: Add __reversed__ to dict and dict views (GH-6827) files: A Misc/NEWS.d/next/Core and Builtins/2018-05-23-17-18-02.bpo-33462.gurbpbrhe.rst M Doc/library/stdtypes.rst M Doc/whatsnew/3.8.rst M Include/dictobject.h M Lib/test/test_collections.py M Lib/test/test_dict.py M Lib/test/test_enumerate.py M Objects/clinic/dictobject.c.h M Objects/dictobject.c M Objects/object.c diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 4686cec96885..49d433805a32 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -4285,6 +4285,11 @@ pairs within braces, for example: ``{'jack': 4098, 'sjoerd': 4127}`` or ``{4098: LIFO order is now guaranteed. In prior versions, :meth:`popitem` would return an arbitrary key/value pair. + .. describe:: reversed(d) + + Return a reversed iterator over the keys of the dictionary. This is a + shortcut for ``reversed(d.keys())``. + .. method:: setdefault(key[, default]) If *key* is in the dictionary, return its value. If not, insert *key* @@ -4332,6 +4337,22 @@ pairs within braces, for example: ``{'jack': 4098, 'sjoerd': 4127}`` or ``{4098: Dictionary order is guaranteed to be insertion order. This behavior was implementation detail of CPython from 3.6. + Dictionaries and dictionary views are reversible. :: + + >>> d = {"one": 1, "two": 2, "three": 3, "four": 4} + >>> d + {'one': 1, 'two': 2, 'three': 3, 'four': 4} + >>> list(reversed(d)) + ['four', 'three', 'two', 'one'] + >>> list(reversed(d.values())) + [4, 3, 2, 1] + >>> list(reversed(d.items())) + [('four', 4), ('three', 3), ('two', 2), ('one', 1)] + + .. versionchanged:: 3.8 + Dictionaries are now reversible. + + .. seealso:: :class:`types.MappingProxyType` can be used to create a read-only view of a :class:`dict`. @@ -4375,6 +4396,14 @@ support membership tests: Return ``True`` if *x* is in the underlying dictionary's keys, values or items (in the latter case, *x* should be a ``(key, value)`` tuple). +.. describe:: reversed(dictview) + + Return an reversed iterator over the keys, values or items of the dictionnary. + The view will be iterated in reverse order of the insertion. + + .. versionchanged:: 3.8 + Dictionary views are now reversible. + Keys views are set-like since their entries are unique and hashable. If all values are hashable, so that ``(key, value)`` pairs are unique and hashable, diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index 566c369c85bd..2d3a116df9d3 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -98,6 +98,9 @@ Other Language Changes * Added support of ``\N{name}`` escapes in :mod:`regular expressions `. (Contributed by Jonathan Eunice and Serhiy Storchaka in :issue:`30688`.) +* Dict and dictviews are now iterable in reversed insertion order using + :func:`reversed`. (Contributed by R?mi Lapeyre in :issue:`33462`.) + * The syntax allowed for keyword names in function calls was further restricted. In particular, ``f((keyword)=arg)`` is no longer allowed. It was never intended to permit more than a bare name on the left-hand side of a diff --git a/Include/dictobject.h b/Include/dictobject.h index 28930f436d70..c0f24df7d265 100644 --- a/Include/dictobject.h +++ b/Include/dictobject.h @@ -51,6 +51,9 @@ PyAPI_DATA(PyTypeObject) PyDict_Type; PyAPI_DATA(PyTypeObject) PyDictIterKey_Type; PyAPI_DATA(PyTypeObject) PyDictIterValue_Type; PyAPI_DATA(PyTypeObject) PyDictIterItem_Type; +PyAPI_DATA(PyTypeObject) PyDictRevIterKey_Type; +PyAPI_DATA(PyTypeObject) PyDictRevIterItem_Type; +PyAPI_DATA(PyTypeObject) PyDictRevIterValue_Type; PyAPI_DATA(PyTypeObject) PyDictKeys_Type; PyAPI_DATA(PyTypeObject) PyDictItems_Type; PyAPI_DATA(PyTypeObject) PyDictValues_Type; diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py index 0b7cb5848b1b..200e0273c33e 100644 --- a/Lib/test/test_collections.py +++ b/Lib/test/test_collections.py @@ -796,22 +796,21 @@ class ItBlocked(It): def test_Reversible(self): # Check some non-reversibles - non_samples = [None, 42, 3.14, 1j, dict(), set(), frozenset()] + non_samples = [None, 42, 3.14, 1j, set(), frozenset()] for x in non_samples: self.assertNotIsInstance(x, Reversible) self.assertFalse(issubclass(type(x), Reversible), repr(type(x))) # Check some non-reversible iterables - non_reversibles = [dict().keys(), dict().items(), dict().values(), - Counter(), Counter().keys(), Counter().items(), - Counter().values(), _test_gen(), - (x for x in []), iter([]), reversed([])] + non_reversibles = [_test_gen(), (x for x in []), iter([]), reversed([])] for x in non_reversibles: self.assertNotIsInstance(x, Reversible) self.assertFalse(issubclass(type(x), Reversible), repr(type(x))) # Check some reversible iterables samples = [bytes(), str(), tuple(), list(), OrderedDict(), OrderedDict().keys(), OrderedDict().items(), - OrderedDict().values()] + OrderedDict().values(), Counter(), Counter().keys(), + Counter().items(), Counter().values(), dict(), + dict().keys(), dict().items(), dict().values()] for x in samples: self.assertIsInstance(x, Reversible) self.assertTrue(issubclass(type(x), Reversible), repr(type(x))) @@ -1612,7 +1611,7 @@ def test_MutableMapping_subclass(self): self.assertIsInstance(z, set) list(z) mymap['blue'] = 7 # Shouldn't affect 'z' - self.assertEqual(sorted(z), [('orange', 3), ('red', 5)]) + self.assertEqual(z, {('orange', 3), ('red', 5)}) def test_Sequence(self): for sample in [tuple, list, bytes, str]: @@ -1767,10 +1766,10 @@ def test_basics(self): self.assertTrue(issubclass(Counter, Mapping)) self.assertEqual(len(c), 3) self.assertEqual(sum(c.values()), 6) - self.assertEqual(sorted(c.values()), [1, 2, 3]) - self.assertEqual(sorted(c.keys()), ['a', 'b', 'c']) - self.assertEqual(sorted(c), ['a', 'b', 'c']) - self.assertEqual(sorted(c.items()), + self.assertEqual(list(c.values()), [3, 2, 1]) + self.assertEqual(list(c.keys()), ['a', 'b', 'c']) + self.assertEqual(list(c), ['a', 'b', 'c']) + self.assertEqual(list(c.items()), [('a', 3), ('b', 2), ('c', 1)]) self.assertEqual(c['b'], 2) self.assertEqual(c['z'], 0) @@ -1784,7 +1783,7 @@ def test_basics(self): for i in range(5): self.assertEqual(c.most_common(i), [('a', 3), ('b', 2), ('c', 1)][:i]) - self.assertEqual(''.join(sorted(c.elements())), 'aaabbc') + self.assertEqual(''.join(c.elements()), 'aaabbc') c['a'] += 1 # increment an existing value c['b'] -= 2 # sub existing value to zero del c['c'] # remove an entry @@ -1793,7 +1792,7 @@ def test_basics(self): c['e'] = -5 # directly assign a missing value c['f'] += 4 # add to a missing value self.assertEqual(c, dict(a=4, b=0, d=-2, e=-5, f=4)) - self.assertEqual(''.join(sorted(c.elements())), 'aaaaffff') + self.assertEqual(''.join(c.elements()), 'aaaaffff') self.assertEqual(c.pop('f'), 4) self.assertNotIn('f', c) for i in range(3): diff --git a/Lib/test/test_dict.py b/Lib/test/test_dict.py index 90c0a3131a78..71fffe398f34 100644 --- a/Lib/test/test_dict.py +++ b/Lib/test/test_dict.py @@ -1021,7 +1021,7 @@ def test_iterator_pickling(self): it = iter(data) d = pickle.dumps(it, proto) it = pickle.loads(d) - self.assertEqual(sorted(it), sorted(data)) + self.assertEqual(list(it), list(data)) it = pickle.loads(d) try: @@ -1031,7 +1031,7 @@ def test_iterator_pickling(self): d = pickle.dumps(it, proto) it = pickle.loads(d) del data[drop] - self.assertEqual(sorted(it), sorted(data)) + self.assertEqual(list(it), list(data)) def test_itemiterator_pickling(self): for proto in range(pickle.HIGHEST_PROTOCOL + 1): @@ -1062,7 +1062,7 @@ def test_valuesiterator_pickling(self): it = iter(data.values()) d = pickle.dumps(it, proto) it = pickle.loads(d) - self.assertEqual(sorted(list(it)), sorted(list(data.values()))) + self.assertEqual(list(it), list(data.values())) it = pickle.loads(d) drop = next(it) @@ -1071,6 +1071,62 @@ def test_valuesiterator_pickling(self): values = list(it) + [drop] self.assertEqual(sorted(values), sorted(list(data.values()))) + def test_reverseiterator_pickling(self): + for proto in range(pickle.HIGHEST_PROTOCOL + 1): + data = {1:"a", 2:"b", 3:"c"} + it = reversed(data) + d = pickle.dumps(it, proto) + it = pickle.loads(d) + self.assertEqual(list(it), list(reversed(data))) + + it = pickle.loads(d) + try: + drop = next(it) + except StopIteration: + continue + d = pickle.dumps(it, proto) + it = pickle.loads(d) + del data[drop] + self.assertEqual(list(it), list(reversed(data))) + + def test_reverseitemiterator_pickling(self): + for proto in range(pickle.HIGHEST_PROTOCOL + 1): + data = {1:"a", 2:"b", 3:"c"} + # dictviews aren't picklable, only their iterators + itorg = reversed(data.items()) + d = pickle.dumps(itorg, proto) + it = pickle.loads(d) + # note that the type of the unpickled iterator + # is not necessarily the same as the original. It is + # merely an object supporting the iterator protocol, yielding + # the same objects as the original one. + # self.assertEqual(type(itorg), type(it)) + self.assertIsInstance(it, collections.abc.Iterator) + self.assertEqual(dict(it), data) + + it = pickle.loads(d) + drop = next(it) + d = pickle.dumps(it, proto) + it = pickle.loads(d) + del data[drop[0]] + self.assertEqual(dict(it), data) + + def test_reversevaluesiterator_pickling(self): + for proto in range(pickle.HIGHEST_PROTOCOL): + data = {1:"a", 2:"b", 3:"c"} + # data.values() isn't picklable, only its iterator + it = reversed(data.values()) + d = pickle.dumps(it, proto) + it = pickle.loads(d) + self.assertEqual(list(it), list(reversed(data.values()))) + + it = pickle.loads(d) + drop = next(it) + d = pickle.dumps(it, proto) + it = pickle.loads(d) + values = list(it) + [drop] + self.assertEqual(sorted(values), sorted(data.values())) + def test_instance_dict_getattr_str_subclass(self): class Foo: def __init__(self, msg): @@ -1222,6 +1278,13 @@ def iter_and_mutate(): self.assertRaises(RuntimeError, iter_and_mutate) + def test_reversed(self): + d = {"a": 1, "b": 2, "foo": 0, "c": 3, "d": 4} + del d["foo"] + r = reversed(d) + self.assertEqual(list(r), list('dcba')) + self.assertRaises(StopIteration, next, r) + def test_dict_copy_order(self): # bpo-34320 od = collections.OrderedDict([('a', 1), ('b', 2)]) diff --git a/Lib/test/test_enumerate.py b/Lib/test/test_enumerate.py index e455adee50fe..5785cb46492e 100644 --- a/Lib/test/test_enumerate.py +++ b/Lib/test/test_enumerate.py @@ -160,9 +160,9 @@ def __getitem__(self, i): raise StopIteration def __len__(self): return 5 - for data in 'abc', range(5), tuple(enumerate('abc')), A(), range(1,17,5): + for data in ('abc', range(5), tuple(enumerate('abc')), A(), + range(1,17,5), dict.fromkeys('abcde')): self.assertEqual(list(data)[::-1], list(reversed(data))) - self.assertRaises(TypeError, reversed, {}) # don't allow keyword arguments self.assertRaises(TypeError, reversed, [], a=1) diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-05-23-17-18-02.bpo-33462.gurbpbrhe.rst b/Misc/NEWS.d/next/Core and Builtins/2018-05-23-17-18-02.bpo-33462.gurbpbrhe.rst new file mode 100644 index 000000000000..ed1f0342731e --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-05-23-17-18-02.bpo-33462.gurbpbrhe.rst @@ -0,0 +1 @@ +Make dict and dict views reversible. Patch by R?mi Lapeyre. diff --git a/Objects/clinic/dictobject.c.h b/Objects/clinic/dictobject.c.h index 58677cd772bc..4f4c9fa9cb7a 100644 --- a/Objects/clinic/dictobject.c.h +++ b/Objects/clinic/dictobject.c.h @@ -103,4 +103,22 @@ dict_setdefault(PyDictObject *self, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=d7508c5091609a23 input=a9049054013a1b77]*/ + +PyDoc_STRVAR(dict___reversed____doc__, +"__reversed__($self, /)\n" +"--\n" +"\n" +"Return a reverse iterator over the dict keys."); + +#define DICT___REVERSED___METHODDEF \ + {"__reversed__", (PyCFunction)dict___reversed__, METH_NOARGS, dict___reversed____doc__}, + +static PyObject * +dict___reversed___impl(PyDictObject *self); + +static PyObject * +dict___reversed__(PyDictObject *self, PyObject *Py_UNUSED(ignored)) +{ + return dict___reversed___impl(self); +} +/*[clinic end generated code: output=b9923851cbd9213a input=a9049054013a1b77]*/ diff --git a/Objects/dictobject.c b/Objects/dictobject.c index ea564a2b7c9f..08ec9e254ab2 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -3100,6 +3100,7 @@ static PyMethodDef mapp_methods[] = { clear__doc__}, {"copy", (PyCFunction)dict_copy, METH_NOARGS, copy__doc__}, + DICT___REVERSED___METHODDEF {NULL, NULL} /* sentinel */ }; @@ -3335,22 +3336,32 @@ dictiter_new(PyDictObject *dict, PyTypeObject *itertype) { dictiterobject *di; di = PyObject_GC_New(dictiterobject, itertype); - if (di == NULL) + if (di == NULL) { return NULL; + } Py_INCREF(dict); di->di_dict = dict; di->di_used = dict->ma_used; - di->di_pos = 0; di->len = dict->ma_used; - if (itertype == &PyDictIterItem_Type) { + if ((itertype == &PyDictRevIterKey_Type || + itertype == &PyDictRevIterItem_Type || + itertype == &PyDictRevIterValue_Type) && dict->ma_used) { + di->di_pos = dict->ma_keys->dk_nentries - 1; + } + else { + di->di_pos = 0; + } + if (itertype == &PyDictIterItem_Type || + itertype == &PyDictRevIterItem_Type) { di->di_result = PyTuple_Pack(2, Py_None, Py_None); if (di->di_result == NULL) { Py_DECREF(di); return NULL; } } - else + else { di->di_result = NULL; + } _PyObject_GC_TRACK(di); return (PyObject *)di; } @@ -3664,6 +3675,120 @@ PyTypeObject PyDictIterItem_Type = { }; +/* dictreviter */ + +static PyObject * +dictreviter_iternext(dictiterobject *di) +{ + PyDictObject *d = di->di_dict; + + if (d == NULL) { + return NULL; + } + assert (PyDict_Check(d)); + + if (di->di_used != d->ma_used) { + PyErr_SetString(PyExc_RuntimeError, + "dictionary changed size during iteration"); + di->di_used = -1; /* Make this state sticky */ + return NULL; + } + + Py_ssize_t i = di->di_pos; + PyDictKeysObject *k = d->ma_keys; + PyObject *key, *value, *result; + + if (d->ma_values) { + if (i < 0) { + goto fail; + } + key = DK_ENTRIES(k)[i].me_key; + value = d->ma_values[i]; + assert (value != NULL); + } + else { + PyDictKeyEntry *entry_ptr = &DK_ENTRIES(k)[i]; + while (i >= 0 && entry_ptr->me_value == NULL) { + entry_ptr--; + i--; + } + if (i < 0) { + goto fail; + } + key = entry_ptr->me_key; + value = entry_ptr->me_value; + } + di->di_pos = i-1; + di->len--; + + if (Py_TYPE(di) == &PyDictRevIterKey_Type) { + Py_INCREF(key); + return key; + } + else if (Py_TYPE(di) == &PyDictRevIterValue_Type) { + Py_INCREF(value); + return value; + } + else if (Py_TYPE(di) == &PyDictRevIterItem_Type) { + Py_INCREF(key); + Py_INCREF(value); + result = di->di_result; + if (Py_REFCNT(result) == 1) { + PyObject *oldkey = PyTuple_GET_ITEM(result, 0); + PyObject *oldvalue = PyTuple_GET_ITEM(result, 1); + PyTuple_SET_ITEM(result, 0, key); /* steals reference */ + PyTuple_SET_ITEM(result, 1, value); /* steals reference */ + Py_INCREF(result); + Py_DECREF(oldkey); + Py_DECREF(oldvalue); + } + else { + result = PyTuple_New(2); + if (result == NULL) { + return NULL; + } + PyTuple_SET_ITEM(result, 0, key); /* steals reference */ + PyTuple_SET_ITEM(result, 1, value); /* steals reference */ + } + return result; + } + else { + Py_UNREACHABLE(); + } + +fail: + di->di_dict = NULL; + Py_DECREF(d); + return NULL; +} + +PyTypeObject PyDictRevIterKey_Type = { + PyVarObject_HEAD_INIT(&PyType_Type, 0) + "dict_reversekeyiterator", + sizeof(dictiterobject), + .tp_dealloc = (destructor)dictiter_dealloc, + .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + .tp_traverse = (traverseproc)dictiter_traverse, + .tp_iter = PyObject_SelfIter, + .tp_iternext = (iternextfunc)dictreviter_iternext, + .tp_methods = dictiter_methods +}; + + +/*[clinic input] +dict.__reversed__ + +Return a reverse iterator over the dict keys. +[clinic start generated code]*/ + +static PyObject * +dict___reversed___impl(PyDictObject *self) +/*[clinic end generated code: output=e674483336d1ed51 input=23210ef3477d8c4d]*/ +{ + assert (PyDict_Check(self)); + return dictiter_new(self, &PyDictRevIterKey_Type); +} + static PyObject * dictiter_reduce(dictiterobject *di, PyObject *Py_UNUSED(ignored)) { @@ -3671,7 +3796,6 @@ dictiter_reduce(dictiterobject *di, PyObject *Py_UNUSED(ignored)) dictiterobject tmp = *di; Py_XINCREF(tmp.di_dict); - /* iterate the temporary into a list */ PyObject *list = PySequence_List((PyObject*)&tmp); Py_XDECREF(tmp.di_dict); if (list == NULL) { @@ -3680,6 +3804,30 @@ dictiter_reduce(dictiterobject *di, PyObject *Py_UNUSED(ignored)) return Py_BuildValue("N(N)", _PyObject_GetBuiltin("iter"), list); } +PyTypeObject PyDictRevIterItem_Type = { + PyVarObject_HEAD_INIT(&PyType_Type, 0) + "dict_reverseitemiterator", + sizeof(dictiterobject), + .tp_dealloc = (destructor)dictiter_dealloc, + .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + .tp_traverse = (traverseproc)dictiter_traverse, + .tp_iter = PyObject_SelfIter, + .tp_iternext = (iternextfunc)dictreviter_iternext, + .tp_methods = dictiter_methods +}; + +PyTypeObject PyDictRevIterValue_Type = { + PyVarObject_HEAD_INIT(&PyType_Type, 0) + "dict_reversevalueiterator", + sizeof(dictiterobject), + .tp_dealloc = (destructor)dictiter_dealloc, + .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + .tp_traverse = (traverseproc)dictiter_traverse, + .tp_iter = PyObject_SelfIter, + .tp_iternext = (iternextfunc)dictreviter_iternext, + .tp_methods = dictiter_methods +}; + /***********************************************/ /* View objects for keys(), items(), values(). */ /***********************************************/ @@ -4035,9 +4183,16 @@ dictviews_isdisjoint(PyObject *self, PyObject *other) PyDoc_STRVAR(isdisjoint_doc, "Return True if the view and the given iterable have a null intersection."); +static PyObject* dictkeys_reversed(_PyDictViewObject *dv); + +PyDoc_STRVAR(reversed_keys_doc, +"Return a reverse iterator over the dict keys."); + static PyMethodDef dictkeys_methods[] = { {"isdisjoint", (PyCFunction)dictviews_isdisjoint, METH_O, isdisjoint_doc}, + {"__reversed__", (PyCFunction)dictkeys_reversed, METH_NOARGS, + reversed_keys_doc}, {NULL, NULL} /* sentinel */ }; @@ -4080,6 +4235,15 @@ dictkeys_new(PyObject *dict, PyObject *Py_UNUSED(ignored)) return _PyDictView_New(dict, &PyDictKeys_Type); } +static PyObject * +dictkeys_reversed(_PyDictViewObject *dv) +{ + if (dv->dv_dict == NULL) { + Py_RETURN_NONE; + } + return dictiter_new(dv->dv_dict, &PyDictRevIterKey_Type); +} + /*** dict_items ***/ static PyObject * @@ -4125,9 +4289,16 @@ static PySequenceMethods dictitems_as_sequence = { (objobjproc)dictitems_contains, /* sq_contains */ }; +static PyObject* dictitems_reversed(_PyDictViewObject *dv); + +PyDoc_STRVAR(reversed_items_doc, +"Return a reverse iterator over the dict items."); + static PyMethodDef dictitems_methods[] = { {"isdisjoint", (PyCFunction)dictviews_isdisjoint, METH_O, isdisjoint_doc}, + {"__reversed__", (PyCFunction)dictitems_reversed, METH_NOARGS, + reversed_items_doc}, {NULL, NULL} /* sentinel */ }; @@ -4170,6 +4341,15 @@ dictitems_new(PyObject *dict, PyObject *Py_UNUSED(ignored)) return _PyDictView_New(dict, &PyDictItems_Type); } +static PyObject * +dictitems_reversed(_PyDictViewObject *dv) +{ + if (dv->dv_dict == NULL) { + Py_RETURN_NONE; + } + return dictiter_new(dv->dv_dict, &PyDictRevIterItem_Type); +} + /*** dict_values ***/ static PyObject * @@ -4192,7 +4372,14 @@ static PySequenceMethods dictvalues_as_sequence = { (objobjproc)0, /* sq_contains */ }; +static PyObject* dictvalues_reversed(_PyDictViewObject *dv); + +PyDoc_STRVAR(reversed_values_doc, +"Return a reverse iterator over the dict values."); + static PyMethodDef dictvalues_methods[] = { + {"__reversed__", (PyCFunction)dictvalues_reversed, METH_NOARGS, + reversed_values_doc}, {NULL, NULL} /* sentinel */ }; @@ -4235,6 +4422,16 @@ dictvalues_new(PyObject *dict, PyObject *Py_UNUSED(ignored)) return _PyDictView_New(dict, &PyDictValues_Type); } +static PyObject * +dictvalues_reversed(_PyDictViewObject *dv) +{ + if (dv->dv_dict == NULL) { + Py_RETURN_NONE; + } + return dictiter_new(dv->dv_dict, &PyDictRevIterValue_Type); +} + + /* Returns NULL if cannot allocate a new PyDictKeysObject, but does not set an error */ PyDictKeysObject * diff --git a/Objects/object.c b/Objects/object.c index d3a97f6c5bd4..72e2684820ce 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -1790,6 +1790,15 @@ _Py_ReadyTypes(void) if (PyType_Ready(&PyDictItems_Type) < 0) Py_FatalError("Can't initialize dict items type"); + if (PyType_Ready(&PyDictRevIterKey_Type) < 0) + Py_FatalError("Can't initialize reversed dict keys type"); + + if (PyType_Ready(&PyDictRevIterValue_Type) < 0) + Py_FatalError("Can't initialize reversed dict values type"); + + if (PyType_Ready(&PyDictRevIterItem_Type) < 0) + Py_FatalError("Can't initialize reversed dict items type"); + if (PyType_Ready(&PyODict_Type) < 0) Py_FatalError("Can't initialize OrderedDict type"); From webhook-mailer at python.org Mon Nov 5 20:53:26 2018 From: webhook-mailer at python.org (Ivan Levkivskyi) Date: Tue, 06 Nov 2018 01:53:26 -0000 Subject: [Python-checkins] bpo-35119: Fix RecursionError in example of customizing module attribute access. (GH-10323) Message-ID: https://github.com/python/cpython/commit/0bee3c36d406e47fa9f99cfc1e07b701512c4f3f commit: 0bee3c36d406e47fa9f99cfc1e07b701512c4f3f branch: master author: Denis Osipov committer: Ivan Levkivskyi date: 2018-11-06T01:53:21Z summary: bpo-35119: Fix RecursionError in example of customizing module attribute access. (GH-10323) https://bugs.python.org/issue35119 files: M Doc/reference/datamodel.rst diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 6067c7252682..24c647d1a8d2 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -1580,7 +1580,7 @@ a module object to a subclass of :class:`types.ModuleType`. For example:: def __setattr__(self, attr, value): print(f'Setting {attr}...') - setattr(self, attr, value) + super().__setattr__(attr, value) sys.modules[__name__].__class__ = VerboseModule From webhook-mailer at python.org Mon Nov 5 20:59:19 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 06 Nov 2018 01:59:19 -0000 Subject: [Python-checkins] bpo-35119: Fix RecursionError in example of customizing module attribute access. (GH-10323) Message-ID: https://github.com/python/cpython/commit/558dc8adbec0b85e0ff257fcedc85c5d89cd2825 commit: 558dc8adbec0b85e0ff257fcedc85c5d89cd2825 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-05T17:59:15-08:00 summary: bpo-35119: Fix RecursionError in example of customizing module attribute access. (GH-10323) https://bugs.python.org/issue35119 (cherry picked from commit 0bee3c36d406e47fa9f99cfc1e07b701512c4f3f) Co-authored-by: Denis Osipov files: M Doc/reference/datamodel.rst diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 2012d7abc23f..be9b3ad1af69 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -1580,7 +1580,7 @@ a module object to a subclass of :class:`types.ModuleType`. For example:: def __setattr__(self, attr, value): print(f'Setting {attr}...') - setattr(self, attr, value) + super().__setattr__(attr, value) sys.modules[__name__].__class__ = VerboseModule From webhook-mailer at python.org Mon Nov 5 21:30:37 2018 From: webhook-mailer at python.org (Terry Jan Reedy) Date: Tue, 06 Nov 2018 02:30:37 -0000 Subject: [Python-checkins] bpo-35099: Improve the doc about IDLE running user code. (#10350) Message-ID: https://github.com/python/cpython/commit/5e7909032491cef17754a3208872655fe350e9be commit: 5e7909032491cef17754a3208872655fe350e9be branch: master author: Terry Jan Reedy committer: GitHub date: 2018-11-05T21:30:32-05:00 summary: bpo-35099: Improve the doc about IDLE running user code. (#10350) The section is renamed from "IDLE -- console differences". It mostly covers the implications of using custom sys.stdxxx objects. files: A Misc/NEWS.d/next/IDLE/2018-11-05-20-43-08.bpo-35099.SVOZXC.rst M Doc/library/idle.rst diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst index 645bd612618b..c5015bf30cfb 100644 --- a/Doc/library/idle.rst +++ b/Doc/library/idle.rst @@ -563,7 +563,6 @@ looked for in the user's home directory. Statements in this file will be executed in the Tk namespace, so this file is not useful for importing functions to be used from IDLE's Python shell. - Command line usage ^^^^^^^^^^^^^^^^^^ @@ -591,7 +590,6 @@ If there are arguments: * Otherwise, arguments are files opened for editing and ``sys.argv`` reflects the arguments passed to IDLE itself. - Startup failure ^^^^^^^^^^^^^^^ @@ -635,27 +633,38 @@ be to delete one or more of the configuration files. If IDLE quits with no message, and it was not started from a console, try starting from a console (``python -m idlelib)`` and see if a message appears. - -IDLE-console differences -^^^^^^^^^^^^^^^^^^^^^^^^ +Running user code +^^^^^^^^^^^^^^^^^ With rare exceptions, the result of executing Python code with IDLE is -intended to be the same as executing the same code in a console window. +intended to be the same as executing the same code by the default method, +directly with Python in a text-mode system console or terminal window. However, the different interface and operation occasionally affect -visible results. For instance, ``sys.modules`` starts with more entries. +visible results. For instance, ``sys.modules`` starts with more entries, +and ``threading.activeCount()`` returns 2 instead of 1. + +By default, IDLE runs user code in a separate OS process rather than in +the user interface process that runs the shell and editor. In the execution +process, it replaces ``sys.stdin``, ``sys.stdout``, and ``sys.stderr`` +with objects that get input from and send output to the Shell window. +The original values stored in ``sys.__stdin__``, ``sys.__stdout__``, and +``sys.__stderr__`` are not touched, but may be ``None``. -IDLE also replaces ``sys.stdin``, ``sys.stdout``, and ``sys.stderr`` with -objects that get input from and send output to the Shell window. When Shell has the focus, it controls the keyboard and screen. This is normally transparent, but functions that directly access the keyboard -and screen will not work. If ``sys`` is reset with ``importlib.reload(sys)``, -IDLE's changes are lost and things like ``input``, ``raw_input``, and -``print`` will not work correctly. - -With IDLE's Shell, one enters, edits, and recalls complete statements. -Some consoles only work with a single physical line at a time. IDLE uses -``exec`` to run each statement. As a result, ``'__builtins__'`` is always -defined for each statement. +and screen will not work. These include system-specific functions that +determine whether a key has been pressed and if so, which. + +IDLE's standard stream replacements are not inherited by subprocesses +created in the execution process, whether directly by user code or by modules +such as multiprocessing. If such subprocess use ``input`` from sys.stdin +or ``print`` or ``write`` to sys.stdout or sys.stderr, +IDLE should be started in a command line window. The secondary subprocess +will then be attached to that window for input and output. + +If ``sys`` is reset by user code, such as with ``importlib.reload(sys)``, +IDLE's changes are lost and input from the keyboard and output to the screen +will not work correctly. Developing tkinter applications ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/Misc/NEWS.d/next/IDLE/2018-11-05-20-43-08.bpo-35099.SVOZXC.rst b/Misc/NEWS.d/next/IDLE/2018-11-05-20-43-08.bpo-35099.SVOZXC.rst new file mode 100644 index 000000000000..1459f20cb78f --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2018-11-05-20-43-08.bpo-35099.SVOZXC.rst @@ -0,0 +1,3 @@ +Improve the doc about IDLE running user code. The section is renamed from +"IDLE -- console differences" is renamed "Running user code". +It mostly covers the implications of using custom sys.stdxxx objects. From webhook-mailer at python.org Mon Nov 5 21:35:23 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 06 Nov 2018 02:35:23 -0000 Subject: [Python-checkins] bpo-35099: Improve the doc about IDLE running user code. (GH-10350) Message-ID: https://github.com/python/cpython/commit/a437c285fa4f21720802e7a91770b2281d576554 commit: a437c285fa4f21720802e7a91770b2281d576554 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-05T18:35:18-08:00 summary: bpo-35099: Improve the doc about IDLE running user code. (GH-10350) The section is renamed from "IDLE -- console differences". It mostly covers the implications of using custom sys.stdxxx objects. (cherry picked from commit 5e7909032491cef17754a3208872655fe350e9be) Co-authored-by: Terry Jan Reedy files: A Misc/NEWS.d/next/IDLE/2018-11-05-20-43-08.bpo-35099.SVOZXC.rst M Doc/library/idle.rst diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst index 645bd612618b..c5015bf30cfb 100644 --- a/Doc/library/idle.rst +++ b/Doc/library/idle.rst @@ -563,7 +563,6 @@ looked for in the user's home directory. Statements in this file will be executed in the Tk namespace, so this file is not useful for importing functions to be used from IDLE's Python shell. - Command line usage ^^^^^^^^^^^^^^^^^^ @@ -591,7 +590,6 @@ If there are arguments: * Otherwise, arguments are files opened for editing and ``sys.argv`` reflects the arguments passed to IDLE itself. - Startup failure ^^^^^^^^^^^^^^^ @@ -635,27 +633,38 @@ be to delete one or more of the configuration files. If IDLE quits with no message, and it was not started from a console, try starting from a console (``python -m idlelib)`` and see if a message appears. - -IDLE-console differences -^^^^^^^^^^^^^^^^^^^^^^^^ +Running user code +^^^^^^^^^^^^^^^^^ With rare exceptions, the result of executing Python code with IDLE is -intended to be the same as executing the same code in a console window. +intended to be the same as executing the same code by the default method, +directly with Python in a text-mode system console or terminal window. However, the different interface and operation occasionally affect -visible results. For instance, ``sys.modules`` starts with more entries. +visible results. For instance, ``sys.modules`` starts with more entries, +and ``threading.activeCount()`` returns 2 instead of 1. + +By default, IDLE runs user code in a separate OS process rather than in +the user interface process that runs the shell and editor. In the execution +process, it replaces ``sys.stdin``, ``sys.stdout``, and ``sys.stderr`` +with objects that get input from and send output to the Shell window. +The original values stored in ``sys.__stdin__``, ``sys.__stdout__``, and +``sys.__stderr__`` are not touched, but may be ``None``. -IDLE also replaces ``sys.stdin``, ``sys.stdout``, and ``sys.stderr`` with -objects that get input from and send output to the Shell window. When Shell has the focus, it controls the keyboard and screen. This is normally transparent, but functions that directly access the keyboard -and screen will not work. If ``sys`` is reset with ``importlib.reload(sys)``, -IDLE's changes are lost and things like ``input``, ``raw_input``, and -``print`` will not work correctly. - -With IDLE's Shell, one enters, edits, and recalls complete statements. -Some consoles only work with a single physical line at a time. IDLE uses -``exec`` to run each statement. As a result, ``'__builtins__'`` is always -defined for each statement. +and screen will not work. These include system-specific functions that +determine whether a key has been pressed and if so, which. + +IDLE's standard stream replacements are not inherited by subprocesses +created in the execution process, whether directly by user code or by modules +such as multiprocessing. If such subprocess use ``input`` from sys.stdin +or ``print`` or ``write`` to sys.stdout or sys.stderr, +IDLE should be started in a command line window. The secondary subprocess +will then be attached to that window for input and output. + +If ``sys`` is reset by user code, such as with ``importlib.reload(sys)``, +IDLE's changes are lost and input from the keyboard and output to the screen +will not work correctly. Developing tkinter applications ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/Misc/NEWS.d/next/IDLE/2018-11-05-20-43-08.bpo-35099.SVOZXC.rst b/Misc/NEWS.d/next/IDLE/2018-11-05-20-43-08.bpo-35099.SVOZXC.rst new file mode 100644 index 000000000000..1459f20cb78f --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2018-11-05-20-43-08.bpo-35099.SVOZXC.rst @@ -0,0 +1,3 @@ +Improve the doc about IDLE running user code. The section is renamed from +"IDLE -- console differences" is renamed "Running user code". +It mostly covers the implications of using custom sys.stdxxx objects. From webhook-mailer at python.org Mon Nov 5 21:35:54 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 06 Nov 2018 02:35:54 -0000 Subject: [Python-checkins] bpo-35099: Improve the doc about IDLE running user code. (GH-10350) Message-ID: https://github.com/python/cpython/commit/927a113ae2be33a9dd929569930f28948aa5c965 commit: 927a113ae2be33a9dd929569930f28948aa5c965 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-05T18:35:51-08:00 summary: bpo-35099: Improve the doc about IDLE running user code. (GH-10350) The section is renamed from "IDLE -- console differences". It mostly covers the implications of using custom sys.stdxxx objects. (cherry picked from commit 5e7909032491cef17754a3208872655fe350e9be) Co-authored-by: Terry Jan Reedy files: A Misc/NEWS.d/next/IDLE/2018-11-05-20-43-08.bpo-35099.SVOZXC.rst M Doc/library/idle.rst diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst index 0826d99b6336..a4432190bbb0 100644 --- a/Doc/library/idle.rst +++ b/Doc/library/idle.rst @@ -563,7 +563,6 @@ looked for in the user's home directory. Statements in this file will be executed in the Tk namespace, so this file is not useful for importing functions to be used from IDLE's Python shell. - Command line usage ^^^^^^^^^^^^^^^^^^ @@ -591,7 +590,6 @@ If there are arguments: * Otherwise, arguments are files opened for editing and ``sys.argv`` reflects the arguments passed to IDLE itself. - Startup failure ^^^^^^^^^^^^^^^ @@ -635,27 +633,38 @@ be to delete one or more of the configuration files. If IDLE quits with no message, and it was not started from a console, try starting from a console (``python -m idlelib)`` and see if a message appears. - -IDLE-console differences -^^^^^^^^^^^^^^^^^^^^^^^^ +Running user code +^^^^^^^^^^^^^^^^^ With rare exceptions, the result of executing Python code with IDLE is -intended to be the same as executing the same code in a console window. +intended to be the same as executing the same code by the default method, +directly with Python in a text-mode system console or terminal window. However, the different interface and operation occasionally affect -visible results. For instance, ``sys.modules`` starts with more entries. +visible results. For instance, ``sys.modules`` starts with more entries, +and ``threading.activeCount()`` returns 2 instead of 1. + +By default, IDLE runs user code in a separate OS process rather than in +the user interface process that runs the shell and editor. In the execution +process, it replaces ``sys.stdin``, ``sys.stdout``, and ``sys.stderr`` +with objects that get input from and send output to the Shell window. +The original values stored in ``sys.__stdin__``, ``sys.__stdout__``, and +``sys.__stderr__`` are not touched, but may be ``None``. -IDLE also replaces ``sys.stdin``, ``sys.stdout``, and ``sys.stderr`` with -objects that get input from and send output to the Shell window. When Shell has the focus, it controls the keyboard and screen. This is normally transparent, but functions that directly access the keyboard -and screen will not work. If ``sys`` is reset with ``importlib.reload(sys)``, -IDLE's changes are lost and things like ``input``, ``raw_input``, and -``print`` will not work correctly. - -With IDLE's Shell, one enters, edits, and recalls complete statements. -Some consoles only work with a single physical line at a time. IDLE uses -``exec`` to run each statement. As a result, ``'__builtins__'`` is always -defined for each statement. +and screen will not work. These include system-specific functions that +determine whether a key has been pressed and if so, which. + +IDLE's standard stream replacements are not inherited by subprocesses +created in the execution process, whether directly by user code or by modules +such as multiprocessing. If such subprocess use ``input`` from sys.stdin +or ``print`` or ``write`` to sys.stdout or sys.stderr, +IDLE should be started in a command line window. The secondary subprocess +will then be attached to that window for input and output. + +If ``sys`` is reset by user code, such as with ``importlib.reload(sys)``, +IDLE's changes are lost and input from the keyboard and output to the screen +will not work correctly. Developing tkinter applications ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/Misc/NEWS.d/next/IDLE/2018-11-05-20-43-08.bpo-35099.SVOZXC.rst b/Misc/NEWS.d/next/IDLE/2018-11-05-20-43-08.bpo-35099.SVOZXC.rst new file mode 100644 index 000000000000..1459f20cb78f --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2018-11-05-20-43-08.bpo-35099.SVOZXC.rst @@ -0,0 +1,3 @@ +Improve the doc about IDLE running user code. The section is renamed from +"IDLE -- console differences" is renamed "Running user code". +It mostly covers the implications of using custom sys.stdxxx objects. From webhook-mailer at python.org Mon Nov 5 22:18:01 2018 From: webhook-mailer at python.org (Terry Jan Reedy) Date: Tue, 06 Nov 2018 03:18:01 -0000 Subject: [Python-checkins] bpo-35099: Update idlelib/help.html (#10353) Message-ID: https://github.com/python/cpython/commit/f1d3efc2fba704692d539acc3cb0376a1dd9d98f commit: f1d3efc2fba704692d539acc3cb0376a1dd9d98f branch: master author: Terry Jan Reedy committer: GitHub date: 2018-11-05T22:17:57-05:00 summary: bpo-35099: Update idlelib/help.html (#10353) (This should have been done with the first PR for this issue.) files: M Lib/idlelib/help.html diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html index 24fd77da904e..1cd9b6913de8 100644 --- a/Lib/idlelib/help.html +++ b/Lib/idlelib/help.html @@ -616,23 +616,33 @@

    Startup failurepython -m idlelib) and see if a message appears.

    -
    -

    IDLE-console differences?

    +
    +

    Running user code?

    With rare exceptions, the result of executing Python code with IDLE is -intended to be the same as executing the same code in a console window. +intended to be the same as executing the same code by the default method, +directly with Python in a text-mode system console or terminal window. However, the different interface and operation occasionally affect -visible results. For instance, sys.modules starts with more entries.

    -

    IDLE also replaces sys.stdin, sys.stdout, and sys.stderr with -objects that get input from and send output to the Shell window. -When Shell has the focus, it controls the keyboard and screen. This is +visible results. For instance, sys.modules starts with more entries, +and threading.activeCount() returns 2 instead of 1.

    +

    By default, IDLE runs user code in a separate OS process rather than in +the user interface process that runs the shell and editor. In the execution +process, it replaces sys.stdin, sys.stdout, and sys.stderr +with objects that get input from and send output to the Shell window. +The original values stored in sys.__stdin__, sys.__stdout__, and +sys.__stderr__ are not touched, but may be None.

    +

    When Shell has the focus, it controls the keyboard and screen. This is normally transparent, but functions that directly access the keyboard -and screen will not work. If sys is reset with importlib.reload(sys), -IDLE?s changes are lost and things like input, raw_input, and -print will not work correctly.

    -

    With IDLE?s Shell, one enters, edits, and recalls complete statements. -Some consoles only work with a single physical line at a time. IDLE uses -exec to run each statement. As a result, '__builtins__' is always -defined for each statement.

    +and screen will not work. These include system-specific functions that +determine whether a key has been pressed and if so, which.

    +

    IDLE?s standard stream replacements are not inherited by subprocesses +created in the execution process, whether directly by user code or by modules +such as multiprocessing. If such subprocess use input from sys.stdin +or print or write to sys.stdout or sys.stderr, +IDLE should be started in a command line window. The secondary subprocess +will then be attached to that window for input and output.

    +

    If sys is reset by user code, such as with importlib.reload(sys), +IDLE?s changes are lost and input from the keyboard and output to the screen +will not work correctly.

    Developing tkinter applications?

    @@ -752,7 +762,7 @@

    Table of Contents

  • Startup and code execution @@ -841,7 +851,7 @@

    Navigation



    - Last updated on Oct 28, 2018. + Last updated on Nov 05, 2018. Found a bug?
    From webhook-mailer at python.org Mon Nov 5 22:36:18 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 06 Nov 2018 03:36:18 -0000 Subject: [Python-checkins] bpo-35099: Update idlelib/help.html (GH-10353) Message-ID: https://github.com/python/cpython/commit/4a46295a95bc2e7a93bcf0ce4cdaeeeb48729069 commit: 4a46295a95bc2e7a93bcf0ce4cdaeeeb48729069 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-05T19:36:12-08:00 summary: bpo-35099: Update idlelib/help.html (GH-10353) (This should have been done with the first PR for this issue.) (cherry picked from commit f1d3efc2fba704692d539acc3cb0376a1dd9d98f) Co-authored-by: Terry Jan Reedy files: M Lib/idlelib/help.html diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html index 24fd77da904e..1cd9b6913de8 100644 --- a/Lib/idlelib/help.html +++ b/Lib/idlelib/help.html @@ -616,23 +616,33 @@

    Startup failurepython -m idlelib) and see if a message appears.

  • -
    -

    IDLE-console differences?

    +
    +

    Running user code?

    With rare exceptions, the result of executing Python code with IDLE is -intended to be the same as executing the same code in a console window. +intended to be the same as executing the same code by the default method, +directly with Python in a text-mode system console or terminal window. However, the different interface and operation occasionally affect -visible results. For instance, sys.modules starts with more entries.

    -

    IDLE also replaces sys.stdin, sys.stdout, and sys.stderr with -objects that get input from and send output to the Shell window. -When Shell has the focus, it controls the keyboard and screen. This is +visible results. For instance, sys.modules starts with more entries, +and threading.activeCount() returns 2 instead of 1.

    +

    By default, IDLE runs user code in a separate OS process rather than in +the user interface process that runs the shell and editor. In the execution +process, it replaces sys.stdin, sys.stdout, and sys.stderr +with objects that get input from and send output to the Shell window. +The original values stored in sys.__stdin__, sys.__stdout__, and +sys.__stderr__ are not touched, but may be None.

    +

    When Shell has the focus, it controls the keyboard and screen. This is normally transparent, but functions that directly access the keyboard -and screen will not work. If sys is reset with importlib.reload(sys), -IDLE?s changes are lost and things like input, raw_input, and -print will not work correctly.

    -

    With IDLE?s Shell, one enters, edits, and recalls complete statements. -Some consoles only work with a single physical line at a time. IDLE uses -exec to run each statement. As a result, '__builtins__' is always -defined for each statement.

    +and screen will not work. These include system-specific functions that +determine whether a key has been pressed and if so, which.

    +

    IDLE?s standard stream replacements are not inherited by subprocesses +created in the execution process, whether directly by user code or by modules +such as multiprocessing. If such subprocess use input from sys.stdin +or print or write to sys.stdout or sys.stderr, +IDLE should be started in a command line window. The secondary subprocess +will then be attached to that window for input and output.

    +

    If sys is reset by user code, such as with importlib.reload(sys), +IDLE?s changes are lost and input from the keyboard and output to the screen +will not work correctly.

    Developing tkinter applications?

    @@ -752,7 +762,7 @@

    Table of Contents

  • Startup and code execution @@ -841,7 +851,7 @@

    Navigation



    - Last updated on Oct 28, 2018. + Last updated on Nov 05, 2018. Found a bug?
    From webhook-mailer at python.org Mon Nov 5 22:39:58 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 06 Nov 2018 03:39:58 -0000 Subject: [Python-checkins] bpo-35099: Update idlelib/help.html (GH-10353) Message-ID: https://github.com/python/cpython/commit/54bcb6c0f185be29b2a626d2f1430c110c823a7d commit: 54bcb6c0f185be29b2a626d2f1430c110c823a7d branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-05T19:39:53-08:00 summary: bpo-35099: Update idlelib/help.html (GH-10353) (This should have been done with the first PR for this issue.) (cherry picked from commit f1d3efc2fba704692d539acc3cb0376a1dd9d98f) Co-authored-by: Terry Jan Reedy files: M Lib/idlelib/help.html diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html index 24fd77da904e..1cd9b6913de8 100644 --- a/Lib/idlelib/help.html +++ b/Lib/idlelib/help.html @@ -616,23 +616,33 @@

    Startup failurepython -m idlelib) and see if a message appears.

  • -
    -

    IDLE-console differences?

    +
    +

    Running user code?

    With rare exceptions, the result of executing Python code with IDLE is -intended to be the same as executing the same code in a console window. +intended to be the same as executing the same code by the default method, +directly with Python in a text-mode system console or terminal window. However, the different interface and operation occasionally affect -visible results. For instance, sys.modules starts with more entries.

    -

    IDLE also replaces sys.stdin, sys.stdout, and sys.stderr with -objects that get input from and send output to the Shell window. -When Shell has the focus, it controls the keyboard and screen. This is +visible results. For instance, sys.modules starts with more entries, +and threading.activeCount() returns 2 instead of 1.

    +

    By default, IDLE runs user code in a separate OS process rather than in +the user interface process that runs the shell and editor. In the execution +process, it replaces sys.stdin, sys.stdout, and sys.stderr +with objects that get input from and send output to the Shell window. +The original values stored in sys.__stdin__, sys.__stdout__, and +sys.__stderr__ are not touched, but may be None.

    +

    When Shell has the focus, it controls the keyboard and screen. This is normally transparent, but functions that directly access the keyboard -and screen will not work. If sys is reset with importlib.reload(sys), -IDLE?s changes are lost and things like input, raw_input, and -print will not work correctly.

    -

    With IDLE?s Shell, one enters, edits, and recalls complete statements. -Some consoles only work with a single physical line at a time. IDLE uses -exec to run each statement. As a result, '__builtins__' is always -defined for each statement.

    +and screen will not work. These include system-specific functions that +determine whether a key has been pressed and if so, which.

    +

    IDLE?s standard stream replacements are not inherited by subprocesses +created in the execution process, whether directly by user code or by modules +such as multiprocessing. If such subprocess use input from sys.stdin +or print or write to sys.stdout or sys.stderr, +IDLE should be started in a command line window. The secondary subprocess +will then be attached to that window for input and output.

    +

    If sys is reset by user code, such as with importlib.reload(sys), +IDLE?s changes are lost and input from the keyboard and output to the screen +will not work correctly.

    Developing tkinter applications?

    @@ -752,7 +762,7 @@

    Table of Contents

  • Startup and code execution @@ -841,7 +851,7 @@

    Navigation



    - Last updated on Oct 28, 2018. + Last updated on Nov 05, 2018. Found a bug?
    From webhook-mailer at python.org Mon Nov 5 23:29:12 2018 From: webhook-mailer at python.org (Benjamin Peterson) Date: Tue, 06 Nov 2018 04:29:12 -0000 Subject: [Python-checkins] closes bpo-35171: Fix test_TimeRE_recreation_timezone failure on some systems. (GH-10347) Message-ID: https://github.com/python/cpython/commit/f1b9ad3d38c11676b45edcbf2369239bae436e56 commit: f1b9ad3d38c11676b45edcbf2369239bae436e56 branch: master author: Alexey Izbyshev committer: Benjamin Peterson date: 2018-11-05T20:29:07-08:00 summary: closes bpo-35171: Fix test_TimeRE_recreation_timezone failure on some systems. (GH-10347) The test depended on '/usr/share/zoneinfo/posixrules' or equivalent because it set TZ without explicit DST transition rules. At least on OpenSUSE Tumbleweed that file is linked to '/etc/localtime', making the test fail with certain local timezones, such as 'Europe/Moscow' which doesn't have DST transitions since 2011. files: M Lib/test/test_strptime.py diff --git a/Lib/test/test_strptime.py b/Lib/test/test_strptime.py index a3358a493e53..623da401eee4 100644 --- a/Lib/test/test_strptime.py +++ b/Lib/test/test_strptime.py @@ -692,7 +692,7 @@ def test_TimeRE_recreation_locale(self): finally: locale.setlocale(locale.LC_TIME, locale_info) - @support.run_with_tz('STD-1DST') + @support.run_with_tz('STD-1DST,M4.1.0,M10.1.0') def test_TimeRE_recreation_timezone(self): # The TimeRE instance should be recreated upon changing the timezone. oldtzname = time.tzname From webhook-mailer at python.org Mon Nov 5 23:47:14 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 06 Nov 2018 04:47:14 -0000 Subject: [Python-checkins] closes bpo-35171: Fix test_TimeRE_recreation_timezone failure on some systems. (GH-10347) Message-ID: https://github.com/python/cpython/commit/ca592bcf56fca93210331327777fe20fdeff985a commit: ca592bcf56fca93210331327777fe20fdeff985a branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-05T20:47:11-08:00 summary: closes bpo-35171: Fix test_TimeRE_recreation_timezone failure on some systems. (GH-10347) The test depended on '/usr/share/zoneinfo/posixrules' or equivalent because it set TZ without explicit DST transition rules. At least on OpenSUSE Tumbleweed that file is linked to '/etc/localtime', making the test fail with certain local timezones, such as 'Europe/Moscow' which doesn't have DST transitions since 2011. (cherry picked from commit f1b9ad3d38c11676b45edcbf2369239bae436e56) Co-authored-by: Alexey Izbyshev files: M Lib/test/test_strptime.py diff --git a/Lib/test/test_strptime.py b/Lib/test/test_strptime.py index a3358a493e53..623da401eee4 100644 --- a/Lib/test/test_strptime.py +++ b/Lib/test/test_strptime.py @@ -692,7 +692,7 @@ def test_TimeRE_recreation_locale(self): finally: locale.setlocale(locale.LC_TIME, locale_info) - @support.run_with_tz('STD-1DST') + @support.run_with_tz('STD-1DST,M4.1.0,M10.1.0') def test_TimeRE_recreation_timezone(self): # The TimeRE instance should be recreated upon changing the timezone. oldtzname = time.tzname From webhook-mailer at python.org Mon Nov 5 23:50:07 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 06 Nov 2018 04:50:07 -0000 Subject: [Python-checkins] closes bpo-35171: Fix test_TimeRE_recreation_timezone failure on some systems. (GH-10347) Message-ID: https://github.com/python/cpython/commit/d0e3105f7ca3fc54b167edc756ce545cbab0ce95 commit: d0e3105f7ca3fc54b167edc756ce545cbab0ce95 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-05T20:50:04-08:00 summary: closes bpo-35171: Fix test_TimeRE_recreation_timezone failure on some systems. (GH-10347) The test depended on '/usr/share/zoneinfo/posixrules' or equivalent because it set TZ without explicit DST transition rules. At least on OpenSUSE Tumbleweed that file is linked to '/etc/localtime', making the test fail with certain local timezones, such as 'Europe/Moscow' which doesn't have DST transitions since 2011. (cherry picked from commit f1b9ad3d38c11676b45edcbf2369239bae436e56) Co-authored-by: Alexey Izbyshev files: M Lib/test/test_strptime.py diff --git a/Lib/test/test_strptime.py b/Lib/test/test_strptime.py index 1438487161f9..92de8110bc6d 100644 --- a/Lib/test/test_strptime.py +++ b/Lib/test/test_strptime.py @@ -641,7 +641,7 @@ def test_TimeRE_recreation_locale(self): finally: locale.setlocale(locale.LC_TIME, locale_info) - @support.run_with_tz('STD-1DST') + @support.run_with_tz('STD-1DST,M4.1.0,M10.1.0') def test_TimeRE_recreation_timezone(self): # The TimeRE instance should be recreated upon changing the timezone. oldtzname = time.tzname From webhook-mailer at python.org Mon Nov 5 23:59:10 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 06 Nov 2018 04:59:10 -0000 Subject: [Python-checkins] closes bpo-35171: Fix test_TimeRE_recreation_timezone failure on some systems. (GH-10347) Message-ID: https://github.com/python/cpython/commit/ffbce43c1aa457b5976665eb2e47771198c7af06 commit: ffbce43c1aa457b5976665eb2e47771198c7af06 branch: 2.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-05T20:59:07-08:00 summary: closes bpo-35171: Fix test_TimeRE_recreation_timezone failure on some systems. (GH-10347) The test depended on '/usr/share/zoneinfo/posixrules' or equivalent because it set TZ without explicit DST transition rules. At least on OpenSUSE Tumbleweed that file is linked to '/etc/localtime', making the test fail with certain local timezones, such as 'Europe/Moscow' which doesn't have DST transitions since 2011. (cherry picked from commit f1b9ad3d38c11676b45edcbf2369239bae436e56) Co-authored-by: Alexey Izbyshev files: M Lib/test/test_strptime.py diff --git a/Lib/test/test_strptime.py b/Lib/test/test_strptime.py index 48ad5daec402..a7af85a6d556 100644 --- a/Lib/test/test_strptime.py +++ b/Lib/test/test_strptime.py @@ -580,7 +580,7 @@ def test_TimeRE_recreation_locale(self): finally: locale.setlocale(locale.LC_TIME, locale_info) - @support.run_with_tz('STD-1DST') + @support.run_with_tz('STD-1DST,M4.1.0,M10.1.0') def test_TimeRE_recreation_timezone(self): # The TimeRE instance should be recreated upon changing the timezone. oldtzname = time.tzname From solipsis at pitrou.net Tue Nov 6 04:11:09 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Tue, 06 Nov 2018 09:11:09 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=11 Message-ID: <20181106091109.1.54D52DBFE7FA1F0B@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [0, 0, 7] memory blocks, sum=7 test_functools leaked [0, 3, 1] memory blocks, sum=4 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogRPCjVN', '--timeout', '7200'] From webhook-mailer at python.org Tue Nov 6 09:59:58 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 06 Nov 2018 14:59:58 -0000 Subject: [Python-checkins] bpo-35081: Add _PyCoreConfig_AsDict() (GH-10362) Message-ID: https://github.com/python/cpython/commit/5ed6995675b084fe583b71f96fdde4413bb2a77b commit: 5ed6995675b084fe583b71f96fdde4413bb2a77b branch: master author: Victor Stinner committer: GitHub date: 2018-11-06T15:59:52+01:00 summary: bpo-35081: Add _PyCoreConfig_AsDict() (GH-10362) _testcapimodule.c must not include pycore_pathconfig.h, since it's an internal header files. Changes: * Add _PyCoreConfig_AsDict() function to coreconfig.c. * Remove pycore_pathconfig.h include from _testcapimodule.h. * pycore_pathconfig.h now requires Py_BUILD_CORE to be defined. * _testcapimodule.c compilation now fails if it's built with Py_BUILD_CORE defined. files: M Include/coreconfig.h M Include/internal/pycore_pathconfig.h M Modules/_testcapimodule.c M Python/coreconfig.c diff --git a/Include/coreconfig.h b/Include/coreconfig.h index ff7b684a1fa5..a7d3983d4d18 100644 --- a/Include/coreconfig.h +++ b/Include/coreconfig.h @@ -358,9 +358,10 @@ PyAPI_FUNC(int) _PyCoreConfig_GetEnvDup( wchar_t **dest, wchar_t *wname, char *name); -#endif - +/* Used by _testcapi.get_coreconfig() */ +PyAPI_FUNC(PyObject *) _PyCoreConfig_AsDict(const _PyCoreConfig *config); +#endif #ifdef __cplusplus } diff --git a/Include/internal/pycore_pathconfig.h b/Include/internal/pycore_pathconfig.h index 395df498a0dc..00d7bbf23ea4 100644 --- a/Include/internal/pycore_pathconfig.h +++ b/Include/internal/pycore_pathconfig.h @@ -4,6 +4,10 @@ extern "C" { #endif +#ifndef Py_BUILD_CORE +# error "Py_BUILD_CORE must be defined to include this header" +#endif + PyAPI_FUNC(void) _Py_wstrlist_clear( int len, wchar_t **list); diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index e2deb2603da8..3133d2b11f81 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -10,7 +10,6 @@ #include "Python.h" #include "datetime.h" #include "marshal.h" -#include "pycore_pathconfig.h" #include "pythread.h" #include "structmember.h" #include @@ -24,6 +23,10 @@ #include /* For W_STOPCODE */ #endif +#ifdef Py_BUILD_CORE +# error "_testcapi must test the public Python C API, not CPython internal C API" +#endif + static PyObject *TestError; /* set to exception object in init */ /* Raise TestError with test_name + ": " + msg, and return NULL. */ @@ -4670,152 +4673,7 @@ get_coreconfig(PyObject *self, PyObject *Py_UNUSED(args)) { PyInterpreterState *interp = _PyInterpreterState_Get(); const _PyCoreConfig *config = &interp->core_config; - PyObject *dict, *obj; - - dict = PyDict_New(); - if (dict == NULL) { - return NULL; - } - -#define FROM_STRING(STR) \ - ((STR != NULL) ? \ - PyUnicode_FromString(STR) \ - : (Py_INCREF(Py_None), Py_None)) -#define FROM_WSTRING(STR) \ - ((STR != NULL) ? \ - PyUnicode_FromWideChar(STR, -1) \ - : (Py_INCREF(Py_None), Py_None)) -#define SET_ITEM(KEY, EXPR) \ - do { \ - obj = (EXPR); \ - if (obj == NULL) { \ - return NULL; \ - } \ - int res = PyDict_SetItemString(dict, (KEY), obj); \ - Py_DECREF(obj); \ - if (res < 0) { \ - goto fail; \ - } \ - } while (0) - - SET_ITEM("install_signal_handlers", - PyLong_FromLong(config->install_signal_handlers)); - SET_ITEM("use_environment", - PyLong_FromLong(config->use_environment)); - SET_ITEM("use_hash_seed", - PyLong_FromLong(config->use_hash_seed)); - SET_ITEM("hash_seed", - PyLong_FromUnsignedLong(config->hash_seed)); - SET_ITEM("allocator", - FROM_STRING(config->allocator)); - SET_ITEM("dev_mode", - PyLong_FromLong(config->dev_mode)); - SET_ITEM("faulthandler", - PyLong_FromLong(config->faulthandler)); - SET_ITEM("tracemalloc", - PyLong_FromLong(config->tracemalloc)); - SET_ITEM("import_time", - PyLong_FromLong(config->import_time)); - SET_ITEM("show_ref_count", - PyLong_FromLong(config->show_ref_count)); - SET_ITEM("show_alloc_count", - PyLong_FromLong(config->show_alloc_count)); - SET_ITEM("dump_refs", - PyLong_FromLong(config->dump_refs)); - SET_ITEM("malloc_stats", - PyLong_FromLong(config->malloc_stats)); - SET_ITEM("coerce_c_locale", - PyLong_FromLong(config->coerce_c_locale)); - SET_ITEM("coerce_c_locale_warn", - PyLong_FromLong(config->coerce_c_locale_warn)); - SET_ITEM("filesystem_encoding", - FROM_STRING(config->filesystem_encoding)); - SET_ITEM("filesystem_errors", - FROM_STRING(config->filesystem_errors)); - SET_ITEM("stdio_encoding", - FROM_STRING(config->stdio_encoding)); - SET_ITEM("utf8_mode", - PyLong_FromLong(config->utf8_mode)); - SET_ITEM("pycache_prefix", - FROM_WSTRING(config->pycache_prefix)); - SET_ITEM("program_name", - FROM_WSTRING(config->program_name)); - SET_ITEM("argv", - _Py_wstrlist_as_pylist(config->argc, config->argv)); - SET_ITEM("program", - FROM_WSTRING(config->program)); - SET_ITEM("warnoptions", - _Py_wstrlist_as_pylist(config->nwarnoption, config->warnoptions)); - SET_ITEM("module_search_path_env", - FROM_WSTRING(config->module_search_path_env)); - SET_ITEM("home", - FROM_WSTRING(config->home)); - SET_ITEM("module_search_paths", - _Py_wstrlist_as_pylist(config->nmodule_search_path, config->module_search_paths)); - SET_ITEM("executable", - FROM_WSTRING(config->executable)); - SET_ITEM("prefix", - FROM_WSTRING(config->prefix)); - SET_ITEM("base_prefix", - FROM_WSTRING(config->base_prefix)); - SET_ITEM("exec_prefix", - FROM_WSTRING(config->exec_prefix)); - SET_ITEM("base_exec_prefix", - FROM_WSTRING(config->base_exec_prefix)); -#ifdef MS_WINDOWS - SET_ITEM("dll_path", - FROM_WSTRING(config->dll_path)); -#endif - SET_ITEM("isolated", - PyLong_FromLong(config->isolated)); - SET_ITEM("site_import", - PyLong_FromLong(config->site_import)); - SET_ITEM("bytes_warning", - PyLong_FromLong(config->bytes_warning)); - SET_ITEM("inspect", - PyLong_FromLong(config->inspect)); - SET_ITEM("interactive", - PyLong_FromLong(config->interactive)); - SET_ITEM("optimization_level", - PyLong_FromLong(config->optimization_level)); - SET_ITEM("parser_debug", - PyLong_FromLong(config->parser_debug)); - SET_ITEM("write_bytecode", - PyLong_FromLong(config->write_bytecode)); - SET_ITEM("verbose", - PyLong_FromLong(config->verbose)); - SET_ITEM("quiet", - PyLong_FromLong(config->quiet)); - SET_ITEM("user_site_directory", - PyLong_FromLong(config->user_site_directory)); - SET_ITEM("buffered_stdio", - PyLong_FromLong(config->buffered_stdio)); - SET_ITEM("stdio_encoding", - FROM_STRING(config->stdio_encoding)); - SET_ITEM("stdio_errors", - FROM_STRING(config->stdio_errors)); -#ifdef MS_WINDOWS - SET_ITEM("legacy_windows_fs_encoding", - PyLong_FromLong(config->legacy_windows_fs_encoding)); - SET_ITEM("legacy_windows_stdio", - PyLong_FromLong(config->legacy_windows_stdio)); -#endif - SET_ITEM("_install_importlib", - PyLong_FromLong(config->_install_importlib)); - SET_ITEM("_check_hash_pycs_mode", - FROM_STRING(config->_check_hash_pycs_mode)); - SET_ITEM("_frozen", - PyLong_FromLong(config->_frozen)); - - return dict; - -fail: - Py_DECREF(dict); - return NULL; - -#undef FROM_STRING -#undef FROM_WSTRING -#undef SET_ITEM + return _PyCoreConfig_AsDict(config); } diff --git a/Python/coreconfig.c b/Python/coreconfig.c index b21e9344cd16..b6fc33c3c96b 100644 --- a/Python/coreconfig.c +++ b/Python/coreconfig.c @@ -1358,3 +1358,155 @@ _PyCoreConfig_Read(_PyCoreConfig *config) return _Py_INIT_OK(); } + + +PyObject * +_PyCoreConfig_AsDict(const _PyCoreConfig *config) +{ + PyObject *dict, *obj; + + dict = PyDict_New(); + if (dict == NULL) { + return NULL; + } + +#define FROM_STRING(STR) \ + ((STR != NULL) ? \ + PyUnicode_FromString(STR) \ + : (Py_INCREF(Py_None), Py_None)) +#define FROM_WSTRING(STR) \ + ((STR != NULL) ? \ + PyUnicode_FromWideChar(STR, -1) \ + : (Py_INCREF(Py_None), Py_None)) +#define SET_ITEM(KEY, EXPR) \ + do { \ + obj = (EXPR); \ + if (obj == NULL) { \ + return NULL; \ + } \ + int res = PyDict_SetItemString(dict, (KEY), obj); \ + Py_DECREF(obj); \ + if (res < 0) { \ + goto fail; \ + } \ + } while (0) + + SET_ITEM("install_signal_handlers", + PyLong_FromLong(config->install_signal_handlers)); + SET_ITEM("use_environment", + PyLong_FromLong(config->use_environment)); + SET_ITEM("use_hash_seed", + PyLong_FromLong(config->use_hash_seed)); + SET_ITEM("hash_seed", + PyLong_FromUnsignedLong(config->hash_seed)); + SET_ITEM("allocator", + FROM_STRING(config->allocator)); + SET_ITEM("dev_mode", + PyLong_FromLong(config->dev_mode)); + SET_ITEM("faulthandler", + PyLong_FromLong(config->faulthandler)); + SET_ITEM("tracemalloc", + PyLong_FromLong(config->tracemalloc)); + SET_ITEM("import_time", + PyLong_FromLong(config->import_time)); + SET_ITEM("show_ref_count", + PyLong_FromLong(config->show_ref_count)); + SET_ITEM("show_alloc_count", + PyLong_FromLong(config->show_alloc_count)); + SET_ITEM("dump_refs", + PyLong_FromLong(config->dump_refs)); + SET_ITEM("malloc_stats", + PyLong_FromLong(config->malloc_stats)); + SET_ITEM("coerce_c_locale", + PyLong_FromLong(config->coerce_c_locale)); + SET_ITEM("coerce_c_locale_warn", + PyLong_FromLong(config->coerce_c_locale_warn)); + SET_ITEM("filesystem_encoding", + FROM_STRING(config->filesystem_encoding)); + SET_ITEM("filesystem_errors", + FROM_STRING(config->filesystem_errors)); + SET_ITEM("stdio_encoding", + FROM_STRING(config->stdio_encoding)); + SET_ITEM("utf8_mode", + PyLong_FromLong(config->utf8_mode)); + SET_ITEM("pycache_prefix", + FROM_WSTRING(config->pycache_prefix)); + SET_ITEM("program_name", + FROM_WSTRING(config->program_name)); + SET_ITEM("argv", + _Py_wstrlist_as_pylist(config->argc, config->argv)); + SET_ITEM("program", + FROM_WSTRING(config->program)); + SET_ITEM("warnoptions", + _Py_wstrlist_as_pylist(config->nwarnoption, config->warnoptions)); + SET_ITEM("module_search_path_env", + FROM_WSTRING(config->module_search_path_env)); + SET_ITEM("home", + FROM_WSTRING(config->home)); + SET_ITEM("module_search_paths", + _Py_wstrlist_as_pylist(config->nmodule_search_path, config->module_search_paths)); + SET_ITEM("executable", + FROM_WSTRING(config->executable)); + SET_ITEM("prefix", + FROM_WSTRING(config->prefix)); + SET_ITEM("base_prefix", + FROM_WSTRING(config->base_prefix)); + SET_ITEM("exec_prefix", + FROM_WSTRING(config->exec_prefix)); + SET_ITEM("base_exec_prefix", + FROM_WSTRING(config->base_exec_prefix)); +#ifdef MS_WINDOWS + SET_ITEM("dll_path", + FROM_WSTRING(config->dll_path)); +#endif + SET_ITEM("isolated", + PyLong_FromLong(config->isolated)); + SET_ITEM("site_import", + PyLong_FromLong(config->site_import)); + SET_ITEM("bytes_warning", + PyLong_FromLong(config->bytes_warning)); + SET_ITEM("inspect", + PyLong_FromLong(config->inspect)); + SET_ITEM("interactive", + PyLong_FromLong(config->interactive)); + SET_ITEM("optimization_level", + PyLong_FromLong(config->optimization_level)); + SET_ITEM("parser_debug", + PyLong_FromLong(config->parser_debug)); + SET_ITEM("write_bytecode", + PyLong_FromLong(config->write_bytecode)); + SET_ITEM("verbose", + PyLong_FromLong(config->verbose)); + SET_ITEM("quiet", + PyLong_FromLong(config->quiet)); + SET_ITEM("user_site_directory", + PyLong_FromLong(config->user_site_directory)); + SET_ITEM("buffered_stdio", + PyLong_FromLong(config->buffered_stdio)); + SET_ITEM("stdio_encoding", + FROM_STRING(config->stdio_encoding)); + SET_ITEM("stdio_errors", + FROM_STRING(config->stdio_errors)); +#ifdef MS_WINDOWS + SET_ITEM("legacy_windows_fs_encoding", + PyLong_FromLong(config->legacy_windows_fs_encoding)); + SET_ITEM("legacy_windows_stdio", + PyLong_FromLong(config->legacy_windows_stdio)); +#endif + SET_ITEM("_install_importlib", + PyLong_FromLong(config->_install_importlib)); + SET_ITEM("_check_hash_pycs_mode", + FROM_STRING(config->_check_hash_pycs_mode)); + SET_ITEM("_frozen", + PyLong_FromLong(config->_frozen)); + + return dict; + +fail: + Py_DECREF(dict); + return NULL; + +#undef FROM_STRING +#undef FROM_WSTRING +#undef SET_ITEM +} From webhook-mailer at python.org Tue Nov 6 12:37:42 2018 From: webhook-mailer at python.org (Terry Jan Reedy) Date: Tue, 06 Nov 2018 17:37:42 -0000 Subject: [Python-checkins] bpo-23220: Explain how IDLE's Shell displays output (GH-10356) Message-ID: https://github.com/python/cpython/commit/75d9d59ab3a372d3d78e6a1f5e9f256e29d0a9a6 commit: 75d9d59ab3a372d3d78e6a1f5e9f256e29d0a9a6 branch: master author: Terry Jan Reedy committer: GitHub date: 2018-11-06T12:37:36-05:00 summary: bpo-23220: Explain how IDLE's Shell displays output (GH-10356) Add a new subsection to the doc. files: A Misc/NEWS.d/next/IDLE/2018-11-05-23-23-00.bpo-23220.H3SAWE.rst M Doc/library/idle.rst M Lib/idlelib/help.html diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst index c5015bf30cfb..fa58e2d59421 100644 --- a/Doc/library/idle.rst +++ b/Doc/library/idle.rst @@ -502,8 +502,16 @@ or immediately run an existing file before editing. Python Shell window ^^^^^^^^^^^^^^^^^^^ -The editing features described above work when entering code interactively. -IDLE's Shell window also responds to the following keys. +With IDLE's Shell, one enters, edits, and recalls complete statements. +Most consoles and terminals only work with a single physical line at a time. + +When one pastes code into Shell, it is not compiled and possibly executed +until one hits :kbd:`Return`. One may edit pasted code first. +If one pastes more that one statement into Shell, the result will be a +:exc:`SyntaxError` when multiple statements are compiled as if they were one. + +The editing features described in previous subsections work when entering +code interactively. IDLE's Shell window also responds to the following keys. * :kbd:`C-c` interrupts executing command @@ -520,16 +528,6 @@ IDLE's Shell window also responds to the following keys. * :kbd:`Return` while on any previous command retrieves that command -Shell has a special facility for squeezing output lines down to a -'Squeezed text' label. This is done automatically for output over N lines -(N = 50 by default). N can be changed in the PyShell section of the General -page of the Settings dialog. Output with fewer lines can be squeezed by -right clicking on the output. This can be useful for extra long lines. - -Squeezed output is expanded in place by double-clicking the label. -It can also be sent to the clipboard or a separate view window by -right-clicking the label. - Text colors ^^^^^^^^^^^ @@ -666,6 +664,44 @@ If ``sys`` is reset by user code, such as with ``importlib.reload(sys)``, IDLE's changes are lost and input from the keyboard and output to the screen will not work correctly. +User output in Shell +^^^^^^^^^^^^^^^^^^^^ + +When a program outputs text, the result is determined by the +corresponding output device. When IDLE executes user code, ``sys.stdout`` +and ``sys.stderr`` are connected to the display area of IDLE's Shell. Some of +its features are inherited from the underlying Tk Text widget. Others +are programmed additions. + +Text widgets display a subset of Unicode, the Basic Multilingual Plane (BMP). +Which characters get a proper glyph instead of a replacement box depends on +the operating system and installed fonts. Newline characters cause following +text to appear on a new line, but other control characters are replaced +with a box. But note that the ``repr()`` function, which is used for +interactive echo of expression values, replaces control characters +with escape codes before they are output. + +Normal and error output are generally kept separate (on separate lines) +from code input and each other. They each get different highlight colors. + +For SyntaxError tracebacks, the normal '^' marking where the error was +detected is replaced by coloring the text with an error highlight. +When code run from a file causes other exceptions, one may right click +on a traceback line to jump to the corresponding line in an IDLE editor. +The file will be opened if necessary. + +Shell has a special facility for squeezing output lines down to a +'Squeezed text' label. This is done automatically +for output over N lines (N = 50 by default). +N can be changed in the PyShell section of the General +page of the Settings dialog. Output with fewer lines can be squeezed by +right clicking on the output. This can be useful lines long enough to slow +down scrolling. + +Squeezed output is expanded in place by double-clicking the label. +It can also be sent to the clipboard or a separate view window by +right-clicking the label. + Developing tkinter applications ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html index 1cd9b6913de8..83bd4a1b91df 100644 --- a/Lib/idlelib/help.html +++ b/Lib/idlelib/help.html @@ -501,8 +501,14 @@

    Calltips

    Python Shell window?

    -

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

    +

    With IDLE?s Shell, one enters, edits, and recalls complete statements. +Most consoles and terminals only work with a single physical line at a time.

    +

    When one pastes code into Shell, it is not compiled and possibly executed +until one hits Return. One may edit pasted code first. +If one pastes more that one statement into Shell, the result will be a +SyntaxError when multiple statements are compiled as if they were one.

    +

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

    • C-c interrupts executing command

    • @@ -518,14 +524,6 @@

      Python Shell window

      Text colors?

      @@ -644,6 +642,38 @@

      Running user code +

      User output in Shell?

      +

      When a program outputs text, the result is determined by the +corresponding output device. When IDLE executes user code, sys.stdout +and sys.stderr are connected to the display area of IDLE?s Shell. Some of +its features are inherited from the underlying Tk Text widget. Others +are programmed additions.

      +

      Text widgets display a subset of Unicode, the Basic Multilingual Plane (BMP). +Which characters get a proper glyph instead of a replacement box depends on +the operating system and installed fonts. Newline characters cause following +text to appear on a new line, but other control characters are replaced +with a box. But note that the repr() function, which is used for +interactive echo of expression values, replaces control characters +with escape codes before they are output.

      +

      Normal and error output are generally kept separate (on separate lines) +from code input and each other. They each get different highlight colors.

      +

      For SyntaxError tracebacks, the normal ?^? marking where the error was +detected is replaced by coloring the text with an error highlight. +When code run from a file causes other exceptions, one may right click +on a traceback line to jump to the corresponding line in an IDLE editor. +The file will be opened if necessary.

      +

      Shell has a special facility for squeezing output lines down to a +?Squeezed text? label. This is done automatically +for output over N lines (N = 50 by default). +N can be changed in the PyShell section of the General +page of the Settings dialog. Output with fewer lines can be squeezed by +right clicking on the output. This can be useful lines long enough to slow +down scrolling.

      +

      Squeezed output is expanded in place by double-clicking the label. +It can also be sent to the clipboard or a separate view window by +right-clicking the label.

      +

  • Developing tkinter applications?

    IDLE is intentionally different from standard Python in order to @@ -763,6 +793,7 @@

    Table of Contents

  • Command line usage
  • Startup failure
  • Running user code
  • +
  • User output in Shell
  • Developing tkinter applications
  • Running without a subprocess
  • @@ -851,7 +882,7 @@

    Navigation



    - Last updated on Nov 05, 2018. + Last updated on Nov 06, 2018. Found a bug?
    diff --git a/Misc/NEWS.d/next/IDLE/2018-11-05-23-23-00.bpo-23220.H3SAWE.rst b/Misc/NEWS.d/next/IDLE/2018-11-05-23-23-00.bpo-23220.H3SAWE.rst new file mode 100644 index 000000000000..77c71268dddd --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2018-11-05-23-23-00.bpo-23220.H3SAWE.rst @@ -0,0 +1 @@ +Explain how IDLE's Shell displays output. From webhook-mailer at python.org Tue Nov 6 13:27:24 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 06 Nov 2018 18:27:24 -0000 Subject: [Python-checkins] bpo-23220: Explain how IDLE's Shell displays output (GH-10356) Message-ID: https://github.com/python/cpython/commit/34fcee9ed81c954d6418241ad546f71e103d3b9b commit: 34fcee9ed81c954d6418241ad546f71e103d3b9b branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-06T10:27:20-08:00 summary: bpo-23220: Explain how IDLE's Shell displays output (GH-10356) Add a new subsection to the doc. (cherry picked from commit 75d9d59ab3a372d3d78e6a1f5e9f256e29d0a9a6) Co-authored-by: Terry Jan Reedy files: A Misc/NEWS.d/next/IDLE/2018-11-05-23-23-00.bpo-23220.H3SAWE.rst M Doc/library/idle.rst M Lib/idlelib/help.html diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst index c5015bf30cfb..fa58e2d59421 100644 --- a/Doc/library/idle.rst +++ b/Doc/library/idle.rst @@ -502,8 +502,16 @@ or immediately run an existing file before editing. Python Shell window ^^^^^^^^^^^^^^^^^^^ -The editing features described above work when entering code interactively. -IDLE's Shell window also responds to the following keys. +With IDLE's Shell, one enters, edits, and recalls complete statements. +Most consoles and terminals only work with a single physical line at a time. + +When one pastes code into Shell, it is not compiled and possibly executed +until one hits :kbd:`Return`. One may edit pasted code first. +If one pastes more that one statement into Shell, the result will be a +:exc:`SyntaxError` when multiple statements are compiled as if they were one. + +The editing features described in previous subsections work when entering +code interactively. IDLE's Shell window also responds to the following keys. * :kbd:`C-c` interrupts executing command @@ -520,16 +528,6 @@ IDLE's Shell window also responds to the following keys. * :kbd:`Return` while on any previous command retrieves that command -Shell has a special facility for squeezing output lines down to a -'Squeezed text' label. This is done automatically for output over N lines -(N = 50 by default). N can be changed in the PyShell section of the General -page of the Settings dialog. Output with fewer lines can be squeezed by -right clicking on the output. This can be useful for extra long lines. - -Squeezed output is expanded in place by double-clicking the label. -It can also be sent to the clipboard or a separate view window by -right-clicking the label. - Text colors ^^^^^^^^^^^ @@ -666,6 +664,44 @@ If ``sys`` is reset by user code, such as with ``importlib.reload(sys)``, IDLE's changes are lost and input from the keyboard and output to the screen will not work correctly. +User output in Shell +^^^^^^^^^^^^^^^^^^^^ + +When a program outputs text, the result is determined by the +corresponding output device. When IDLE executes user code, ``sys.stdout`` +and ``sys.stderr`` are connected to the display area of IDLE's Shell. Some of +its features are inherited from the underlying Tk Text widget. Others +are programmed additions. + +Text widgets display a subset of Unicode, the Basic Multilingual Plane (BMP). +Which characters get a proper glyph instead of a replacement box depends on +the operating system and installed fonts. Newline characters cause following +text to appear on a new line, but other control characters are replaced +with a box. But note that the ``repr()`` function, which is used for +interactive echo of expression values, replaces control characters +with escape codes before they are output. + +Normal and error output are generally kept separate (on separate lines) +from code input and each other. They each get different highlight colors. + +For SyntaxError tracebacks, the normal '^' marking where the error was +detected is replaced by coloring the text with an error highlight. +When code run from a file causes other exceptions, one may right click +on a traceback line to jump to the corresponding line in an IDLE editor. +The file will be opened if necessary. + +Shell has a special facility for squeezing output lines down to a +'Squeezed text' label. This is done automatically +for output over N lines (N = 50 by default). +N can be changed in the PyShell section of the General +page of the Settings dialog. Output with fewer lines can be squeezed by +right clicking on the output. This can be useful lines long enough to slow +down scrolling. + +Squeezed output is expanded in place by double-clicking the label. +It can also be sent to the clipboard or a separate view window by +right-clicking the label. + Developing tkinter applications ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html index 1cd9b6913de8..83bd4a1b91df 100644 --- a/Lib/idlelib/help.html +++ b/Lib/idlelib/help.html @@ -501,8 +501,14 @@

    Calltips

    Python Shell window?

    -

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

    +

    With IDLE?s Shell, one enters, edits, and recalls complete statements. +Most consoles and terminals only work with a single physical line at a time.

    +

    When one pastes code into Shell, it is not compiled and possibly executed +until one hits Return. One may edit pasted code first. +If one pastes more that one statement into Shell, the result will be a +SyntaxError when multiple statements are compiled as if they were one.

    +

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

    • C-c interrupts executing command

    • @@ -518,14 +524,6 @@

      Python Shell window

      Text colors?

      @@ -644,6 +642,38 @@

      Running user code +

      User output in Shell?

      +

      When a program outputs text, the result is determined by the +corresponding output device. When IDLE executes user code, sys.stdout +and sys.stderr are connected to the display area of IDLE?s Shell. Some of +its features are inherited from the underlying Tk Text widget. Others +are programmed additions.

      +

      Text widgets display a subset of Unicode, the Basic Multilingual Plane (BMP). +Which characters get a proper glyph instead of a replacement box depends on +the operating system and installed fonts. Newline characters cause following +text to appear on a new line, but other control characters are replaced +with a box. But note that the repr() function, which is used for +interactive echo of expression values, replaces control characters +with escape codes before they are output.

      +

      Normal and error output are generally kept separate (on separate lines) +from code input and each other. They each get different highlight colors.

      +

      For SyntaxError tracebacks, the normal ?^? marking where the error was +detected is replaced by coloring the text with an error highlight. +When code run from a file causes other exceptions, one may right click +on a traceback line to jump to the corresponding line in an IDLE editor. +The file will be opened if necessary.

      +

      Shell has a special facility for squeezing output lines down to a +?Squeezed text? label. This is done automatically +for output over N lines (N = 50 by default). +N can be changed in the PyShell section of the General +page of the Settings dialog. Output with fewer lines can be squeezed by +right clicking on the output. This can be useful lines long enough to slow +down scrolling.

      +

      Squeezed output is expanded in place by double-clicking the label. +It can also be sent to the clipboard or a separate view window by +right-clicking the label.

      +

    Developing tkinter applications?

    IDLE is intentionally different from standard Python in order to @@ -763,6 +793,7 @@

    Table of Contents

  • Command line usage
  • Startup failure
  • Running user code
  • +
  • User output in Shell
  • Developing tkinter applications
  • Running without a subprocess
  • @@ -851,7 +882,7 @@

    Navigation



    - Last updated on Nov 05, 2018. + Last updated on Nov 06, 2018. Found a bug?
    diff --git a/Misc/NEWS.d/next/IDLE/2018-11-05-23-23-00.bpo-23220.H3SAWE.rst b/Misc/NEWS.d/next/IDLE/2018-11-05-23-23-00.bpo-23220.H3SAWE.rst new file mode 100644 index 000000000000..77c71268dddd --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2018-11-05-23-23-00.bpo-23220.H3SAWE.rst @@ -0,0 +1 @@ +Explain how IDLE's Shell displays output. From webhook-mailer at python.org Tue Nov 6 13:59:44 2018 From: webhook-mailer at python.org (Terry Jan Reedy) Date: Tue, 06 Nov 2018 18:59:44 -0000 Subject: [Python-checkins] bpo-23220: Explain how IDLE's Shell displays output (GH-10356) (#10369) Message-ID: https://github.com/python/cpython/commit/7476fefb65075161d57435c8dd7e92437578d3c1 commit: 7476fefb65075161d57435c8dd7e92437578d3c1 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Terry Jan Reedy date: 2018-11-06T13:59:39-05:00 summary: bpo-23220: Explain how IDLE's Shell displays output (GH-10356) (#10369) Add a new subsection to the doc. (cherry picked from commit 75d9d59ab3a372d3d78e6a1f5e9f256e29d0a9a6) Co-authored-by: Terry Jan Reedy files: A Misc/NEWS.d/next/IDLE/2018-11-05-23-23-00.bpo-23220.H3SAWE.rst M Doc/library/idle.rst M Lib/idlelib/help.html diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst index a4432190bbb0..44085e172d47 100644 --- a/Doc/library/idle.rst +++ b/Doc/library/idle.rst @@ -502,8 +502,16 @@ or immediately run an existing file before editing. Python Shell window ^^^^^^^^^^^^^^^^^^^ -The editing features described above work when entering code interactively. -IDLE's Shell window also responds to the following keys. +With IDLE's Shell, one enters, edits, and recalls complete statements. +Most consoles and terminals only work with a single physical line at a time. + +When one pastes code into Shell, it is not compiled and possibly executed +until one hits :kbd:`Return`. One may edit pasted code first. +If one pastes more that one statement into Shell, the result will be a +:exc:`SyntaxError` when multiple statements are compiled as if they were one. + +The editing features described in previous subsections work when entering +code interactively. IDLE's Shell window also responds to the following keys. * :kbd:`C-c` interrupts executing command @@ -520,16 +528,6 @@ IDLE's Shell window also responds to the following keys. * :kbd:`Return` while on any previous command retrieves that command -Shell has a special facility for squeezing output lines down to a -'Squeezed text' label. This is done automatically for output over N lines -(N = 50 by default). N can be changed in the PyShell section of the General -page of the Settings dialog. Output with fewer lines can be squeezed by -right clicking on the output. This can be useful for extra long lines. - -Squeezed output is expanded in place by double-clicking the label. -It can also be sent to the clipboard or a separate view window by -right-clicking the label. - Text colors ^^^^^^^^^^^ @@ -666,6 +664,44 @@ If ``sys`` is reset by user code, such as with ``importlib.reload(sys)``, IDLE's changes are lost and input from the keyboard and output to the screen will not work correctly. +User output in Shell +^^^^^^^^^^^^^^^^^^^^ + +When a program outputs text, the result is determined by the +corresponding output device. When IDLE executes user code, ``sys.stdout`` +and ``sys.stderr`` are connected to the display area of IDLE's Shell. Some of +its features are inherited from the underlying Tk Text widget. Others +are programmed additions. + +Text widgets display a subset of Unicode, the Basic Multilingual Plane (BMP). +Which characters get a proper glyph instead of a replacement box depends on +the operating system and installed fonts. Newline characters cause following +text to appear on a new line, but other control characters are replaced +with a box. But note that the ``repr()`` function, which is used for +interactive echo of expression values, replaces control characters +with escape codes before they are output. + +Normal and error output are generally kept separate (on separate lines) +from code input and each other. They each get different highlight colors. + +For SyntaxError tracebacks, the normal '^' marking where the error was +detected is replaced by coloring the text with an error highlight. +When code run from a file causes other exceptions, one may right click +on a traceback line to jump to the corresponding line in an IDLE editor. +The file will be opened if necessary. + +Shell has a special facility for squeezing output lines down to a +'Squeezed text' label. This is done automatically +for output over N lines (N = 50 by default). +N can be changed in the PyShell section of the General +page of the Settings dialog. Output with fewer lines can be squeezed by +right clicking on the output. This can be useful lines long enough to slow +down scrolling. + +Squeezed output is expanded in place by double-clicking the label. +It can also be sent to the clipboard or a separate view window by +right-clicking the label. + Developing tkinter applications ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html index 1cd9b6913de8..83bd4a1b91df 100644 --- a/Lib/idlelib/help.html +++ b/Lib/idlelib/help.html @@ -501,8 +501,14 @@

    Calltips

    Python Shell window?

    -

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

    +

    With IDLE?s Shell, one enters, edits, and recalls complete statements. +Most consoles and terminals only work with a single physical line at a time.

    +

    When one pastes code into Shell, it is not compiled and possibly executed +until one hits Return. One may edit pasted code first. +If one pastes more that one statement into Shell, the result will be a +SyntaxError when multiple statements are compiled as if they were one.

    +

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

    • C-c interrupts executing command

    • @@ -518,14 +524,6 @@

      Python Shell window

      Text colors?

      @@ -644,6 +642,38 @@

      Running user code +

      User output in Shell?

      +

      When a program outputs text, the result is determined by the +corresponding output device. When IDLE executes user code, sys.stdout +and sys.stderr are connected to the display area of IDLE?s Shell. Some of +its features are inherited from the underlying Tk Text widget. Others +are programmed additions.

      +

      Text widgets display a subset of Unicode, the Basic Multilingual Plane (BMP). +Which characters get a proper glyph instead of a replacement box depends on +the operating system and installed fonts. Newline characters cause following +text to appear on a new line, but other control characters are replaced +with a box. But note that the repr() function, which is used for +interactive echo of expression values, replaces control characters +with escape codes before they are output.

      +

      Normal and error output are generally kept separate (on separate lines) +from code input and each other. They each get different highlight colors.

      +

      For SyntaxError tracebacks, the normal ?^? marking where the error was +detected is replaced by coloring the text with an error highlight. +When code run from a file causes other exceptions, one may right click +on a traceback line to jump to the corresponding line in an IDLE editor. +The file will be opened if necessary.

      +

      Shell has a special facility for squeezing output lines down to a +?Squeezed text? label. This is done automatically +for output over N lines (N = 50 by default). +N can be changed in the PyShell section of the General +page of the Settings dialog. Output with fewer lines can be squeezed by +right clicking on the output. This can be useful lines long enough to slow +down scrolling.

      +

      Squeezed output is expanded in place by double-clicking the label. +It can also be sent to the clipboard or a separate view window by +right-clicking the label.

      +

    Developing tkinter applications?

    IDLE is intentionally different from standard Python in order to @@ -763,6 +793,7 @@

    Table of Contents

  • Command line usage
  • Startup failure
  • Running user code
  • +
  • User output in Shell
  • Developing tkinter applications
  • Running without a subprocess
  • @@ -851,7 +882,7 @@

    Navigation



    - Last updated on Nov 05, 2018. + Last updated on Nov 06, 2018. Found a bug?
    diff --git a/Misc/NEWS.d/next/IDLE/2018-11-05-23-23-00.bpo-23220.H3SAWE.rst b/Misc/NEWS.d/next/IDLE/2018-11-05-23-23-00.bpo-23220.H3SAWE.rst new file mode 100644 index 000000000000..77c71268dddd --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2018-11-05-23-23-00.bpo-23220.H3SAWE.rst @@ -0,0 +1 @@ +Explain how IDLE's Shell displays output. From webhook-mailer at python.org Tue Nov 6 14:38:42 2018 From: webhook-mailer at python.org (Antoine Pitrou) Date: Tue, 06 Nov 2018 19:38:42 -0000 Subject: [Python-checkins] bpo-17560: Too small type for struct.pack/unpack in mutliprocessing.Connection (GH-10305) Message-ID: https://github.com/python/cpython/commit/bccacd19fa7b56dcf2fbfab15992b6b94ab6666b commit: bccacd19fa7b56dcf2fbfab15992b6b94ab6666b branch: master author: Alexander Buchkovsky committer: Antoine Pitrou date: 2018-11-06T20:38:34+01:00 summary: bpo-17560: Too small type for struct.pack/unpack in mutliprocessing.Connection (GH-10305) Allow sending more than 2 GB at once on a multiprocessing connection on non-Windows systems. files: A Misc/NEWS.d/next/Library/2018-11-03-10-12-04.bpo-35152.xpqskp.rst M Lib/multiprocessing/connection.py diff --git a/Lib/multiprocessing/connection.py b/Lib/multiprocessing/connection.py index 1f3ea504fff4..c9f995e5fa7f 100644 --- a/Lib/multiprocessing/connection.py +++ b/Lib/multiprocessing/connection.py @@ -389,23 +389,33 @@ def _recv(self, size, read=_read): def _send_bytes(self, buf): n = len(buf) - # For wire compatibility with 3.2 and lower - header = struct.pack("!i", n) - if n > 16384: - # The payload is large so Nagle's algorithm won't be triggered - # and we'd better avoid the cost of concatenation. + if n > 0x7fffffff: + pre_header = struct.pack("!i", -1) + header = struct.pack("!Q", n) + self._send(pre_header) self._send(header) self._send(buf) else: - # Issue #20540: concatenate before sending, to avoid delays due - # to Nagle's algorithm on a TCP socket. - # Also note we want to avoid sending a 0-length buffer separately, - # to avoid "broken pipe" errors if the other end closed the pipe. - self._send(header + buf) + # For wire compatibility with 3.7 and lower + header = struct.pack("!i", n) + if n > 16384: + # The payload is large so Nagle's algorithm won't be triggered + # and we'd better avoid the cost of concatenation. + self._send(header) + self._send(buf) + else: + # Issue #20540: concatenate before sending, to avoid delays due + # to Nagle's algorithm on a TCP socket. + # Also note we want to avoid sending a 0-length buffer separately, + # to avoid "broken pipe" errors if the other end closed the pipe. + self._send(header + buf) def _recv_bytes(self, maxsize=None): buf = self._recv(4) size, = struct.unpack("!i", buf.getvalue()) + if size == -1: + buf = self._recv(8) + size, = struct.unpack("!Q", buf.getvalue()) if maxsize is not None and size > maxsize: return None return self._recv(size) diff --git a/Misc/NEWS.d/next/Library/2018-11-03-10-12-04.bpo-35152.xpqskp.rst b/Misc/NEWS.d/next/Library/2018-11-03-10-12-04.bpo-35152.xpqskp.rst new file mode 100644 index 000000000000..7cc9ed39007e --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-11-03-10-12-04.bpo-35152.xpqskp.rst @@ -0,0 +1 @@ +Allow sending more than 2 GB at once on a multiprocessing connection on non-Windows systems. \ No newline at end of file From webhook-mailer at python.org Tue Nov 6 18:44:07 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 06 Nov 2018 23:44:07 -0000 Subject: [Python-checkins] bpo-35081: Add pycore_fileutils.h (GH-10371) Message-ID: https://github.com/python/cpython/commit/9fc57a384825530635ef5ec093a31d864ea14f7c commit: 9fc57a384825530635ef5ec093a31d864ea14f7c branch: master author: Victor Stinner committer: GitHub date: 2018-11-07T00:44:03+01:00 summary: bpo-35081: Add pycore_fileutils.h (GH-10371) Move Py_BUILD_CORE code from Include/fileutils.h to a new Include/internal/pycore_fileutils.h file. files: A Include/internal/pycore_fileutils.h M Include/fileutils.h M Modules/getpath.c M Objects/unicodeobject.c M Python/coreconfig.c M Python/fileutils.c M Python/pathconfig.c diff --git a/Include/fileutils.h b/Include/fileutils.h index 232d9664cdd0..fdd60fffcd55 100644 --- a/Include/fileutils.h +++ b/Include/fileutils.h @@ -1,28 +1,9 @@ #ifndef Py_FILEUTILS_H #define Py_FILEUTILS_H - #ifdef __cplusplus extern "C" { #endif - -#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03080000 -typedef enum { - _Py_ERROR_UNKNOWN=0, - _Py_ERROR_STRICT, - _Py_ERROR_SURROGATEESCAPE, - _Py_ERROR_REPLACE, - _Py_ERROR_IGNORE, - _Py_ERROR_BACKSLASHREPLACE, - _Py_ERROR_SURROGATEPASS, - _Py_ERROR_XMLCHARREFREPLACE, - _Py_ERROR_OTHER -} _Py_error_handler; - -PyAPI_FUNC(_Py_error_handler) _Py_GetErrorHandler(const char *errors); -#endif - - #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000 PyAPI_FUNC(wchar_t *) Py_DecodeLocale( const char *arg, @@ -37,30 +18,22 @@ PyAPI_FUNC(char*) _Py_EncodeLocaleRaw( size_t *error_pos); #endif -#ifdef Py_BUILD_CORE -PyAPI_FUNC(int) _Py_DecodeUTF8Ex( - const char *arg, - Py_ssize_t arglen, - wchar_t **wstr, - size_t *wlen, - const char **reason, - _Py_error_handler errors); - -PyAPI_FUNC(int) _Py_EncodeUTF8Ex( - const wchar_t *text, - char **str, - size_t *error_pos, - const char **reason, - int raw_malloc, - _Py_error_handler errors); -PyAPI_FUNC(wchar_t*) _Py_DecodeUTF8_surrogateescape( - const char *arg, - Py_ssize_t arglen); -#endif +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03080000 +typedef enum { + _Py_ERROR_UNKNOWN=0, + _Py_ERROR_STRICT, + _Py_ERROR_SURROGATEESCAPE, + _Py_ERROR_REPLACE, + _Py_ERROR_IGNORE, + _Py_ERROR_BACKSLASHREPLACE, + _Py_ERROR_SURROGATEPASS, + _Py_ERROR_XMLCHARREFREPLACE, + _Py_ERROR_OTHER +} _Py_error_handler; +PyAPI_FUNC(_Py_error_handler) _Py_GetErrorHandler(const char *errors); -#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03080000 PyAPI_FUNC(int) _Py_DecodeLocaleEx( const char *arg, wchar_t **wstr, @@ -204,13 +177,7 @@ PyAPI_FUNC(int) _Py_GetLocaleconvNumeric( #endif /* Py_LIMITED_API */ - -#ifdef Py_BUILD_CORE -PyAPI_FUNC(int) _Py_GetForceASCII(void); -#endif - #ifdef __cplusplus } #endif - #endif /* !Py_FILEUTILS_H */ diff --git a/Include/internal/pycore_fileutils.h b/Include/internal/pycore_fileutils.h new file mode 100644 index 000000000000..d577e099d1f5 --- /dev/null +++ b/Include/internal/pycore_fileutils.h @@ -0,0 +1,36 @@ +#ifndef Py_INTERNAL_FILEUTILS_H +#define Py_INTERNAL_FILEUTILS_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "Py_BUILD_CORE must be defined to include this header" +#endif + +PyAPI_FUNC(int) _Py_DecodeUTF8Ex( + const char *arg, + Py_ssize_t arglen, + wchar_t **wstr, + size_t *wlen, + const char **reason, + _Py_error_handler errors); + +PyAPI_FUNC(int) _Py_EncodeUTF8Ex( + const wchar_t *text, + char **str, + size_t *error_pos, + const char **reason, + int raw_malloc, + _Py_error_handler errors); + +PyAPI_FUNC(wchar_t*) _Py_DecodeUTF8_surrogateescape( + const char *arg, + Py_ssize_t arglen); + +PyAPI_FUNC(int) _Py_GetForceASCII(void); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_FILEUTILS_H */ diff --git a/Modules/getpath.c b/Modules/getpath.c index 0e210710ecf4..6b443f62b054 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -2,6 +2,7 @@ #include "Python.h" #include "osdefs.h" +#include "pycore_fileutils.h" #include "pycore_pathconfig.h" #include "pycore_state.h" diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 3692da64122f..5338781edc2f 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -40,6 +40,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #define PY_SSIZE_T_CLEAN #include "Python.h" +#include "pycore_fileutils.h" #include "pycore_state.h" #include "ucnhash.h" #include "bytes_methods.h" diff --git a/Python/coreconfig.c b/Python/coreconfig.c index b6fc33c3c96b..c81cd8bab775 100644 --- a/Python/coreconfig.c +++ b/Python/coreconfig.c @@ -1,4 +1,5 @@ #include "Python.h" +#include "pycore_fileutils.h" #include "pycore_lifecycle.h" #include "pycore_mem.h" #include "pycore_pathconfig.h" diff --git a/Python/fileutils.c b/Python/fileutils.c index 2c4061e2692c..c9a8e58dd122 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -1,4 +1,5 @@ #include "Python.h" +#include "pycore_fileutils.h" #include "osdefs.h" #include diff --git a/Python/pathconfig.c b/Python/pathconfig.c index f8bcc2886a1c..2d8b417d31f7 100644 --- a/Python/pathconfig.c +++ b/Python/pathconfig.c @@ -3,6 +3,7 @@ #include "Python.h" #include "osdefs.h" #include "pycore_mem.h" +#include "pycore_fileutils.h" #include "pycore_pathconfig.h" #include "pycore_state.h" #include From webhook-mailer at python.org Tue Nov 6 23:55:11 2018 From: webhook-mailer at python.org (Terry Jan Reedy) Date: Wed, 07 Nov 2018 04:55:11 -0000 Subject: [Python-checkins] bpo-33000: Document that IDLE's shell has no line limit. (#10373) Message-ID: https://github.com/python/cpython/commit/76cd0c30d60961d1a10e2673834a455d2b51f695 commit: 76cd0c30d60961d1a10e2673834a455d2b51f695 branch: master author: Terry Jan Reedy committer: GitHub date: 2018-11-06T23:55:06-05:00 summary: bpo-33000: Document that IDLE's shell has no line limit. (#10373) A program that runs indefinitely can overfill memory. files: A Misc/NEWS.d/next/IDLE/2018-11-06-23-10-54.bpo-33000.pQasCt.rst M Doc/library/idle.rst M Lib/idlelib/help.html diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst index fa58e2d59421..f353fbc86127 100644 --- a/Doc/library/idle.rst +++ b/Doc/library/idle.rst @@ -671,15 +671,23 @@ When a program outputs text, the result is determined by the corresponding output device. When IDLE executes user code, ``sys.stdout`` and ``sys.stderr`` are connected to the display area of IDLE's Shell. Some of its features are inherited from the underlying Tk Text widget. Others -are programmed additions. +are programmed additions. Where it matters, Shell is designed for development +rather than production runs. + +For instance, Shell never throws away output. A program that sends unlimited +output to Shell will eventually fill memory, resulting in a memory error. +In contrast, some system text windows only keep the last n lines of output. +A Windows console, for instance, keeps a user-settable 1 to 9999 lines, +with 300 the default. Text widgets display a subset of Unicode, the Basic Multilingual Plane (BMP). Which characters get a proper glyph instead of a replacement box depends on the operating system and installed fonts. Newline characters cause following -text to appear on a new line, but other control characters are replaced -with a box. But note that the ``repr()`` function, which is used for -interactive echo of expression values, replaces control characters -with escape codes before they are output. +text to appear on a new line, but other control characters are either +replaced with a box or deleted. However, ``repr()``, which is used for +interactive echo of expression values, replaces control characters, +some BMP codepoints, and all non-BMP characters with escape codes +before they are output. Normal and error output are generally kept separate (on separate lines) from code input and each other. They each get different highlight colors. diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html index 83bd4a1b91df..f0b42151f359 100644 --- a/Lib/idlelib/help.html +++ b/Lib/idlelib/help.html @@ -648,14 +648,21 @@

    User output in Shellsys.stdout and sys.stderr are connected to the display area of IDLE?s Shell. Some of its features are inherited from the underlying Tk Text widget. Others -are programmed additions.

    +are programmed additions. Where it matters, Shell is designed for development +rather than production runs.

    +

    For instance, Shell never throws away output. A program that sends unlimited +output to Shell will eventually fill memory, resulting in a memory error. +In contrast, some system text windows only keep the last n lines of output. +A Windows console, for instance, keeps a user-settable 1 to 9999 lines, +with 300 the default.

    Text widgets display a subset of Unicode, the Basic Multilingual Plane (BMP). Which characters get a proper glyph instead of a replacement box depends on the operating system and installed fonts. Newline characters cause following -text to appear on a new line, but other control characters are replaced -with a box. But note that the repr() function, which is used for -interactive echo of expression values, replaces control characters -with escape codes before they are output.

    +text to appear on a new line, but other control characters are either +replaced with a box or deleted. However, repr(), which is used for +interactive echo of expression values, replaces control characters, +some BMP codepoints, and all non-BMP characters with escape codes +before they are output.

    Normal and error output are generally kept separate (on separate lines) from code input and each other. They each get different highlight colors.

    For SyntaxError tracebacks, the normal ?^? marking where the error was diff --git a/Misc/NEWS.d/next/IDLE/2018-11-06-23-10-54.bpo-33000.pQasCt.rst b/Misc/NEWS.d/next/IDLE/2018-11-06-23-10-54.bpo-33000.pQasCt.rst new file mode 100644 index 000000000000..c6ba9e4669d5 --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2018-11-06-23-10-54.bpo-33000.pQasCt.rst @@ -0,0 +1,2 @@ +Document that IDLE's shell has no line limit. A program that runs +indefinitely can overfill memory. From webhook-mailer at python.org Wed Nov 7 00:06:58 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 07 Nov 2018 05:06:58 -0000 Subject: [Python-checkins] bpo-33000: Document that IDLE's shell has no line limit. (GH-10373) Message-ID: https://github.com/python/cpython/commit/2b2a8c130ceb47842cfbd0c725b5b6599b26cf27 commit: 2b2a8c130ceb47842cfbd0c725b5b6599b26cf27 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-06T21:06:54-08:00 summary: bpo-33000: Document that IDLE's shell has no line limit. (GH-10373) A program that runs indefinitely can overfill memory. (cherry picked from commit 76cd0c30d60961d1a10e2673834a455d2b51f695) Co-authored-by: Terry Jan Reedy files: A Misc/NEWS.d/next/IDLE/2018-11-06-23-10-54.bpo-33000.pQasCt.rst M Doc/library/idle.rst M Lib/idlelib/help.html diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst index fa58e2d59421..f353fbc86127 100644 --- a/Doc/library/idle.rst +++ b/Doc/library/idle.rst @@ -671,15 +671,23 @@ When a program outputs text, the result is determined by the corresponding output device. When IDLE executes user code, ``sys.stdout`` and ``sys.stderr`` are connected to the display area of IDLE's Shell. Some of its features are inherited from the underlying Tk Text widget. Others -are programmed additions. +are programmed additions. Where it matters, Shell is designed for development +rather than production runs. + +For instance, Shell never throws away output. A program that sends unlimited +output to Shell will eventually fill memory, resulting in a memory error. +In contrast, some system text windows only keep the last n lines of output. +A Windows console, for instance, keeps a user-settable 1 to 9999 lines, +with 300 the default. Text widgets display a subset of Unicode, the Basic Multilingual Plane (BMP). Which characters get a proper glyph instead of a replacement box depends on the operating system and installed fonts. Newline characters cause following -text to appear on a new line, but other control characters are replaced -with a box. But note that the ``repr()`` function, which is used for -interactive echo of expression values, replaces control characters -with escape codes before they are output. +text to appear on a new line, but other control characters are either +replaced with a box or deleted. However, ``repr()``, which is used for +interactive echo of expression values, replaces control characters, +some BMP codepoints, and all non-BMP characters with escape codes +before they are output. Normal and error output are generally kept separate (on separate lines) from code input and each other. They each get different highlight colors. diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html index 83bd4a1b91df..f0b42151f359 100644 --- a/Lib/idlelib/help.html +++ b/Lib/idlelib/help.html @@ -648,14 +648,21 @@

    User output in Shellsys.stdout and sys.stderr are connected to the display area of IDLE?s Shell. Some of its features are inherited from the underlying Tk Text widget. Others -are programmed additions.

    +are programmed additions. Where it matters, Shell is designed for development +rather than production runs.

    +

    For instance, Shell never throws away output. A program that sends unlimited +output to Shell will eventually fill memory, resulting in a memory error. +In contrast, some system text windows only keep the last n lines of output. +A Windows console, for instance, keeps a user-settable 1 to 9999 lines, +with 300 the default.

    Text widgets display a subset of Unicode, the Basic Multilingual Plane (BMP). Which characters get a proper glyph instead of a replacement box depends on the operating system and installed fonts. Newline characters cause following -text to appear on a new line, but other control characters are replaced -with a box. But note that the repr() function, which is used for -interactive echo of expression values, replaces control characters -with escape codes before they are output.

    +text to appear on a new line, but other control characters are either +replaced with a box or deleted. However, repr(), which is used for +interactive echo of expression values, replaces control characters, +some BMP codepoints, and all non-BMP characters with escape codes +before they are output.

    Normal and error output are generally kept separate (on separate lines) from code input and each other. They each get different highlight colors.

    For SyntaxError tracebacks, the normal ?^? marking where the error was diff --git a/Misc/NEWS.d/next/IDLE/2018-11-06-23-10-54.bpo-33000.pQasCt.rst b/Misc/NEWS.d/next/IDLE/2018-11-06-23-10-54.bpo-33000.pQasCt.rst new file mode 100644 index 000000000000..c6ba9e4669d5 --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2018-11-06-23-10-54.bpo-33000.pQasCt.rst @@ -0,0 +1,2 @@ +Document that IDLE's shell has no line limit. A program that runs +indefinitely can overfill memory. From webhook-mailer at python.org Wed Nov 7 00:18:41 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 07 Nov 2018 05:18:41 -0000 Subject: [Python-checkins] bpo-33000: Document that IDLE's shell has no line limit. (GH-10373) Message-ID: https://github.com/python/cpython/commit/25bd1073996f26ad4895d3eb2d09315361c3cc84 commit: 25bd1073996f26ad4895d3eb2d09315361c3cc84 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-06T21:18:38-08:00 summary: bpo-33000: Document that IDLE's shell has no line limit. (GH-10373) A program that runs indefinitely can overfill memory. (cherry picked from commit 76cd0c30d60961d1a10e2673834a455d2b51f695) Co-authored-by: Terry Jan Reedy files: A Misc/NEWS.d/next/IDLE/2018-11-06-23-10-54.bpo-33000.pQasCt.rst M Doc/library/idle.rst M Lib/idlelib/help.html diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst index 44085e172d47..9be54fe01b02 100644 --- a/Doc/library/idle.rst +++ b/Doc/library/idle.rst @@ -671,15 +671,23 @@ When a program outputs text, the result is determined by the corresponding output device. When IDLE executes user code, ``sys.stdout`` and ``sys.stderr`` are connected to the display area of IDLE's Shell. Some of its features are inherited from the underlying Tk Text widget. Others -are programmed additions. +are programmed additions. Where it matters, Shell is designed for development +rather than production runs. + +For instance, Shell never throws away output. A program that sends unlimited +output to Shell will eventually fill memory, resulting in a memory error. +In contrast, some system text windows only keep the last n lines of output. +A Windows console, for instance, keeps a user-settable 1 to 9999 lines, +with 300 the default. Text widgets display a subset of Unicode, the Basic Multilingual Plane (BMP). Which characters get a proper glyph instead of a replacement box depends on the operating system and installed fonts. Newline characters cause following -text to appear on a new line, but other control characters are replaced -with a box. But note that the ``repr()`` function, which is used for -interactive echo of expression values, replaces control characters -with escape codes before they are output. +text to appear on a new line, but other control characters are either +replaced with a box or deleted. However, ``repr()``, which is used for +interactive echo of expression values, replaces control characters, +some BMP codepoints, and all non-BMP characters with escape codes +before they are output. Normal and error output are generally kept separate (on separate lines) from code input and each other. They each get different highlight colors. diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html index 83bd4a1b91df..f0b42151f359 100644 --- a/Lib/idlelib/help.html +++ b/Lib/idlelib/help.html @@ -648,14 +648,21 @@

    User output in Shellsys.stdout and sys.stderr are connected to the display area of IDLE?s Shell. Some of its features are inherited from the underlying Tk Text widget. Others -are programmed additions.

    +are programmed additions. Where it matters, Shell is designed for development +rather than production runs.

    +

    For instance, Shell never throws away output. A program that sends unlimited +output to Shell will eventually fill memory, resulting in a memory error. +In contrast, some system text windows only keep the last n lines of output. +A Windows console, for instance, keeps a user-settable 1 to 9999 lines, +with 300 the default.

    Text widgets display a subset of Unicode, the Basic Multilingual Plane (BMP). Which characters get a proper glyph instead of a replacement box depends on the operating system and installed fonts. Newline characters cause following -text to appear on a new line, but other control characters are replaced -with a box. But note that the repr() function, which is used for -interactive echo of expression values, replaces control characters -with escape codes before they are output.

    +text to appear on a new line, but other control characters are either +replaced with a box or deleted. However, repr(), which is used for +interactive echo of expression values, replaces control characters, +some BMP codepoints, and all non-BMP characters with escape codes +before they are output.

    Normal and error output are generally kept separate (on separate lines) from code input and each other. They each get different highlight colors.

    For SyntaxError tracebacks, the normal ?^? marking where the error was diff --git a/Misc/NEWS.d/next/IDLE/2018-11-06-23-10-54.bpo-33000.pQasCt.rst b/Misc/NEWS.d/next/IDLE/2018-11-06-23-10-54.bpo-33000.pQasCt.rst new file mode 100644 index 000000000000..c6ba9e4669d5 --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2018-11-06-23-10-54.bpo-33000.pQasCt.rst @@ -0,0 +1,2 @@ +Document that IDLE's shell has no line limit. A program that runs +indefinitely can overfill memory. From webhook-mailer at python.org Wed Nov 7 00:47:16 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Wed, 07 Nov 2018 05:47:16 -0000 Subject: [Python-checkins] Remove duplicate "Reference Guide" in optparse.rst. (GH-10372) Message-ID: https://github.com/python/cpython/commit/d2b11af91560eaaeb499f702f4b0f244ec756280 commit: d2b11af91560eaaeb499f702f4b0f244ec756280 branch: master author: Andr?s Delfino committer: Serhiy Storchaka date: 2018-11-07T07:47:11+02:00 summary: Remove duplicate "Reference Guide" in optparse.rst. (GH-10372) files: M Doc/library/optparse.rst diff --git a/Doc/library/optparse.rst b/Doc/library/optparse.rst index 3afc77bf9f8e..16f1cf008fff 100644 --- a/Doc/library/optparse.rst +++ b/Doc/library/optparse.rst @@ -415,7 +415,7 @@ Some other actions supported by :mod:`optparse` are: ``"callback"`` call a specified function -These are covered in section :ref:`optparse-reference-guide`, Reference Guide +These are covered in section :ref:`optparse-reference-guide`, and section :ref:`optparse-option-callbacks`. From solipsis at pitrou.net Wed Nov 7 04:12:04 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Wed, 07 Nov 2018 09:12:04 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=-1 Message-ID: <20181107091204.1.7BC81FB39E4288FF@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_asyncio leaked [0, 3, 0] memory blocks, sum=3 test_collections leaked [-7, 1, 0] memory blocks, sum=-6 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_forkserver leaked [-2, 1, 1] memory blocks, sum=0 test_multiprocessing_spawn leaked [0, 0, -2] memory blocks, sum=-2 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogfXgJNV', '--timeout', '7200'] From webhook-mailer at python.org Wed Nov 7 04:50:37 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Wed, 07 Nov 2018 09:50:37 -0000 Subject: [Python-checkins] bpo-34898: Add mtime parameter to gzip.compress(). (GH-9704) Message-ID: https://github.com/python/cpython/commit/0e7497cb469b003a45a4abe4105b81ef6d0c4002 commit: 0e7497cb469b003a45a4abe4105b81ef6d0c4002 branch: master author: guoci committer: Serhiy Storchaka date: 2018-11-07T11:50:23+02:00 summary: bpo-34898: Add mtime parameter to gzip.compress(). (GH-9704) Without setting mtime, time.time() will be used as the timestamp which will end up in the compressed data and each invocation of the compress() function will vary over time. files: A Misc/NEWS.d/next/Library/2018-10-04-17-23-43.bpo-34898.Wo2PoJ.rst M Doc/library/gzip.rst M Doc/whatsnew/3.8.rst M Lib/gzip.py M Lib/test/test_gzip.py M Misc/ACKS diff --git a/Doc/library/gzip.rst b/Doc/library/gzip.rst index a57307b0e499..8850a33f4abb 100644 --- a/Doc/library/gzip.rst +++ b/Doc/library/gzip.rst @@ -157,13 +157,15 @@ The module defines the following items: Accepts a :term:`path-like object`. -.. function:: compress(data, compresslevel=9) +.. function:: compress(data, compresslevel=9, *, mtime=None) Compress the *data*, returning a :class:`bytes` object containing - the compressed data. *compresslevel* has the same meaning as in + the compressed data. *compresslevel* and *mtime* have the same meaning as in the :class:`GzipFile` constructor above. .. versionadded:: 3.2 + .. versionchanged:: 3.8 + Added the *mtime* parameter for reproducible output. .. function:: decompress(data) diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index 2d3a116df9d3..51aee1bed835 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -131,6 +131,13 @@ asyncio On Windows, the default event loop is now :class:`~asyncio.ProactorEventLoop`. +gzip +---- + +Added the *mtime* parameter to :func:`gzip.compress` for reproducible output. +(Contributed by Guo Ci Teo in :issue:`34898`.) + + idlelib and IDLE ---------------- diff --git a/Lib/gzip.py b/Lib/gzip.py index 151ff1405b16..948fec293e23 100644 --- a/Lib/gzip.py +++ b/Lib/gzip.py @@ -520,12 +520,12 @@ def _rewind(self): super()._rewind() self._new_member = True -def compress(data, compresslevel=_COMPRESS_LEVEL_BEST): +def compress(data, compresslevel=_COMPRESS_LEVEL_BEST, *, mtime=None): """Compress data in one shot and return the compressed string. Optional argument is the compression level, in range of 0-9. """ buf = io.BytesIO() - with GzipFile(fileobj=buf, mode='wb', compresslevel=compresslevel) as f: + with GzipFile(fileobj=buf, mode='wb', compresslevel=compresslevel, mtime=mtime) as f: f.write(data) return buf.getvalue() diff --git a/Lib/test/test_gzip.py b/Lib/test/test_gzip.py index 1e8b41f07b3e..2c8f854c6436 100644 --- a/Lib/test/test_gzip.py +++ b/Lib/test/test_gzip.py @@ -499,6 +499,17 @@ def test_compress(self): with gzip.GzipFile(fileobj=io.BytesIO(datac), mode="rb") as f: self.assertEqual(f.read(), data) + def test_compress_mtime(self): + mtime = 123456789 + for data in [data1, data2]: + for args in [(), (1,), (6,), (9,)]: + with self.subTest(data=data, args=args): + datac = gzip.compress(data, *args, mtime=mtime) + self.assertEqual(type(datac), bytes) + with gzip.GzipFile(fileobj=io.BytesIO(datac), mode="rb") as f: + f.read(1) # to set mtime attribute + self.assertEqual(f.mtime, mtime) + def test_decompress(self): for data in (data1, data2): buf = io.BytesIO() diff --git a/Misc/ACKS b/Misc/ACKS index 89fb0c7000b4..aba60945a1e2 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -1615,6 +1615,7 @@ Monty Taylor Anatoly Techtonik Martin Teichmann Gustavo Temple +Guo Ci Teo Mikhail Terekhov Victor Terr?n Pablo Galindo diff --git a/Misc/NEWS.d/next/Library/2018-10-04-17-23-43.bpo-34898.Wo2PoJ.rst b/Misc/NEWS.d/next/Library/2018-10-04-17-23-43.bpo-34898.Wo2PoJ.rst new file mode 100644 index 000000000000..4c0a061daf9f --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-04-17-23-43.bpo-34898.Wo2PoJ.rst @@ -0,0 +1,2 @@ +Add `mtime` argument to `gzip.compress` for reproducible output. +Patch by Guo Ci Teo. \ No newline at end of file From webhook-mailer at python.org Wed Nov 7 05:09:37 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Wed, 07 Nov 2018 10:09:37 -0000 Subject: [Python-checkins] bpo-31553: add --json-lines option to json.tool (#10051) Message-ID: https://github.com/python/cpython/commit/f19447994983902aa88362d8fffe645f1ea2f2aa commit: f19447994983902aa88362d8fffe645f1ea2f2aa branch: master author: HongWeipeng <961365124 at qq.com> committer: Serhiy Storchaka date: 2018-11-07T12:09:32+02:00 summary: bpo-31553: add --json-lines option to json.tool (#10051) * add jsonlines option to json.tool * code review * fix:avoid read infile after it close * improve doc in whatsnew 3.8 files: A Misc/NEWS.d/next/Library/2018-10-23-14-46-47.bpo-31553.JxRkAW.rst M Doc/library/json.rst M Doc/whatsnew/3.8.rst M Lib/json/tool.py M Lib/test/test_json/test_tool.py diff --git a/Doc/library/json.rst b/Doc/library/json.rst index 510e30733fed..589e86ca8107 100644 --- a/Doc/library/json.rst +++ b/Doc/library/json.rst @@ -717,6 +717,12 @@ Command line options .. versionadded:: 3.5 +.. cmdoption:: --json-lines + + Parse every input line as separate JSON object. + + .. versionadded:: 3.8 + .. cmdoption:: -h, --help Show the help message. diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index 51aee1bed835..3bacbab1efb6 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -151,6 +151,12 @@ by right-clicking the button. (Contributed by Tal Einat in :issue:`1529353`.) The changes above have been backported to 3.7 maintenance releases. +json.tool +--------- + +Add option ``--json-lines`` to parse every input line as separate JSON object. +(Contributed by Weipeng Hong in :issue:`31553`.) + os.path ------- diff --git a/Lib/json/tool.py b/Lib/json/tool.py index 5932f4ecded7..1d82bc824236 100644 --- a/Lib/json/tool.py +++ b/Lib/json/tool.py @@ -26,19 +26,25 @@ def main(): help='write the output of infile to outfile') parser.add_argument('--sort-keys', action='store_true', default=False, help='sort the output of dictionaries alphabetically by key') + parser.add_argument('--json-lines', action='store_true', default=False, + help='parse input using the jsonlines format') options = parser.parse_args() infile = options.infile or sys.stdin outfile = options.outfile or sys.stdout sort_keys = options.sort_keys - with infile: + json_lines = options.json_lines + with infile, outfile: try: - obj = json.load(infile) + if json_lines: + objs = (json.loads(line) for line in infile) + else: + objs = (json.load(infile), ) + for obj in objs: + json.dump(obj, outfile, sort_keys=sort_keys, indent=4) + outfile.write('\n') except ValueError as e: raise SystemExit(e) - with outfile: - json.dump(obj, outfile, sort_keys=sort_keys, indent=4) - outfile.write('\n') if __name__ == '__main__': diff --git a/Lib/test/test_json/test_tool.py b/Lib/test/test_json/test_tool.py index 9d93f931ca39..1e95bc79e5d1 100644 --- a/Lib/test/test_json/test_tool.py +++ b/Lib/test/test_json/test_tool.py @@ -60,6 +60,28 @@ class TestTool(unittest.TestCase): ] """) + jsonlines_raw = textwrap.dedent("""\ + {"ingredients":["frog", "water", "chocolate", "glucose"]} + {"ingredients":["chocolate","steel bolts"]} + """) + + jsonlines_expect = textwrap.dedent("""\ + { + "ingredients": [ + "frog", + "water", + "chocolate", + "glucose" + ] + } + { + "ingredients": [ + "chocolate", + "steel bolts" + ] + } + """) + def test_stdin_stdout(self): args = sys.executable, '-m', 'json.tool' with Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE) as proc: @@ -92,6 +114,13 @@ def test_infile_outfile(self): self.assertEqual(out, b'') self.assertEqual(err, b'') + def test_jsonlines(self): + args = sys.executable, '-m', 'json.tool', '--json-lines' + with Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE) as proc: + out, err = proc.communicate(self.jsonlines_raw.encode()) + self.assertEqual(out.splitlines(), self.jsonlines_expect.encode().splitlines()) + self.assertEqual(err, b'') + def test_help_flag(self): rc, out, err = assert_python_ok('-m', 'json.tool', '-h') self.assertEqual(rc, 0) diff --git a/Misc/NEWS.d/next/Library/2018-10-23-14-46-47.bpo-31553.JxRkAW.rst b/Misc/NEWS.d/next/Library/2018-10-23-14-46-47.bpo-31553.JxRkAW.rst new file mode 100644 index 000000000000..de80e7cd7d11 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-23-14-46-47.bpo-31553.JxRkAW.rst @@ -0,0 +1 @@ +Add the --json-lines option to json.tool. Patch by hongweipeng. \ No newline at end of file From webhook-mailer at python.org Wed Nov 7 09:09:17 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Wed, 07 Nov 2018 14:09:17 -0000 Subject: [Python-checkins] bpo-34160: Preserve order of attributes in minidom. (GH-10219) Message-ID: https://github.com/python/cpython/commit/5598cc90c745dab827e55fadded42dbe85e31d33 commit: 5598cc90c745dab827e55fadded42dbe85e31d33 branch: master author: Diego Rojas committer: Serhiy Storchaka date: 2018-11-07T16:09:04+02:00 summary: bpo-34160: Preserve order of attributes in minidom. (GH-10219) files: M Doc/library/xml.dom.minidom.rst M Lib/test/test_minidom.py M Lib/xml/dom/minidom.py M Misc/NEWS.d/next/Library/2018-10-27-21-11-42.bpo-34160.UzyPZf.rst diff --git a/Doc/library/xml.dom.minidom.rst b/Doc/library/xml.dom.minidom.rst index 40470e8736e7..a1f334d4178e 100644 --- a/Doc/library/xml.dom.minidom.rst +++ b/Doc/library/xml.dom.minidom.rst @@ -143,6 +143,9 @@ module documentation. This section lists the differences between the API and For the :class:`Document` node, an additional keyword argument *encoding* can be used to specify the encoding field of the XML header. + .. versionchanged:: 3.8 + The :meth:`writexml` method now preserves the attribute order specified + by the user. .. method:: Node.toxml(encoding=None) @@ -156,6 +159,10 @@ module documentation. This section lists the differences between the API and encoding. Encoding this string in an encoding other than UTF-8 is likely incorrect, since UTF-8 is the default encoding of XML. + .. versionchanged:: 3.8 + The :meth:`toxml` method now preserves the attribute order specified + by the user. + .. method:: Node.toprettyxml(indent="", newl="", encoding="") Return a pretty-printed version of the document. *indent* specifies the @@ -165,6 +172,10 @@ module documentation. This section lists the differences between the API and The *encoding* argument behaves like the corresponding argument of :meth:`toxml`. + .. versionchanged:: 3.8 + The :meth:`toprettyxml` method now preserves the attribute order specified + by the user. + .. _dom-example: diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py index e91cdba1eb2e..ad5be2f0f0e2 100644 --- a/Lib/test/test_minidom.py +++ b/Lib/test/test_minidom.py @@ -2,6 +2,8 @@ import copy import pickle +import io +import contextlib from test.support import findfile import unittest @@ -1560,5 +1562,24 @@ def testProcessingInstructionNameError(self): pi = doc.createProcessingInstruction("y", "z") pi.nodeValue = "crash" + def test_minidom_attribute_order(self): + xml_str = '' + doc = parseString(xml_str) + output = io.StringIO() + doc.writexml(output) + self.assertEqual(output.getvalue(), xml_str) + + def test_toxml_with_attributes_ordered(self): + xml_str = '' + doc = parseString(xml_str) + self.assertEqual(doc.toxml(), xml_str) + + def test_toprettyxml_with_attributes_ordered(self): + xml_str = '' + doc = parseString(xml_str) + self.assertEqual(doc.toprettyxml(), + '\n' + '\n') + if __name__ == "__main__": unittest.main() diff --git a/Lib/xml/dom/minidom.py b/Lib/xml/dom/minidom.py index e44e04a069ec..469c51735e03 100644 --- a/Lib/xml/dom/minidom.py +++ b/Lib/xml/dom/minidom.py @@ -854,9 +854,8 @@ def writexml(self, writer, indent="", addindent="", newl=""): writer.write(indent+"<" + self.tagName) attrs = self._get_attributes() - a_names = sorted(attrs.keys()) - for a_name in a_names: + for a_name in attrs.keys(): writer.write(" %s=\"" % a_name) _write_data(writer, attrs[a_name].value) writer.write("\"") diff --git a/Misc/NEWS.d/next/Library/2018-10-27-21-11-42.bpo-34160.UzyPZf.rst b/Misc/NEWS.d/next/Library/2018-10-27-21-11-42.bpo-34160.UzyPZf.rst index 6f3c076d3c03..775d33aacda7 100644 --- a/Misc/NEWS.d/next/Library/2018-10-27-21-11-42.bpo-34160.UzyPZf.rst +++ b/Misc/NEWS.d/next/Library/2018-10-27-21-11-42.bpo-34160.UzyPZf.rst @@ -1 +1 @@ -ElementTree now preserves the attribute order specified by the user. +ElementTree and minidom now preserve the attribute order specified by the user. From webhook-mailer at python.org Wed Nov 7 09:12:24 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Wed, 07 Nov 2018 14:12:24 -0000 Subject: [Python-checkins] bpo-2504: Add pgettext() and variants to gettext. (GH-7253) Message-ID: https://github.com/python/cpython/commit/637a33b99685fd5d1032670fbe29c7c8a8f0ff63 commit: 637a33b99685fd5d1032670fbe29c7c8a8f0ff63 branch: master author: Cheryl Sabella committer: Serhiy Storchaka date: 2018-11-07T16:12:20+02:00 summary: bpo-2504: Add pgettext() and variants to gettext. (GH-7253) files: A Misc/NEWS.d/next/Library/2018-05-30-16-00-06.bpo-2504.BynUvU.rst M Doc/library/gettext.rst M Doc/whatsnew/3.8.rst M Lib/gettext.py M Lib/test/test_gettext.py M Misc/ACKS M Tools/i18n/msgfmt.py diff --git a/Doc/library/gettext.rst b/Doc/library/gettext.rst index 38515ebdf591..7f4eab5843f5 100644 --- a/Doc/library/gettext.rst +++ b/Doc/library/gettext.rst @@ -96,6 +96,18 @@ class-based API instead. Like :func:`ngettext`, but look the message up in the specified *domain*. +.. function:: pgettext(context, message) +.. function:: dpgettext(domain, context, message) +.. function:: npgettext(context, singular, plural, n) +.. function:: dnpgettext(domain, context, singular, plural, n) + + Similar to the corresponding functions without the ``p`` in the prefix (that + is, :func:`gettext`, :func:`dgettext`, :func:`ngettext`, :func:`dngettext`), + but the translation is restricted to the given message *context*. + + .. versionadded:: 3.8 + + .. function:: lgettext(message) .. function:: ldgettext(domain, message) .. function:: lngettext(singular, plural, n) @@ -266,6 +278,22 @@ are the methods of :class:`!NullTranslations`: Overridden in derived classes. + .. method:: pgettext(context, message) + + If a fallback has been set, forward :meth:`pgettext` to the fallback. + Otherwise, return the translated message. Overridden in derived classes. + + .. versionadded:: 3.8 + + + .. method:: npgettext(context, singular, plural, n) + + If a fallback has been set, forward :meth:`npgettext` to the fallback. + Otherwise, return the translated message. Overridden in derived classes. + + .. versionadded:: 3.8 + + .. method:: lgettext(message) .. method:: lngettext(singular, plural, n) @@ -316,7 +344,7 @@ are the methods of :class:`!NullTranslations`: If the *names* parameter is given, it must be a sequence containing the names of functions you want to install in the builtins namespace in addition to :func:`_`. Supported names are ``'gettext'``, ``'ngettext'``, - ``'lgettext'`` and ``'lngettext'``. + ``'pgettext'``, ``'npgettext'``, ``'lgettext'``, and ``'lngettext'``. Note that this is only one way, albeit the most convenient way, to make the :func:`_` function available to your application. Because it affects @@ -331,6 +359,9 @@ are the methods of :class:`!NullTranslations`: This puts :func:`_` only in the module's global namespace and so only affects calls within this module. + .. versionchanged:: 3.8 + Added ``'pgettext'`` and ``'npgettext'``. + The :class:`GNUTranslations` class ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -394,6 +425,31 @@ unexpected, or if other problems occur while reading the file, instantiating a n) % {'num': n} + .. method:: pgettext(context, message) + + Look up the *context* and *message* id in the catalog and return the + corresponding message string, as a Unicode string. If there is no + entry in the catalog for the *message* id and *context*, and a fallback + has been set, the look up is forwarded to the fallback's + :meth:`pgettext` method. Otherwise, the *message* id is returned. + + .. versionadded:: 3.8 + + + .. method:: npgettext(context, singular, plural, n) + + Do a plural-forms lookup of a message id. *singular* is used as the + message id for purposes of lookup in the catalog, while *n* is used to + determine which plural form to use. + + If the message id for *context* is not found in the catalog, and a + fallback is specified, the request is forwarded to the fallback's + :meth:`npgettext` method. Otherwise, when *n* is 1 *singular* is + returned, and *plural* is returned in all other cases. + + .. versionadded:: 3.8 + + .. method:: lgettext(message) .. method:: lngettext(singular, plural, n) diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index 3bacbab1efb6..7b9a9407f0dc 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -131,6 +131,12 @@ asyncio On Windows, the default event loop is now :class:`~asyncio.ProactorEventLoop`. +gettext +------- + +Added :func:`~gettext.pgettext` and its variants. +(Contributed by Franz Glasner, ?ric Araujo, and Cheryl Sabella in :issue:`2504`.) + gzip ---- diff --git a/Lib/gettext.py b/Lib/gettext.py index 920742cabe88..72a313a08562 100644 --- a/Lib/gettext.py +++ b/Lib/gettext.py @@ -57,6 +57,7 @@ 'bind_textdomain_codeset', 'dgettext', 'dngettext', 'gettext', 'lgettext', 'ldgettext', 'ldngettext', 'lngettext', 'ngettext', + 'pgettext', 'dpgettext', 'npgettext', 'dnpgettext', ] _default_localedir = os.path.join(sys.base_prefix, 'share', 'locale') @@ -311,6 +312,19 @@ def lngettext(self, msgid1, msgid2, n): return tmsg.encode(self._output_charset) return tmsg.encode(locale.getpreferredencoding()) + def pgettext(self, context, message): + if self._fallback: + return self._fallback.pgettext(context, message) + return message + + def npgettext(self, context, msgid1, msgid2, n): + if self._fallback: + return self._fallback.npgettext(context, msgid1, msgid2, n) + if n == 1: + return msgid1 + else: + return msgid2 + def info(self): return self._info @@ -332,15 +346,11 @@ def set_output_charset(self, charset): def install(self, names=None): import builtins builtins.__dict__['_'] = self.gettext - if hasattr(names, "__contains__"): - if "gettext" in names: - builtins.__dict__['gettext'] = builtins.__dict__['_'] - if "ngettext" in names: - builtins.__dict__['ngettext'] = self.ngettext - if "lgettext" in names: - builtins.__dict__['lgettext'] = self.lgettext - if "lngettext" in names: - builtins.__dict__['lngettext'] = self.lngettext + if names is not None: + allowed = {'gettext', 'lgettext', 'lngettext', + 'ngettext', 'npgettext', 'pgettext'} + for name in allowed & set(names): + builtins.__dict__[name] = getattr(self, name) class GNUTranslations(NullTranslations): @@ -348,6 +358,10 @@ class GNUTranslations(NullTranslations): LE_MAGIC = 0x950412de BE_MAGIC = 0xde120495 + # The encoding of a msgctxt and a msgid in a .mo file is + # msgctxt + "\x04" + msgid (gettext version >= 0.15) + CONTEXT = "%s\x04%s" + # Acceptable .mo versions VERSIONS = (0, 1) @@ -493,6 +507,29 @@ def ngettext(self, msgid1, msgid2, n): tmsg = msgid2 return tmsg + def pgettext(self, context, message): + ctxt_msg_id = self.CONTEXT % (context, message) + missing = object() + tmsg = self._catalog.get(ctxt_msg_id, missing) + if tmsg is missing: + if self._fallback: + return self._fallback.pgettext(context, message) + return message + return tmsg + + def npgettext(self, context, msgid1, msgid2, n): + ctxt_msg_id = self.CONTEXT % (context, msgid1) + try: + tmsg = self._catalog[ctxt_msg_id, self.plural(n)] + except KeyError: + if self._fallback: + return self._fallback.npgettext(context, msgid1, msgid2, n) + if n == 1: + tmsg = msgid1 + else: + tmsg = msgid2 + return tmsg + # Locate a .mo file using the gettext strategy def find(domain, localedir=None, languages=None, all=False): @@ -672,6 +709,26 @@ def ldngettext(domain, msgid1, msgid2, n): DeprecationWarning) return t.lngettext(msgid1, msgid2, n) + +def dpgettext(domain, context, message): + try: + t = translation(domain, _localedirs.get(domain, None)) + except OSError: + return message + return t.pgettext(context, message) + + +def dnpgettext(domain, context, msgid1, msgid2, n): + try: + t = translation(domain, _localedirs.get(domain, None)) + except OSError: + if n == 1: + return msgid1 + else: + return msgid2 + return t.npgettext(context, msgid1, msgid2, n) + + def gettext(message): return dgettext(_current_domain, message) @@ -696,6 +753,15 @@ def lngettext(msgid1, msgid2, n): DeprecationWarning) return ldngettext(_current_domain, msgid1, msgid2, n) + +def pgettext(context, message): + return dpgettext(_current_domain, context, message) + + +def npgettext(context, msgid1, msgid2, n): + return dnpgettext(_current_domain, context, msgid1, msgid2, n) + + # dcgettext() has been deemed unnecessary and is not implemented. # James Henstridge's Catalog constructor from GNOME gettext. Documented usage diff --git a/Lib/test/test_gettext.py b/Lib/test/test_gettext.py index bbad1028dcd8..8c0250eea1e7 100644 --- a/Lib/test/test_gettext.py +++ b/Lib/test/test_gettext.py @@ -15,23 +15,27 @@ # - Tests should have only one assert. GNU_MO_DATA = b'''\ -3hIElQAAAAAGAAAAHAAAAEwAAAALAAAAfAAAAAAAAACoAAAAFQAAAKkAAAAjAAAAvwAAAKEAAADj -AAAABwAAAIUBAAALAAAAjQEAAEUBAACZAQAAFgAAAN8CAAAeAAAA9gIAAKEAAAAVAwAABQAAALcD -AAAJAAAAvQMAAAEAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABQAAAAYAAAACAAAAAFJh -eW1vbmQgTHV4dXJ5IFlhY2gtdABUaGVyZSBpcyAlcyBmaWxlAFRoZXJlIGFyZSAlcyBmaWxlcwBU -aGlzIG1vZHVsZSBwcm92aWRlcyBpbnRlcm5hdGlvbmFsaXphdGlvbiBhbmQgbG9jYWxpemF0aW9u -CnN1cHBvcnQgZm9yIHlvdXIgUHl0aG9uIHByb2dyYW1zIGJ5IHByb3ZpZGluZyBhbiBpbnRlcmZh -Y2UgdG8gdGhlIEdOVQpnZXR0ZXh0IG1lc3NhZ2UgY2F0YWxvZyBsaWJyYXJ5LgBtdWxsdXNrAG51 -ZGdlIG51ZGdlAFByb2plY3QtSWQtVmVyc2lvbjogMi4wClBPLVJldmlzaW9uLURhdGU6IDIwMDAt -MDgtMjkgMTI6MTktMDQ6MDAKTGFzdC1UcmFuc2xhdG9yOiBKLiBEYXZpZCBJYsOhw7FleiA8ai1k -YXZpZEBub29zLmZyPgpMYW5ndWFnZS1UZWFtOiBYWCA8cHl0aG9uLWRldkBweXRob24ub3JnPgpN -SU1FLVZlcnNpb246IDEuMApDb250ZW50LVR5cGU6IHRleHQvcGxhaW47IGNoYXJzZXQ9aXNvLTg4 -NTktMQpDb250ZW50LVRyYW5zZmVyLUVuY29kaW5nOiBub25lCkdlbmVyYXRlZC1CeTogcHlnZXR0 -ZXh0LnB5IDEuMQpQbHVyYWwtRm9ybXM6IG5wbHVyYWxzPTI7IHBsdXJhbD1uIT0xOwoAVGhyb2F0 -d29iYmxlciBNYW5ncm92ZQBIYXkgJXMgZmljaGVybwBIYXkgJXMgZmljaGVyb3MAR3V2ZiB6YnFo -eXIgY2ViaXZxcmYgdmFncmVhbmd2YmFueXZtbmd2YmEgbmFxIHlicG55dm1uZ3ZiYQpmaGNjYmVn -IHNiZSBsYmhlIENsZ3ViYSBjZWJ0ZW56ZiBvbCBjZWJpdnF2YXQgbmEgdmFncmVzbnByIGdiIGd1 -ciBUQUgKdHJnZ3JrZyB6cmZmbnRyIHBuZ255YnQgeXZvZW5lbC4AYmFjb24Ad2luayB3aW5rAA== +3hIElQAAAAAJAAAAHAAAAGQAAAAAAAAArAAAAAAAAACsAAAAFQAAAK0AAAAjAAAAwwAAAKEAAADn +AAAAMAAAAIkBAAAHAAAAugEAABYAAADCAQAAHAAAANkBAAALAAAA9gEAAEIBAAACAgAAFgAAAEUD +AAAeAAAAXAMAAKEAAAB7AwAAMgAAAB0EAAAFAAAAUAQAABsAAABWBAAAIQAAAHIEAAAJAAAAlAQA +AABSYXltb25kIEx1eHVyeSBZYWNoLXQAVGhlcmUgaXMgJXMgZmlsZQBUaGVyZSBhcmUgJXMgZmls +ZXMAVGhpcyBtb2R1bGUgcHJvdmlkZXMgaW50ZXJuYXRpb25hbGl6YXRpb24gYW5kIGxvY2FsaXph +dGlvbgpzdXBwb3J0IGZvciB5b3VyIFB5dGhvbiBwcm9ncmFtcyBieSBwcm92aWRpbmcgYW4gaW50 +ZXJmYWNlIHRvIHRoZSBHTlUKZ2V0dGV4dCBtZXNzYWdlIGNhdGFsb2cgbGlicmFyeS4AV2l0aCBj +b250ZXh0BFRoZXJlIGlzICVzIGZpbGUAVGhlcmUgYXJlICVzIGZpbGVzAG11bGx1c2sAbXkgY29u +dGV4dARudWRnZSBudWRnZQBteSBvdGhlciBjb250ZXh0BG51ZGdlIG51ZGdlAG51ZGdlIG51ZGdl +AFByb2plY3QtSWQtVmVyc2lvbjogMi4wClBPLVJldmlzaW9uLURhdGU6IDIwMDMtMDQtMTEgMTQ6 +MzItMDQwMApMYXN0LVRyYW5zbGF0b3I6IEouIERhdmlkIEliYW5leiA8ai1kYXZpZEBub29zLmZy +PgpMYW5ndWFnZS1UZWFtOiBYWCA8cHl0aG9uLWRldkBweXRob24ub3JnPgpNSU1FLVZlcnNpb246 +IDEuMApDb250ZW50LVR5cGU6IHRleHQvcGxhaW47IGNoYXJzZXQ9aXNvLTg4NTktMQpDb250ZW50 +LVRyYW5zZmVyLUVuY29kaW5nOiA4Yml0CkdlbmVyYXRlZC1CeTogcHlnZXR0ZXh0LnB5IDEuMQpQ +bHVyYWwtRm9ybXM6IG5wbHVyYWxzPTI7IHBsdXJhbD1uIT0xOwoAVGhyb2F0d29iYmxlciBNYW5n +cm92ZQBIYXkgJXMgZmljaGVybwBIYXkgJXMgZmljaGVyb3MAR3V2ZiB6YnFoeXIgY2ViaXZxcmYg +dmFncmVhbmd2YmFueXZtbmd2YmEgbmFxIHlicG55dm1uZ3ZiYQpmaGNjYmVnIHNiZSBsYmhlIENs +Z3ViYSBjZWJ0ZW56ZiBvbCBjZWJpdnF2YXQgbmEgdmFncmVzbnByIGdiIGd1ciBUQUgKdHJnZ3Jr +ZyB6cmZmbnRyIHBuZ255YnQgeXZvZW5lbC4ASGF5ICVzIGZpY2hlcm8gKGNvbnRleHQpAEhheSAl +cyBmaWNoZXJvcyAoY29udGV4dCkAYmFjb24Ad2luayB3aW5rIChpbiAibXkgY29udGV4dCIpAHdp +bmsgd2luayAoaW4gIm15IG90aGVyIGNvbnRleHQiKQB3aW5rIHdpbmsA ''' # This data contains an invalid major version number (5) @@ -84,13 +88,13 @@ UMO_DATA = b'''\ -3hIElQAAAAACAAAAHAAAACwAAAAFAAAAPAAAAAAAAABQAAAABAAAAFEAAAAPAQAAVgAAAAQAAABm -AQAAAQAAAAIAAAAAAAAAAAAAAAAAAAAAYWLDngBQcm9qZWN0LUlkLVZlcnNpb246IDIuMApQTy1S -ZXZpc2lvbi1EYXRlOiAyMDAzLTA0LTExIDEyOjQyLTA0MDAKTGFzdC1UcmFuc2xhdG9yOiBCYXJy -eSBBLiBXQXJzYXcgPGJhcnJ5QHB5dGhvbi5vcmc+Ckxhbmd1YWdlLVRlYW06IFhYIDxweXRob24t -ZGV2QHB5dGhvbi5vcmc+Ck1JTUUtVmVyc2lvbjogMS4wCkNvbnRlbnQtVHlwZTogdGV4dC9wbGFp -bjsgY2hhcnNldD11dGYtOApDb250ZW50LVRyYW5zZmVyLUVuY29kaW5nOiA3Yml0CkdlbmVyYXRl -ZC1CeTogbWFudWFsbHkKAMKkeXoA +3hIElQAAAAADAAAAHAAAADQAAAAAAAAAAAAAAAAAAABMAAAABAAAAE0AAAAQAAAAUgAAAA8BAABj +AAAABAAAAHMBAAAWAAAAeAEAAABhYsOeAG15Y29udGV4dMOeBGFiw54AUHJvamVjdC1JZC1WZXJz +aW9uOiAyLjAKUE8tUmV2aXNpb24tRGF0ZTogMjAwMy0wNC0xMSAxMjo0Mi0wNDAwCkxhc3QtVHJh +bnNsYXRvcjogQmFycnkgQS4gV0Fyc2F3IDxiYXJyeUBweXRob24ub3JnPgpMYW5ndWFnZS1UZWFt +OiBYWCA8cHl0aG9uLWRldkBweXRob24ub3JnPgpNSU1FLVZlcnNpb246IDEuMApDb250ZW50LVR5 +cGU6IHRleHQvcGxhaW47IGNoYXJzZXQ9dXRmLTgKQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZzog +N2JpdApHZW5lcmF0ZWQtQnk6IG1hbnVhbGx5CgDCpHl6AMKkeXogKGNvbnRleHQgdmVyc2lvbikA ''' MMO_DATA = b'''\ @@ -147,7 +151,7 @@ def setUp(self): GettextBaseTest.setUp(self) self.localedir = os.curdir self.mofile = MOFILE - gettext.install('gettext', self.localedir) + gettext.install('gettext', self.localedir, names=['pgettext']) def test_some_translations(self): eq = self.assertEqual @@ -157,6 +161,13 @@ def test_some_translations(self): eq(_(r'Raymond Luxury Yach-t'), 'Throatwobbler Mangrove') eq(_(r'nudge nudge'), 'wink wink') + def test_some_translations_with_context(self): + eq = self.assertEqual + eq(pgettext('my context', 'nudge nudge'), + 'wink wink (in "my context")') + eq(pgettext('my other context', 'nudge nudge'), + 'wink wink (in "my other context")') + def test_double_quotes(self): eq = self.assertEqual # double quotes @@ -251,6 +262,20 @@ def test_some_translations(self): eq(self._(r'Raymond Luxury Yach-t'), 'Throatwobbler Mangrove') eq(self._(r'nudge nudge'), 'wink wink') + def test_some_translations_with_context(self): + eq = self.assertEqual + eq(gettext.pgettext('my context', 'nudge nudge'), + 'wink wink (in "my context")') + eq(gettext.pgettext('my other context', 'nudge nudge'), + 'wink wink (in "my other context")') + + def test_some_translations_with_context_and_domain(self): + eq = self.assertEqual + eq(gettext.dpgettext('gettext', 'my context', 'nudge nudge'), + 'wink wink (in "my context")') + eq(gettext.dpgettext('gettext', 'my other context', 'nudge nudge'), + 'wink wink (in "my other context")') + def test_double_quotes(self): eq = self.assertEqual # double quotes @@ -298,6 +323,15 @@ def test_plural_forms1(self): x = gettext.ngettext('There is %s file', 'There are %s files', 2) eq(x, 'Hay %s ficheros') + def test_plural_context_forms1(self): + eq = self.assertEqual + x = gettext.npgettext('With context', + 'There is %s file', 'There are %s files', 1) + eq(x, 'Hay %s fichero (context)') + x = gettext.npgettext('With context', + 'There is %s file', 'There are %s files', 2) + eq(x, 'Hay %s ficheros (context)') + def test_plural_forms2(self): eq = self.assertEqual with open(self.mofile, 'rb') as fp: @@ -307,6 +341,17 @@ def test_plural_forms2(self): x = t.ngettext('There is %s file', 'There are %s files', 2) eq(x, 'Hay %s ficheros') + def test_plural_context_forms2(self): + eq = self.assertEqual + with open(self.mofile, 'rb') as fp: + t = gettext.GNUTranslations(fp) + x = t.npgettext('With context', + 'There is %s file', 'There are %s files', 1) + eq(x, 'Hay %s fichero (context)') + x = t.npgettext('With context', + 'There is %s file', 'There are %s files', 2) + eq(x, 'Hay %s ficheros (context)') + # Examples from http://www.gnu.org/software/gettext/manual/gettext.html def test_ja(self): @@ -646,6 +691,7 @@ def setUp(self): with open(UMOFILE, 'rb') as fp: self.t = gettext.GNUTranslations(fp) self._ = self.t.gettext + self.pgettext = self.t.pgettext def test_unicode_msgid(self): self.assertIsInstance(self._(''), str) @@ -653,6 +699,53 @@ def test_unicode_msgid(self): def test_unicode_msgstr(self): self.assertEqual(self._('ab\xde'), '\xa4yz') + def test_unicode_context_msgstr(self): + t = self.pgettext('mycontext\xde', 'ab\xde') + self.assertTrue(isinstance(t, str)) + self.assertEqual(t, '\xa4yz (context version)') + + +class UnicodeTranslationsPluralTest(GettextBaseTest): + def setUp(self): + GettextBaseTest.setUp(self) + with open(MOFILE, 'rb') as fp: + self.t = gettext.GNUTranslations(fp) + self.ngettext = self.t.ngettext + self.npgettext = self.t.npgettext + + def test_unicode_msgid(self): + unless = self.assertTrue + unless(isinstance(self.ngettext('', '', 1), str)) + unless(isinstance(self.ngettext('', '', 2), str)) + + def test_unicode_context_msgid(self): + unless = self.assertTrue + unless(isinstance(self.npgettext('', '', '', 1), str)) + unless(isinstance(self.npgettext('', '', '', 2), str)) + + def test_unicode_msgstr(self): + eq = self.assertEqual + unless = self.assertTrue + t = self.ngettext("There is %s file", "There are %s files", 1) + unless(isinstance(t, str)) + eq(t, "Hay %s fichero") + unless(isinstance(t, str)) + t = self.ngettext("There is %s file", "There are %s files", 5) + unless(isinstance(t, str)) + eq(t, "Hay %s ficheros") + + def test_unicode_msgstr_with_context(self): + eq = self.assertEqual + unless = self.assertTrue + t = self.npgettext("With context", + "There is %s file", "There are %s files", 1) + unless(isinstance(t, str)) + eq(t, "Hay %s fichero (context)") + t = self.npgettext("With context", + "There is %s file", "There are %s files", 5) + unless(isinstance(t, str)) + eq(t, "Hay %s ficheros (context)") + class WeirdMetadataTest(GettextBaseTest): def setUp(self): @@ -750,6 +843,14 @@ def test__all__(self): msgid "nudge nudge" msgstr "wink wink" +msgctxt "my context" +msgid "nudge nudge" +msgstr "wink wink (in \"my context\")" + +msgctxt "my other context" +msgid "nudge nudge" +msgstr "wink wink (in \"my other context\")" + #: test_gettext.py:16 test_gettext.py:22 test_gettext.py:28 test_gettext.py:34 #: test_gettext.py:77 test_gettext.py:83 test_gettext.py:89 test_gettext.py:95 msgid "albatross" @@ -782,6 +883,14 @@ def test__all__(self): msgid_plural "There are %s files" msgstr[0] "Hay %s fichero" msgstr[1] "Hay %s ficheros" + +# Manually added, as neither pygettext nor xgettext support plural forms +# and context in Python. +msgctxt "With context" +msgid "There is %s file" +msgid_plural "There are %s files" +msgstr[0] "Hay %s fichero (context)" +msgstr[1] "Hay %s ficheros (context)" ''' # Here's the second example po file example, used to generate the UMO_DATA @@ -806,6 +915,11 @@ def test__all__(self): #: nofile:0 msgid "ab\xc3\x9e" msgstr "\xc2\xa4yz" + +#: nofile:1 +msgctxt "mycontext\xc3\x9e" +msgid "ab\xc3\x9e" +msgstr "\xc2\xa4yz (context version)" ''' # Here's the third example po file, used to generate MMO_DATA diff --git a/Misc/ACKS b/Misc/ACKS index aba60945a1e2..3e5fa0a2facc 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -559,6 +559,7 @@ Julian Gindi Yannick Gingras Neil Girdhar Matt Giuca +Franz Glasner Wim Glenn Michael Goderbauer Karan Goel diff --git a/Misc/NEWS.d/next/Library/2018-05-30-16-00-06.bpo-2504.BynUvU.rst b/Misc/NEWS.d/next/Library/2018-05-30-16-00-06.bpo-2504.BynUvU.rst new file mode 100644 index 000000000000..72b0f7044720 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-05-30-16-00-06.bpo-2504.BynUvU.rst @@ -0,0 +1 @@ +Add gettext.pgettext() and variants. diff --git a/Tools/i18n/msgfmt.py b/Tools/i18n/msgfmt.py index 63d52d1f46e5..3f731e941eaf 100755 --- a/Tools/i18n/msgfmt.py +++ b/Tools/i18n/msgfmt.py @@ -5,7 +5,8 @@ This program converts a textual Uniforum-style message catalog (.po file) into a binary GNU catalog (.mo file). This is essentially the same function as the -GNU msgfmt program, however, it is a simpler implementation. +GNU msgfmt program, however, it is a simpler implementation. Currently it +does not handle plural forms but it does handle message contexts. Usage: msgfmt.py [OPTIONS] filename.po @@ -32,12 +33,11 @@ import array from email.parser import HeaderParser -__version__ = "1.1" +__version__ = "1.2" MESSAGES = {} - def usage(code, msg=''): print(__doc__, file=sys.stderr) if msg: @@ -45,15 +45,16 @@ def usage(code, msg=''): sys.exit(code) - -def add(id, str, fuzzy): +def add(ctxt, id, str, fuzzy): "Add a non-fuzzy translation to the dictionary." global MESSAGES if not fuzzy and str: - MESSAGES[id] = str + if ctxt is None: + MESSAGES[id] = str + else: + MESSAGES[b"%b\x04%b" % (ctxt, id)] = str - def generate(): "Return the generated output." global MESSAGES @@ -95,10 +96,10 @@ def generate(): return output - def make(filename, outfile): ID = 1 STR = 2 + CTXT = 3 # Compute .mo name from .po name and arguments if filename.endswith('.po'): @@ -115,7 +116,7 @@ def make(filename, outfile): print(msg, file=sys.stderr) sys.exit(1) - section = None + section = msgctxt = None fuzzy = 0 # Start off assuming Latin-1, so everything decodes without failure, @@ -129,8 +130,8 @@ def make(filename, outfile): lno += 1 # If we get a comment line after a msgstr, this is a new entry if l[0] == '#' and section == STR: - add(msgid, msgstr, fuzzy) - section = None + add(msgctxt, msgid, msgstr, fuzzy) + section = msgctxt = None fuzzy = 0 # Record a fuzzy mark if l[:2] == '#,' and 'fuzzy' in l: @@ -138,10 +139,16 @@ def make(filename, outfile): # Skip comments if l[0] == '#': continue - # Now we are in a msgid section, output previous section - if l.startswith('msgid') and not l.startswith('msgid_plural'): + # Now we are in a msgid or msgctxt section, output previous section + if l.startswith('msgctxt'): + if section == STR: + add(msgctxt, msgid, msgstr, fuzzy) + section = CTXT + l = l[7:] + msgctxt = b'' + elif l.startswith('msgid') and not l.startswith('msgid_plural'): if section == STR: - add(msgid, msgstr, fuzzy) + add(msgctxt, msgid, msgstr, fuzzy) if not msgid: # See whether there is an encoding declaration p = HeaderParser() @@ -183,7 +190,9 @@ def make(filename, outfile): if not l: continue l = ast.literal_eval(l) - if section == ID: + if section == CTXT: + msgctxt += l.encode(encoding) + elif section == ID: msgid += l.encode(encoding) elif section == STR: msgstr += l.encode(encoding) @@ -194,7 +203,7 @@ def make(filename, outfile): sys.exit(1) # Add last entry if section == STR: - add(msgid, msgstr, fuzzy) + add(msgctxt, msgid, msgstr, fuzzy) # Compute output output = generate() @@ -206,7 +215,6 @@ def make(filename, outfile): print(msg, file=sys.stderr) - def main(): try: opts, args = getopt.getopt(sys.argv[1:], 'hVo:', From webhook-mailer at python.org Wed Nov 7 11:49:26 2018 From: webhook-mailer at python.org (Vinay Sajip) Date: Wed, 07 Nov 2018 16:49:26 -0000 Subject: [Python-checkins] bpo-32409: Fix regression in activate.bat on international Windows (GH-10295) Message-ID: https://github.com/python/cpython/commit/c64583b6d3e8516a8cd2b5f84fc1e300bfac2206 commit: c64583b6d3e8516a8cd2b5f84fc1e300bfac2206 branch: master author: samstagern <30337691+samstagern at users.noreply.github.com> committer: Vinay Sajip date: 2018-11-07T16:49:14Z summary: bpo-32409: Fix regression in activate.bat on international Windows (GH-10295) Handle Unicode contents on localised Windows systems when activating a venv. activate.bat currently breaks on German Windows systems, as chcp.com does not return a plain number as on English systems, but (arbitrarily) appends a dot at the end (for example "Aktive Codepage: 850." instead of "Active Codepage: 850"). The dependency to chcp.com is removed and ctypes is used to get, set and restore the console output code page. The code page for console input is not changed. We can't use __VENV_PYTHON__ to find python.exe, since it's UTF-8. cmd.exe decodes the script using the console output code page. files: A Misc/NEWS.d/next/Library/2018-11-02-12-01-00.bpo-32409.MFRX2Q.rst M Lib/venv/scripts/nt/activate.bat diff --git a/Lib/venv/scripts/nt/activate.bat b/Lib/venv/scripts/nt/activate.bat index 126049f495fe..2c81a28ce938 100644 --- a/Lib/venv/scripts/nt/activate.bat +++ b/Lib/venv/scripts/nt/activate.bat @@ -1,11 +1,10 @@ @echo off -rem This file is UTF-8 encoded, so we need to update the current code page while executing it -for /f "tokens=2 delims=:" %%a in ('"%SystemRoot%\System32\chcp.com"') do ( - set "_OLD_CODEPAGE=%%a" -) +rem This file is UTF-8 encoded, so we need to update the current code page while executing it. +for /f %%a in ('%~dp0python.exe -Ic "import ctypes; print(ctypes.windll.kernel32.GetConsoleOutputCP())"') do (set "_OLD_CODEPAGE=%%a") + if defined _OLD_CODEPAGE ( - "%SystemRoot%\System32\chcp.com" 65001 > nul + %~dp0python.exe -Ic "import ctypes; ctypes.windll.kernel32.SetConsoleOutputCP(65001)" ) set "VIRTUAL_ENV=__VENV_DIR__" @@ -40,6 +39,6 @@ set "PATH=%VIRTUAL_ENV%\__VENV_BIN_NAME__;%PATH%" :END if defined _OLD_CODEPAGE ( - "%SystemRoot%\System32\chcp.com" %_OLD_CODEPAGE% > nul + %~dp0python.exe -Ic "import ctypes; ctypes.windll.kernel32.SetConsoleOutputCP(%_OLD_CODEPAGE%)" set "_OLD_CODEPAGE=" ) diff --git a/Misc/NEWS.d/next/Library/2018-11-02-12-01-00.bpo-32409.MFRX2Q.rst b/Misc/NEWS.d/next/Library/2018-11-02-12-01-00.bpo-32409.MFRX2Q.rst new file mode 100644 index 000000000000..9b57c5b89ae5 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-11-02-12-01-00.bpo-32409.MFRX2Q.rst @@ -0,0 +1,2 @@ +Fixed implementation of :file:`activate.bat` to handle Unicode contents on +localized Windows systems (eg. German). Patch by Martin Bijl. \ No newline at end of file From webhook-mailer at python.org Wed Nov 7 12:06:49 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Wed, 07 Nov 2018 17:06:49 -0000 Subject: [Python-checkins] Mark -c and -O as command line options in reStructuredText. (GH-10103) Message-ID: https://github.com/python/cpython/commit/ea6a28c9f7e4baa5fe775cebce697a14a7d7da8b commit: ea6a28c9f7e4baa5fe775cebce697a14a7d7da8b branch: master author: Andr?s Delfino committer: Serhiy Storchaka date: 2018-11-07T19:06:45+02:00 summary: Mark -c and -O as command line options in reStructuredText. (GH-10103) files: M Doc/reference/executionmodel.rst M Doc/reference/import.rst M Doc/reference/simple_stmts.rst diff --git a/Doc/reference/executionmodel.rst b/Doc/reference/executionmodel.rst index 5c83181440bc..1a69e972f2cb 100644 --- a/Doc/reference/executionmodel.rst +++ b/Doc/reference/executionmodel.rst @@ -22,7 +22,7 @@ The following are blocks: a module, a function body, and a class definition. Each command typed interactively is a block. A script file (a file given as standard input to the interpreter or specified as a command line argument to the interpreter) is a code block. A script command (a command specified on the -interpreter command line with the '**-c**' option) is a code block. The string +interpreter command line with the :option:`-c` option) is a code block. The string argument passed to the built-in functions :func:`eval` and :func:`exec` is a code block. diff --git a/Doc/reference/import.rst b/Doc/reference/import.rst index 7c4f275a4342..d36d7d6a707e 100644 --- a/Doc/reference/import.rst +++ b/Doc/reference/import.rst @@ -951,7 +951,7 @@ In :ref:`the remaining cases ` :mod:`__main__` does not correspond directly with an importable module: - interactive prompt -- -c switch +- :option:`-c` option - running from stdin - running directly from a source or bytecode file diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst index 1fe1cde1d8d2..5198c0408ce2 100644 --- a/Doc/reference/simple_stmts.rst +++ b/Doc/reference/simple_stmts.rst @@ -402,7 +402,7 @@ The extended form, ``assert expression1, expression2``, is equivalent to :: These equivalences assume that :const:`__debug__` and :exc:`AssertionError` refer to the built-in variables with those names. In the current implementation, the built-in variable :const:`__debug__` is ``True`` under normal circumstances, -``False`` when optimization is requested (command line option -O). The current +``False`` when optimization is requested (command line option :option:`-O`). The current code generator emits no code for an assert statement when optimization is requested at compile time. Note that it is unnecessary to include the source code for the expression that failed in the error message; it will be displayed From webhook-mailer at python.org Wed Nov 7 12:22:52 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Wed, 07 Nov 2018 17:22:52 -0000 Subject: [Python-checkins] Mark len call as a code snippet in stdtypes.rst. (GH-9804) Message-ID: https://github.com/python/cpython/commit/ca03f3b93ee5c2943a2b8cbf9447f99f835ec672 commit: ca03f3b93ee5c2943a2b8cbf9447f99f835ec672 branch: master author: Andr?s Delfino committer: Serhiy Storchaka date: 2018-11-07T19:22:47+02:00 summary: Mark len call as a code snippet in stdtypes.rst. (GH-9804) files: M Doc/library/stdtypes.rst diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 49d433805a32..18cd0b06885a 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -3809,7 +3809,7 @@ copying. ``nbytes == product(shape) * itemsize == len(m.tobytes())``. This is the amount of space in bytes that the array would use in a contiguous - representation. It is not necessarily equal to len(m):: + representation. It is not necessarily equal to ``len(m)``:: >>> import array >>> a = array.array('i', [1,2,3,4,5]) From webhook-mailer at python.org Wed Nov 7 12:25:00 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Wed, 07 Nov 2018 17:25:00 -0000 Subject: [Python-checkins] Correct grammar mistakes in string.rst. (GH-9752) Message-ID: https://github.com/python/cpython/commit/d64991031e4c86ce0331caac16770757511dd025 commit: d64991031e4c86ce0331caac16770757511dd025 branch: master author: Andr?s Delfino committer: Serhiy Storchaka date: 2018-11-07T19:24:56+02:00 summary: Correct grammar mistakes in string.rst. (GH-9752) files: M Doc/library/string.rst diff --git a/Doc/library/string.rst b/Doc/library/string.rst index d0ef089a41a6..46b2bfc82b73 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -551,7 +551,7 @@ addition of the ``{}`` and with ``:`` used instead of ``%``. For example, ``'%03.2f'`` can be translated to ``'{:03.2f}'``. The new format syntax also supports new and different options, shown in the -follow examples. +following examples. Accessing arguments by position:: @@ -739,7 +739,7 @@ these rules. The methods of :class:`Template` are: simply return ``$`` instead of raising :exc:`ValueError`. While other exceptions may still occur, this method is called "safe" - because substitutions always tries to return a usable string instead of + because it always tries to return a usable string instead of raising an exception. In another sense, :meth:`safe_substitute` may be anything other than safe, since it will silently ignore malformed templates containing dangling delimiters, unmatched braces, or From webhook-mailer at python.org Wed Nov 7 12:29:17 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Wed, 07 Nov 2018 17:29:17 -0000 Subject: [Python-checkins] Fix markup for xml.sax in 3.8 notes. (GH-9603) Message-ID: https://github.com/python/cpython/commit/ca68261c751009b8b4cb82e009b9c928405d5839 commit: ca68261c751009b8b4cb82e009b9c928405d5839 branch: master author: Andr?s Delfino committer: Serhiy Storchaka date: 2018-11-07T19:29:14+02:00 summary: Fix markup for xml.sax in 3.8 notes. (GH-9603) files: M Doc/whatsnew/3.8.rst diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index 7b9a9407f0dc..74bdba3375c9 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -244,7 +244,7 @@ xml --- * As mitigation against DTD and external entity retrieval, the - :mod:`xml.dom.minidom` and mod:`xml.sax` modules no longer process + :mod:`xml.dom.minidom` and :mod:`xml.sax` modules no longer process external entities by default. (Contributed by Christian Heimes in :issue:`17239`.) @@ -454,7 +454,7 @@ Changes in the Python API * :class:`uuid.UUID` now uses ``__slots__``, therefore instances can no longer be weak-referenced and attributes can no longer be added. -* :mod:`xml.dom.minidom` and mod:`xml.sax` modules no longer process +* :mod:`xml.dom.minidom` and :mod:`xml.sax` modules no longer process external entities by default. (Contributed by Christian Heimes in :issue:`17239`.) From webhook-mailer at python.org Wed Nov 7 12:32:21 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Wed, 07 Nov 2018 17:32:21 -0000 Subject: [Python-checkins] Add future_stmt to simple_stmt production list. (GH-8239) Message-ID: https://github.com/python/cpython/commit/cdb96f45b61a40a7e7c4c83b4b1f14ef6f5cf4fa commit: cdb96f45b61a40a7e7c4c83b4b1f14ef6f5cf4fa branch: master author: Andr?s Delfino committer: Serhiy Storchaka date: 2018-11-07T19:32:18+02:00 summary: Add future_stmt to simple_stmt production list. (GH-8239) files: M Doc/reference/simple_stmts.rst diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst index 5198c0408ce2..d509700f7507 100644 --- a/Doc/reference/simple_stmts.rst +++ b/Doc/reference/simple_stmts.rst @@ -25,6 +25,7 @@ simple statements is: : | `break_stmt` : | `continue_stmt` : | `import_stmt` + : | `future_stmt` : | `global_stmt` : | `nonlocal_stmt` From webhook-mailer at python.org Wed Nov 7 12:53:31 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 07 Nov 2018 17:53:31 -0000 Subject: [Python-checkins] Mark -c and -O as command line options in reStructuredText. (GH-10103) Message-ID: https://github.com/python/cpython/commit/76023169f0a8f14c3d49b10a4813649974d9188c commit: 76023169f0a8f14c3d49b10a4813649974d9188c branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-07T09:53:20-08:00 summary: Mark -c and -O as command line options in reStructuredText. (GH-10103) (cherry picked from commit ea6a28c9f7e4baa5fe775cebce697a14a7d7da8b) Co-authored-by: Andr?s Delfino files: M Doc/reference/executionmodel.rst M Doc/reference/import.rst M Doc/reference/simple_stmts.rst diff --git a/Doc/reference/executionmodel.rst b/Doc/reference/executionmodel.rst index 5c83181440bc..1a69e972f2cb 100644 --- a/Doc/reference/executionmodel.rst +++ b/Doc/reference/executionmodel.rst @@ -22,7 +22,7 @@ The following are blocks: a module, a function body, and a class definition. Each command typed interactively is a block. A script file (a file given as standard input to the interpreter or specified as a command line argument to the interpreter) is a code block. A script command (a command specified on the -interpreter command line with the '**-c**' option) is a code block. The string +interpreter command line with the :option:`-c` option) is a code block. The string argument passed to the built-in functions :func:`eval` and :func:`exec` is a code block. diff --git a/Doc/reference/import.rst b/Doc/reference/import.rst index 7c4f275a4342..d36d7d6a707e 100644 --- a/Doc/reference/import.rst +++ b/Doc/reference/import.rst @@ -951,7 +951,7 @@ In :ref:`the remaining cases ` :mod:`__main__` does not correspond directly with an importable module: - interactive prompt -- -c switch +- :option:`-c` option - running from stdin - running directly from a source or bytecode file diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst index 013ea9195395..bc9daae5bb5b 100644 --- a/Doc/reference/simple_stmts.rst +++ b/Doc/reference/simple_stmts.rst @@ -402,7 +402,7 @@ The extended form, ``assert expression1, expression2``, is equivalent to :: These equivalences assume that :const:`__debug__` and :exc:`AssertionError` refer to the built-in variables with those names. In the current implementation, the built-in variable :const:`__debug__` is ``True`` under normal circumstances, -``False`` when optimization is requested (command line option -O). The current +``False`` when optimization is requested (command line option :option:`-O`). The current code generator emits no code for an assert statement when optimization is requested at compile time. Note that it is unnecessary to include the source code for the expression that failed in the error message; it will be displayed From webhook-mailer at python.org Wed Nov 7 12:53:31 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 07 Nov 2018 17:53:31 -0000 Subject: [Python-checkins] Mark -c and -O as command line options in reStructuredText. (GH-10103) Message-ID: https://github.com/python/cpython/commit/e422de828fba695a49dc7e9cbef30e87d4c4f249 commit: e422de828fba695a49dc7e9cbef30e87d4c4f249 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-07T09:53:27-08:00 summary: Mark -c and -O as command line options in reStructuredText. (GH-10103) (cherry picked from commit ea6a28c9f7e4baa5fe775cebce697a14a7d7da8b) Co-authored-by: Andr?s Delfino files: M Doc/reference/executionmodel.rst M Doc/reference/import.rst M Doc/reference/simple_stmts.rst diff --git a/Doc/reference/executionmodel.rst b/Doc/reference/executionmodel.rst index 5c83181440bc..1a69e972f2cb 100644 --- a/Doc/reference/executionmodel.rst +++ b/Doc/reference/executionmodel.rst @@ -22,7 +22,7 @@ The following are blocks: a module, a function body, and a class definition. Each command typed interactively is a block. A script file (a file given as standard input to the interpreter or specified as a command line argument to the interpreter) is a code block. A script command (a command specified on the -interpreter command line with the '**-c**' option) is a code block. The string +interpreter command line with the :option:`-c` option) is a code block. The string argument passed to the built-in functions :func:`eval` and :func:`exec` is a code block. diff --git a/Doc/reference/import.rst b/Doc/reference/import.rst index c3a20314f79d..b295eed9d802 100644 --- a/Doc/reference/import.rst +++ b/Doc/reference/import.rst @@ -925,7 +925,7 @@ In :ref:`the remaining cases ` :mod:`__main__` does not correspond directly with an importable module: - interactive prompt -- -c switch +- :option:`-c` option - running from stdin - running directly from a source or bytecode file diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst index 9246939dbdac..3ab0029698c7 100644 --- a/Doc/reference/simple_stmts.rst +++ b/Doc/reference/simple_stmts.rst @@ -402,7 +402,7 @@ The extended form, ``assert expression1, expression2``, is equivalent to :: These equivalences assume that :const:`__debug__` and :exc:`AssertionError` refer to the built-in variables with those names. In the current implementation, the built-in variable :const:`__debug__` is ``True`` under normal circumstances, -``False`` when optimization is requested (command line option -O). The current +``False`` when optimization is requested (command line option :option:`-O`). The current code generator emits no code for an assert statement when optimization is requested at compile time. Note that it is unnecessary to include the source code for the expression that failed in the error message; it will be displayed From webhook-mailer at python.org Wed Nov 7 12:54:44 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 07 Nov 2018 17:54:44 -0000 Subject: [Python-checkins] Mark len call as a code snippet in stdtypes.rst. (GH-9804) Message-ID: https://github.com/python/cpython/commit/f455dd53af9dc1ebe58e0f87cc2ff08ee27c54d7 commit: f455dd53af9dc1ebe58e0f87cc2ff08ee27c54d7 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-07T09:54:41-08:00 summary: Mark len call as a code snippet in stdtypes.rst. (GH-9804) (cherry picked from commit ca03f3b93ee5c2943a2b8cbf9447f99f835ec672) Co-authored-by: Andr?s Delfino files: M Doc/library/stdtypes.rst diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index da16b0748ad0..968c9992961b 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -3771,7 +3771,7 @@ copying. ``nbytes == product(shape) * itemsize == len(m.tobytes())``. This is the amount of space in bytes that the array would use in a contiguous - representation. It is not necessarily equal to len(m):: + representation. It is not necessarily equal to ``len(m)``:: >>> import array >>> a = array.array('i', [1,2,3,4,5]) From webhook-mailer at python.org Wed Nov 7 12:54:51 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 07 Nov 2018 17:54:51 -0000 Subject: [Python-checkins] Mark len call as a code snippet in stdtypes.rst. (GH-9804) Message-ID: https://github.com/python/cpython/commit/55e1173c4f9a2c8b9f6ea7e54950ce50ec850efb commit: 55e1173c4f9a2c8b9f6ea7e54950ce50ec850efb branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-07T09:54:48-08:00 summary: Mark len call as a code snippet in stdtypes.rst. (GH-9804) (cherry picked from commit ca03f3b93ee5c2943a2b8cbf9447f99f835ec672) Co-authored-by: Andr?s Delfino files: M Doc/library/stdtypes.rst diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 23e6c917b9dd..a5fca9d46900 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -3743,7 +3743,7 @@ copying. ``nbytes == product(shape) * itemsize == len(m.tobytes())``. This is the amount of space in bytes that the array would use in a contiguous - representation. It is not necessarily equal to len(m):: + representation. It is not necessarily equal to ``len(m)``:: >>> import array >>> a = array.array('i', [1,2,3,4,5]) From webhook-mailer at python.org Wed Nov 7 12:54:59 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 07 Nov 2018 17:54:59 -0000 Subject: [Python-checkins] Correct grammar mistakes in string.rst. (GH-9752) Message-ID: https://github.com/python/cpython/commit/766d8f560d96ed06eb842460998d20c9cc58c76c commit: 766d8f560d96ed06eb842460998d20c9cc58c76c branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-07T09:54:55-08:00 summary: Correct grammar mistakes in string.rst. (GH-9752) (cherry picked from commit d64991031e4c86ce0331caac16770757511dd025) Co-authored-by: Andr?s Delfino files: M Doc/library/string.rst diff --git a/Doc/library/string.rst b/Doc/library/string.rst index d0ef089a41a6..46b2bfc82b73 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -551,7 +551,7 @@ addition of the ``{}`` and with ``:`` used instead of ``%``. For example, ``'%03.2f'`` can be translated to ``'{:03.2f}'``. The new format syntax also supports new and different options, shown in the -follow examples. +following examples. Accessing arguments by position:: @@ -739,7 +739,7 @@ these rules. The methods of :class:`Template` are: simply return ``$`` instead of raising :exc:`ValueError`. While other exceptions may still occur, this method is called "safe" - because substitutions always tries to return a usable string instead of + because it always tries to return a usable string instead of raising an exception. In another sense, :meth:`safe_substitute` may be anything other than safe, since it will silently ignore malformed templates containing dangling delimiters, unmatched braces, or From webhook-mailer at python.org Wed Nov 7 12:55:06 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 07 Nov 2018 17:55:06 -0000 Subject: [Python-checkins] Correct grammar mistakes in string.rst. (GH-9752) Message-ID: https://github.com/python/cpython/commit/0d9896db1638e924a4215772ffc0251e16304b9f commit: 0d9896db1638e924a4215772ffc0251e16304b9f branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-07T09:55:02-08:00 summary: Correct grammar mistakes in string.rst. (GH-9752) (cherry picked from commit d64991031e4c86ce0331caac16770757511dd025) Co-authored-by: Andr?s Delfino files: M Doc/library/string.rst diff --git a/Doc/library/string.rst b/Doc/library/string.rst index 007ce84e78f4..f5c22910c83b 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -551,7 +551,7 @@ addition of the ``{}`` and with ``:`` used instead of ``%``. For example, ``'%03.2f'`` can be translated to ``'{:03.2f}'``. The new format syntax also supports new and different options, shown in the -follow examples. +following examples. Accessing arguments by position:: @@ -739,7 +739,7 @@ these rules. The methods of :class:`Template` are: simply return ``$`` instead of raising :exc:`ValueError`. While other exceptions may still occur, this method is called "safe" - because substitutions always tries to return a usable string instead of + because it always tries to return a usable string instead of raising an exception. In another sense, :meth:`safe_substitute` may be anything other than safe, since it will silently ignore malformed templates containing dangling delimiters, unmatched braces, or From webhook-mailer at python.org Wed Nov 7 12:55:11 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 07 Nov 2018 17:55:11 -0000 Subject: [Python-checkins] Correct grammar mistakes in string.rst. (GH-9752) Message-ID: https://github.com/python/cpython/commit/830f26d11e87505f116ebfd1c1a9881c18ede8ab commit: 830f26d11e87505f116ebfd1c1a9881c18ede8ab branch: 2.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-07T09:55:07-08:00 summary: Correct grammar mistakes in string.rst. (GH-9752) (cherry picked from commit d64991031e4c86ce0331caac16770757511dd025) Co-authored-by: Andr?s Delfino files: M Doc/library/string.rst diff --git a/Doc/library/string.rst b/Doc/library/string.rst index f8d41f9d6766..7eedc86f5856 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -522,7 +522,7 @@ addition of the ``{}`` and with ``:`` used instead of ``%``. For example, ``'%03.2f'`` can be translated to ``'{:03.2f}'``. The new format syntax also supports new and different options, shown in the -follow examples. +following examples. Accessing arguments by position:: @@ -701,7 +701,7 @@ these rules. The methods of :class:`Template` are: simply return ``$`` instead of raising :exc:`ValueError`. While other exceptions may still occur, this method is called "safe" - because substitutions always tries to return a usable string instead of + because it always tries to return a usable string instead of raising an exception. In another sense, :meth:`safe_substitute` may be anything other than safe, since it will silently ignore malformed templates containing dangling delimiters, unmatched braces, or From webhook-mailer at python.org Wed Nov 7 12:55:18 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 07 Nov 2018 17:55:18 -0000 Subject: [Python-checkins] Add future_stmt to simple_stmt production list. (GH-8239) Message-ID: https://github.com/python/cpython/commit/2911d4eb21342d9eae46893030756aa86489ba4c commit: 2911d4eb21342d9eae46893030756aa86489ba4c branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-07T09:55:14-08:00 summary: Add future_stmt to simple_stmt production list. (GH-8239) (cherry picked from commit cdb96f45b61a40a7e7c4c83b4b1f14ef6f5cf4fa) Co-authored-by: Andr?s Delfino files: M Doc/reference/simple_stmts.rst diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst index bc9daae5bb5b..be2673b5bad1 100644 --- a/Doc/reference/simple_stmts.rst +++ b/Doc/reference/simple_stmts.rst @@ -25,6 +25,7 @@ simple statements is: : | `break_stmt` : | `continue_stmt` : | `import_stmt` + : | `future_stmt` : | `global_stmt` : | `nonlocal_stmt` From webhook-mailer at python.org Wed Nov 7 12:59:49 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Wed, 07 Nov 2018 17:59:49 -0000 Subject: [Python-checkins] Add a reference to the name mangling description in the tutorial to the index. (GH-10138) Message-ID: https://github.com/python/cpython/commit/c5eec4426d9144b2255500217d0e3ff9463d2770 commit: c5eec4426d9144b2255500217d0e3ff9463d2770 branch: master author: Andr?s Delfino committer: Serhiy Storchaka date: 2018-11-07T19:59:45+02:00 summary: Add a reference to the name mangling description in the tutorial to the index. (GH-10138) files: M Doc/tutorial/classes.rst diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst index 7d3b823a14e0..edbc43fb1b5d 100644 --- a/Doc/tutorial/classes.rst +++ b/Doc/tutorial/classes.rst @@ -672,6 +672,9 @@ be treated as a non-public part of the API (whether it is a function, a method or a data member). It should be considered an implementation detail and subject to change without notice. +.. index:: + pair: name; mangling + Since there is a valid use-case for class-private members (namely to avoid name clashes of names with names defined by subclasses), there is limited support for such a mechanism, called :dfn:`name mangling`. Any identifier of the form From webhook-mailer at python.org Wed Nov 7 13:09:16 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Wed, 07 Nov 2018 18:09:16 -0000 Subject: [Python-checkins] glob uses fnmatch.filter instead of fnmatch since 2001. (GH-10102) Message-ID: https://github.com/python/cpython/commit/ae31e3fbf4e7def772fc1c94342d1011424fdc99 commit: ae31e3fbf4e7def772fc1c94342d1011424fdc99 branch: master author: Andr?s Delfino committer: Serhiy Storchaka date: 2018-11-07T20:09:11+02:00 summary: glob uses fnmatch.filter instead of fnmatch since 2001. (GH-10102) files: M Doc/library/fnmatch.rst diff --git a/Doc/library/fnmatch.rst b/Doc/library/fnmatch.rst index ecba4aa1ba4c..ce07d326b395 100644 --- a/Doc/library/fnmatch.rst +++ b/Doc/library/fnmatch.rst @@ -42,7 +42,7 @@ For example, ``'[?]'`` matches the character ``'?'``. Note that the filename separator (``'/'`` on Unix) is *not* special to this module. See module :mod:`glob` for pathname expansion (:mod:`glob` uses -:func:`fnmatch` to match pathname segments). Similarly, filenames starting with +:func:`.filter` to match pathname segments). Similarly, filenames starting with a period are not special for this module, and are matched by the ``*`` and ``?`` patterns. From webhook-mailer at python.org Wed Nov 7 13:12:19 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Wed, 07 Nov 2018 18:12:19 -0000 Subject: [Python-checkins] Add link to PEP 525 in Expressions. (GH-10333) Message-ID: https://github.com/python/cpython/commit/bfe1839aa994f0d84471254418a4ecfa7c7c9b9c commit: bfe1839aa994f0d84471254418a4ecfa7c7c9b9c branch: master author: Andr?s Delfino committer: Serhiy Storchaka date: 2018-11-07T20:12:12+02:00 summary: Add link to PEP 525 in Expressions. (GH-10333) files: M Doc/reference/expressions.rst diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst index fd7df4cfba97..fb27857a6f42 100644 --- a/Doc/reference/expressions.rst +++ b/Doc/reference/expressions.rst @@ -418,7 +418,7 @@ coroutine function to be an asynchronous generator. For example:: def gen(): # defines a generator function yield 123 - async def agen(): # defines an asynchronous generator function (PEP 525) + async def agen(): # defines an asynchronous generator function yield 123 Due to their side effects on the containing scope, ``yield`` expressions @@ -501,6 +501,10 @@ on the right hand side of an assignment statement. The proposal to introduce the :token:`yield_from` syntax, making delegation to sub-generators easy. + :pep:`525` - Asynchronous Generators + The proposal that expanded on :pep:`492` by adding generator capabilities to + coroutine functions. + .. index:: object: generator .. _generator-methods: From webhook-mailer at python.org Wed Nov 7 13:30:04 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 07 Nov 2018 18:30:04 -0000 Subject: [Python-checkins] Add a reference to the name mangling description in the tutorial to the index. (GH-10138) Message-ID: https://github.com/python/cpython/commit/b949f74f4b055c1503561e0fdd674ff20f62db05 commit: b949f74f4b055c1503561e0fdd674ff20f62db05 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-07T10:29:58-08:00 summary: Add a reference to the name mangling description in the tutorial to the index. (GH-10138) (cherry picked from commit c5eec4426d9144b2255500217d0e3ff9463d2770) Co-authored-by: Andr?s Delfino files: M Doc/tutorial/classes.rst diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst index 487d535e169b..914da426df36 100644 --- a/Doc/tutorial/classes.rst +++ b/Doc/tutorial/classes.rst @@ -672,6 +672,9 @@ be treated as a non-public part of the API (whether it is a function, a method or a data member). It should be considered an implementation detail and subject to change without notice. +.. index:: + pair: name; mangling + Since there is a valid use-case for class-private members (namely to avoid name clashes of names with names defined by subclasses), there is limited support for such a mechanism, called :dfn:`name mangling`. Any identifier of the form From webhook-mailer at python.org Wed Nov 7 13:30:10 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 07 Nov 2018 18:30:10 -0000 Subject: [Python-checkins] Add a reference to the name mangling description in the tutorial to the index. (GH-10138) Message-ID: https://github.com/python/cpython/commit/a5bd0d3c300e27652fd364a2516ee30d17ba1cf5 commit: a5bd0d3c300e27652fd364a2516ee30d17ba1cf5 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-07T10:30:06-08:00 summary: Add a reference to the name mangling description in the tutorial to the index. (GH-10138) (cherry picked from commit c5eec4426d9144b2255500217d0e3ff9463d2770) Co-authored-by: Andr?s Delfino files: M Doc/tutorial/classes.rst diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst index 487d535e169b..914da426df36 100644 --- a/Doc/tutorial/classes.rst +++ b/Doc/tutorial/classes.rst @@ -672,6 +672,9 @@ be treated as a non-public part of the API (whether it is a function, a method or a data member). It should be considered an implementation detail and subject to change without notice. +.. index:: + pair: name; mangling + Since there is a valid use-case for class-private members (namely to avoid name clashes of names with names defined by subclasses), there is limited support for such a mechanism, called :dfn:`name mangling`. Any identifier of the form From webhook-mailer at python.org Wed Nov 7 13:30:16 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 07 Nov 2018 18:30:16 -0000 Subject: [Python-checkins] Add a reference to the name mangling description in the tutorial to the index. (GH-10138) Message-ID: https://github.com/python/cpython/commit/d06b60fca35dd597a6009c643c90a6601a365932 commit: d06b60fca35dd597a6009c643c90a6601a365932 branch: 2.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-07T10:30:12-08:00 summary: Add a reference to the name mangling description in the tutorial to the index. (GH-10138) (cherry picked from commit c5eec4426d9144b2255500217d0e3ff9463d2770) Co-authored-by: Andr?s Delfino files: M Doc/tutorial/classes.rst diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst index 9935ccb92725..b17e150cff04 100644 --- a/Doc/tutorial/classes.rst +++ b/Doc/tutorial/classes.rst @@ -620,6 +620,9 @@ be treated as a non-public part of the API (whether it is a function, a method or a data member). It should be considered an implementation detail and subject to change without notice. +.. index:: + pair: name; mangling + Since there is a valid use-case for class-private members (namely to avoid name clashes of names with names defined by subclasses), there is limited support for such a mechanism, called :dfn:`name mangling`. Any identifier of the form From webhook-mailer at python.org Wed Nov 7 13:30:22 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 07 Nov 2018 18:30:22 -0000 Subject: [Python-checkins] glob uses fnmatch.filter instead of fnmatch since 2001. (GH-10102) Message-ID: https://github.com/python/cpython/commit/38bdaa47cfd2591c90d1fe0a958a3870750248a5 commit: 38bdaa47cfd2591c90d1fe0a958a3870750248a5 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-07T10:30:18-08:00 summary: glob uses fnmatch.filter instead of fnmatch since 2001. (GH-10102) (cherry picked from commit ae31e3fbf4e7def772fc1c94342d1011424fdc99) Co-authored-by: Andr?s Delfino files: M Doc/library/fnmatch.rst diff --git a/Doc/library/fnmatch.rst b/Doc/library/fnmatch.rst index ecba4aa1ba4c..ce07d326b395 100644 --- a/Doc/library/fnmatch.rst +++ b/Doc/library/fnmatch.rst @@ -42,7 +42,7 @@ For example, ``'[?]'`` matches the character ``'?'``. Note that the filename separator (``'/'`` on Unix) is *not* special to this module. See module :mod:`glob` for pathname expansion (:mod:`glob` uses -:func:`fnmatch` to match pathname segments). Similarly, filenames starting with +:func:`.filter` to match pathname segments). Similarly, filenames starting with a period are not special for this module, and are matched by the ``*`` and ``?`` patterns. From webhook-mailer at python.org Wed Nov 7 13:30:31 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 07 Nov 2018 18:30:31 -0000 Subject: [Python-checkins] glob uses fnmatch.filter instead of fnmatch since 2001. (GH-10102) Message-ID: https://github.com/python/cpython/commit/3ede2b1da6be6c63c688b90f058bfbd15b94c52b commit: 3ede2b1da6be6c63c688b90f058bfbd15b94c52b branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-07T10:30:27-08:00 summary: glob uses fnmatch.filter instead of fnmatch since 2001. (GH-10102) (cherry picked from commit ae31e3fbf4e7def772fc1c94342d1011424fdc99) Co-authored-by: Andr?s Delfino files: M Doc/library/fnmatch.rst diff --git a/Doc/library/fnmatch.rst b/Doc/library/fnmatch.rst index 48dc5e5dde16..fb0a1e332326 100644 --- a/Doc/library/fnmatch.rst +++ b/Doc/library/fnmatch.rst @@ -42,7 +42,7 @@ For example, ``'[?]'`` matches the character ``'?'``. Note that the filename separator (``'/'`` on Unix) is *not* special to this module. See module :mod:`glob` for pathname expansion (:mod:`glob` uses -:func:`fnmatch` to match pathname segments). Similarly, filenames starting with +:func:`.filter` to match pathname segments). Similarly, filenames starting with a period are not special for this module, and are matched by the ``*`` and ``?`` patterns. From webhook-mailer at python.org Wed Nov 7 13:30:35 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 07 Nov 2018 18:30:35 -0000 Subject: [Python-checkins] glob uses fnmatch.filter instead of fnmatch since 2001. (GH-10102) Message-ID: https://github.com/python/cpython/commit/322f8bc68cf3333db53882261fdebef0044b71e6 commit: 322f8bc68cf3333db53882261fdebef0044b71e6 branch: 2.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-07T10:30:31-08:00 summary: glob uses fnmatch.filter instead of fnmatch since 2001. (GH-10102) (cherry picked from commit ae31e3fbf4e7def772fc1c94342d1011424fdc99) Co-authored-by: Andr?s Delfino files: M Doc/library/fnmatch.rst diff --git a/Doc/library/fnmatch.rst b/Doc/library/fnmatch.rst index 42bbf7452fe7..8618f5f4a9a4 100644 --- a/Doc/library/fnmatch.rst +++ b/Doc/library/fnmatch.rst @@ -36,7 +36,7 @@ For example, ``'[?]'`` matches the character ``'?'``. Note that the filename separator (``'/'`` on Unix) is *not* special to this module. See module :mod:`glob` for pathname expansion (:mod:`glob` uses -:func:`fnmatch` to match pathname segments). Similarly, filenames starting with +:func:`.filter` to match pathname segments). Similarly, filenames starting with a period are not special for this module, and are matched by the ``*`` and ``?`` patterns. From webhook-mailer at python.org Wed Nov 7 13:32:09 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 07 Nov 2018 18:32:09 -0000 Subject: [Python-checkins] Add link to PEP 525 in Expressions. (GH-10333) Message-ID: https://github.com/python/cpython/commit/e40e205498b45cb0d6a12d2cc79a3c75712cd054 commit: e40e205498b45cb0d6a12d2cc79a3c75712cd054 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-07T10:32:05-08:00 summary: Add link to PEP 525 in Expressions. (GH-10333) (cherry picked from commit bfe1839aa994f0d84471254418a4ecfa7c7c9b9c) Co-authored-by: Andr?s Delfino files: M Doc/reference/expressions.rst diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst index de9ff57e5ecd..3b50efe5e277 100644 --- a/Doc/reference/expressions.rst +++ b/Doc/reference/expressions.rst @@ -421,7 +421,7 @@ coroutine function to be an asynchronous generator. For example:: def gen(): # defines a generator function yield 123 - async def agen(): # defines an asynchronous generator function (PEP 525) + async def agen(): # defines an asynchronous generator function yield 123 Due to their side effects on the containing scope, ``yield`` expressions @@ -506,6 +506,10 @@ on the right hand side of an assignment statement. The proposal to introduce the :token:`yield_from` syntax, making delegation to sub-generators easy. + :pep:`525` - Asynchronous Generators + The proposal that expanded on :pep:`492` by adding generator capabilities to + coroutine functions. + .. index:: object: generator .. _generator-methods: From webhook-mailer at python.org Wed Nov 7 13:35:03 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Wed, 07 Nov 2018 18:35:03 -0000 Subject: [Python-checkins] bpo-34726: Fix handling of hash-based pycs in zipimport. (GH-10327) Message-ID: https://github.com/python/cpython/commit/a6e956bcb0edbfe7f18af9be2215a5326ea6bf05 commit: a6e956bcb0edbfe7f18af9be2215a5326ea6bf05 branch: master author: Elvis Pranskevichus committer: Serhiy Storchaka date: 2018-11-07T20:34:59+02:00 summary: bpo-34726: Fix handling of hash-based pycs in zipimport. (GH-10327) Current support for hash-based bytecode files in `zipimport` is rather sparse, which leads to test failures when the test suite is ran with the ``SOURCE_DATE_EPOCH`` environment variable set. This teaches zipimport to handle hash-based pycs properly. files: A Misc/NEWS.d/next/Core and Builtins/2018-11-04-18-13-40.bpo-34022.U3btVj.rst M Lib/test/test_cmd_line_script.py M Lib/zipimport.py M Python/importlib_zipimport.h diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py index bc812eac3742..85d2a4be069b 100644 --- a/Lib/test/test_cmd_line_script.py +++ b/Lib/test/test_cmd_line_script.py @@ -259,10 +259,32 @@ def test_zipfile(self): self._check_script(zip_name, run_name, zip_name, zip_name, '', zipimport.zipimporter) - def test_zipfile_compiled(self): + def test_zipfile_compiled_timestamp(self): with support.temp_dir() as script_dir: script_name = _make_test_script(script_dir, '__main__') - compiled_name = py_compile.compile(script_name, doraise=True) + compiled_name = py_compile.compile( + script_name, doraise=True, + invalidation_mode=py_compile.PycInvalidationMode.TIMESTAMP) + zip_name, run_name = make_zip_script(script_dir, 'test_zip', compiled_name) + self._check_script(zip_name, run_name, zip_name, zip_name, '', + zipimport.zipimporter) + + def test_zipfile_compiled_checked_hash(self): + with support.temp_dir() as script_dir: + script_name = _make_test_script(script_dir, '__main__') + compiled_name = py_compile.compile( + script_name, doraise=True, + invalidation_mode=py_compile.PycInvalidationMode.CHECKED_HASH) + zip_name, run_name = make_zip_script(script_dir, 'test_zip', compiled_name) + self._check_script(zip_name, run_name, zip_name, zip_name, '', + zipimport.zipimporter) + + def test_zipfile_compiled_unchecked_hash(self): + with support.temp_dir() as script_dir: + script_name = _make_test_script(script_dir, '__main__') + compiled_name = py_compile.compile( + script_name, doraise=True, + invalidation_mode=py_compile.PycInvalidationMode.UNCHECKED_HASH) zip_name, run_name = make_zip_script(script_dir, 'test_zip', compiled_name) self._check_script(zip_name, run_name, zip_name, zip_name, '', zipimport.zipimporter) diff --git a/Lib/zipimport.py b/Lib/zipimport.py index 2c11f68f4946..f430abd6a77c 100644 --- a/Lib/zipimport.py +++ b/Lib/zipimport.py @@ -578,33 +578,53 @@ def _eq_mtime(t1, t2): # dostime only stores even seconds, so be lenient return abs(t1 - t2) <= 1 + # Given the contents of a .py[co] file, unmarshal the data # and return the code object. Return None if it the magic word doesn't -# match (we do this instead of raising an exception as we fall back +# match, or if the recorded .py[co] metadata does not match the source, +# (we do this instead of raising an exception as we fall back # to .py if available and we don't want to mask other errors). -def _unmarshal_code(pathname, data, mtime): - if len(data) < 16: - raise ZipImportError('bad pyc data') - - if data[:4] != _bootstrap_external.MAGIC_NUMBER: - _bootstrap._verbose_message('{!r} has bad magic', pathname) - return None # signal caller to try alternative - - flags = _unpack_uint32(data[4:8]) - if flags != 0: - # Hash-based pyc. We currently refuse to handle checked hash-based - # pycs. We could validate hash-based pycs against the source, but it - # seems likely that most people putting hash-based pycs in a zipfile - # will use unchecked ones. +def _unmarshal_code(self, pathname, fullpath, fullname, data): + exc_details = { + 'name': fullname, + 'path': fullpath, + } + + try: + flags = _bootstrap_external._classify_pyc(data, fullname, exc_details) + except ImportError: + return None + + hash_based = flags & 0b1 != 0 + if hash_based: + check_source = flags & 0b10 != 0 if (_imp.check_hash_based_pycs != 'never' and - (flags != 0x1 or _imp.check_hash_based_pycs == 'always')): - return None - elif mtime != 0 and not _eq_mtime(_unpack_uint32(data[8:12]), mtime): - _bootstrap._verbose_message('{!r} has bad mtime', pathname) - return None # signal caller to try alternative + (check_source or _imp.check_hash_based_pycs == 'always')): + source_bytes = _get_pyc_source(self, fullpath) + if source_bytes is not None: + source_hash = _imp.source_hash( + _bootstrap_external._RAW_MAGIC_NUMBER, + source_bytes, + ) + + try: + _boostrap_external._validate_hash_pyc( + data, source_hash, fullname, exc_details) + except ImportError: + return None + else: + source_mtime, source_size = \ + _get_mtime_and_size_of_source(self, fullpath) + + if source_mtime: + # We don't use _bootstrap_external._validate_timestamp_pyc + # to allow for a more lenient timestamp check. + if (not _eq_mtime(_unpack_uint32(data[8:12]), source_mtime) or + _unpack_uint32(data[12:16]) != source_size): + _bootstrap._verbose_message( + f'bytecode is stale for {fullname!r}') + return None - # XXX the pyc's size field is ignored; timestamp collisions are probably - # unimportant with zip files. code = marshal.loads(data[16:]) if not isinstance(code, _code_type): raise TypeError(f'compiled module {pathname!r} is not a code object') @@ -639,9 +659,9 @@ def _parse_dostime(d, t): -1, -1, -1)) # Given a path to a .pyc file in the archive, return the -# modification time of the matching .py file, or 0 if no source -# is available. -def _get_mtime_of_source(self, path): +# modification time of the matching .py file and its size, +# or (0, 0) if no source is available. +def _get_mtime_and_size_of_source(self, path): try: # strip 'c' or 'o' from *.py[co] assert path[-1:] in ('c', 'o') @@ -651,9 +671,27 @@ def _get_mtime_of_source(self, path): # with an embedded pyc time stamp time = toc_entry[5] date = toc_entry[6] - return _parse_dostime(date, time) + uncompressed_size = toc_entry[3] + return _parse_dostime(date, time), uncompressed_size except (KeyError, IndexError, TypeError): - return 0 + return 0, 0 + + +# Given a path to a .pyc file in the archive, return the +# contents of the matching .py file, or None if no source +# is available. +def _get_pyc_source(self, path): + # strip 'c' or 'o' from *.py[co] + assert path[-1:] in ('c', 'o') + path = path[:-1] + + try: + toc_entry = self._files[path] + except KeyError: + return None + else: + return _get_data(self.archive, toc_entry) + # Get the code object associated with the module specified by # 'fullname'. @@ -670,8 +708,7 @@ def _get_module_code(self, fullname): modpath = toc_entry[0] data = _get_data(self.archive, toc_entry) if isbytecode: - mtime = _get_mtime_of_source(self, fullpath) - code = _unmarshal_code(modpath, data, mtime) + code = _unmarshal_code(self, modpath, fullpath, fullname, data) else: code = _compile_source(modpath, data) if code is None: diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-11-04-18-13-40.bpo-34022.U3btVj.rst b/Misc/NEWS.d/next/Core and Builtins/2018-11-04-18-13-40.bpo-34022.U3btVj.rst new file mode 100644 index 000000000000..64b362dd8dad --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-11-04-18-13-40.bpo-34022.U3btVj.rst @@ -0,0 +1,2 @@ +Fix handling of hash-based bytecode files in :mod:`zipimport`. +Patch by Elvis Pranskevichus. diff --git a/Python/importlib_zipimport.h b/Python/importlib_zipimport.h index 5f1a046942cb..779de5fb4488 100644 --- a/Python/importlib_zipimport.h +++ b/Python/importlib_zipimport.h @@ -1,7 +1,7 @@ /* Auto-generated by Programs/_freeze_importlib.c */ const unsigned char _Py_M__zipimport[] = { 99,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0, - 0,64,0,0,0,115,74,1,0,0,100,0,90,0,100,1, + 0,64,0,0,0,115,82,1,0,0,100,0,90,0,100,1, 100,2,108,1,90,2,100,1,100,3,108,1,109,3,90,3, 109,4,90,4,1,0,100,1,100,2,108,5,90,6,100,1, 100,2,108,7,90,7,100,1,100,2,108,8,90,8,100,1, @@ -21,1028 +21,1065 @@ const unsigned char _Py_M__zipimport[] = { 101,19,101,35,106,36,131,1,90,37,100,35,100,36,132,0, 90,38,100,37,100,38,132,0,90,39,100,39,100,40,132,0, 90,40,100,41,100,42,132,0,90,41,100,43,100,44,132,0, - 90,42,71,0,100,45,100,46,132,0,100,46,131,2,90,43, - 100,2,83,0,41,47,97,80,2,0,0,122,105,112,105,109, - 112,111,114,116,32,112,114,111,118,105,100,101,115,32,115,117, - 112,112,111,114,116,32,102,111,114,32,105,109,112,111,114,116, - 105,110,103,32,80,121,116,104,111,110,32,109,111,100,117,108, - 101,115,32,102,114,111,109,32,90,105,112,32,97,114,99,104, - 105,118,101,115,46,10,10,84,104,105,115,32,109,111,100,117, - 108,101,32,101,120,112,111,114,116,115,32,116,104,114,101,101, - 32,111,98,106,101,99,116,115,58,10,45,32,122,105,112,105, - 109,112,111,114,116,101,114,58,32,97,32,99,108,97,115,115, - 59,32,105,116,115,32,99,111,110,115,116,114,117,99,116,111, - 114,32,116,97,107,101,115,32,97,32,112,97,116,104,32,116, - 111,32,97,32,90,105,112,32,97,114,99,104,105,118,101,46, - 10,45,32,90,105,112,73,109,112,111,114,116,69,114,114,111, - 114,58,32,101,120,99,101,112,116,105,111,110,32,114,97,105, - 115,101,100,32,98,121,32,122,105,112,105,109,112,111,114,116, - 101,114,32,111,98,106,101,99,116,115,46,32,73,116,39,115, - 32,97,10,32,32,115,117,98,99,108,97,115,115,32,111,102, - 32,73,109,112,111,114,116,69,114,114,111,114,44,32,115,111, - 32,105,116,32,99,97,110,32,98,101,32,99,97,117,103,104, - 116,32,97,115,32,73,109,112,111,114,116,69,114,114,111,114, - 44,32,116,111,111,46,10,45,32,95,122,105,112,95,100,105, - 114,101,99,116,111,114,121,95,99,97,99,104,101,58,32,97, - 32,100,105,99,116,44,32,109,97,112,112,105,110,103,32,97, - 114,99,104,105,118,101,32,112,97,116,104,115,32,116,111,32, - 122,105,112,32,100,105,114,101,99,116,111,114,121,10,32,32, - 105,110,102,111,32,100,105,99,116,115,44,32,97,115,32,117, - 115,101,100,32,105,110,32,122,105,112,105,109,112,111,114,116, - 101,114,46,95,102,105,108,101,115,46,10,10,73,116,32,105, - 115,32,117,115,117,97,108,108,121,32,110,111,116,32,110,101, - 101,100,101,100,32,116,111,32,117,115,101,32,116,104,101,32, - 122,105,112,105,109,112,111,114,116,32,109,111,100,117,108,101, - 32,101,120,112,108,105,99,105,116,108,121,59,32,105,116,32, - 105,115,10,117,115,101,100,32,98,121,32,116,104,101,32,98, - 117,105,108,116,105,110,32,105,109,112,111,114,116,32,109,101, - 99,104,97,110,105,115,109,32,102,111,114,32,115,121,115,46, - 112,97,116,104,32,105,116,101,109,115,32,116,104,97,116,32, - 97,114,101,32,112,97,116,104,115,10,116,111,32,90,105,112, - 32,97,114,99,104,105,118,101,115,46,10,233,0,0,0,0, - 78,41,2,218,14,95,117,110,112,97,99,107,95,117,105,110, - 116,49,54,218,14,95,117,110,112,97,99,107,95,117,105,110, - 116,51,50,218,14,90,105,112,73,109,112,111,114,116,69,114, - 114,111,114,218,11,122,105,112,105,109,112,111,114,116,101,114, - 233,1,0,0,0,99,0,0,0,0,0,0,0,0,0,0, - 0,0,1,0,0,0,64,0,0,0,115,12,0,0,0,101, - 0,90,1,100,0,90,2,100,1,83,0,41,2,114,3,0, - 0,0,78,41,3,218,8,95,95,110,97,109,101,95,95,218, - 10,95,95,109,111,100,117,108,101,95,95,218,12,95,95,113, - 117,97,108,110,97,109,101,95,95,169,0,114,9,0,0,0, - 114,9,0,0,0,250,18,60,102,114,111,122,101,110,32,122, - 105,112,105,109,112,111,114,116,62,114,3,0,0,0,33,0, - 0,0,115,2,0,0,0,8,1,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,3,0,0,0,64,0,0, - 0,115,108,0,0,0,101,0,90,1,100,0,90,2,100,1, - 90,3,100,2,100,3,132,0,90,4,100,25,100,5,100,6, - 132,1,90,5,100,26,100,7,100,8,132,1,90,6,100,9, - 100,10,132,0,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,4, - 83,0,41,27,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, + 90,42,100,45,100,46,132,0,90,43,71,0,100,47,100,48, + 132,0,100,48,131,2,90,44,100,2,83,0,41,49,97,80, + 2,0,0,122,105,112,105,109,112,111,114,116,32,112,114,111, + 118,105,100,101,115,32,115,117,112,112,111,114,116,32,102,111, + 114,32,105,109,112,111,114,116,105,110,103,32,80,121,116,104, + 111,110,32,109,111,100,117,108,101,115,32,102,114,111,109,32, + 90,105,112,32,97,114,99,104,105,118,101,115,46,10,10,84, + 104,105,115,32,109,111,100,117,108,101,32,101,120,112,111,114, + 116,115,32,116,104,114,101,101,32,111,98,106,101,99,116,115, + 58,10,45,32,122,105,112,105,109,112,111,114,116,101,114,58, + 32,97,32,99,108,97,115,115,59,32,105,116,115,32,99,111, + 110,115,116,114,117,99,116,111,114,32,116,97,107,101,115,32, + 97,32,112,97,116,104,32,116,111,32,97,32,90,105,112,32, + 97,114,99,104,105,118,101,46,10,45,32,90,105,112,73,109, + 112,111,114,116,69,114,114,111,114,58,32,101,120,99,101,112, + 116,105,111,110,32,114,97,105,115,101,100,32,98,121,32,122, + 105,112,105,109,112,111,114,116,101,114,32,111,98,106,101,99, + 116,115,46,32,73,116,39,115,32,97,10,32,32,115,117,98, + 99,108,97,115,115,32,111,102,32,73,109,112,111,114,116,69, + 114,114,111,114,44,32,115,111,32,105,116,32,99,97,110,32, + 98,101,32,99,97,117,103,104,116,32,97,115,32,73,109,112, + 111,114,116,69,114,114,111,114,44,32,116,111,111,46,10,45, + 32,95,122,105,112,95,100,105,114,101,99,116,111,114,121,95, + 99,97,99,104,101,58,32,97,32,100,105,99,116,44,32,109, + 97,112,112,105,110,103,32,97,114,99,104,105,118,101,32,112, + 97,116,104,115,32,116,111,32,122,105,112,32,100,105,114,101, + 99,116,111,114,121,10,32,32,105,110,102,111,32,100,105,99, + 116,115,44,32,97,115,32,117,115,101,100,32,105,110,32,122, + 105,112,105,109,112,111,114,116,101,114,46,95,102,105,108,101, + 115,46,10,10,73,116,32,105,115,32,117,115,117,97,108,108, + 121,32,110,111,116,32,110,101,101,100,101,100,32,116,111,32, + 117,115,101,32,116,104,101,32,122,105,112,105,109,112,111,114, + 116,32,109,111,100,117,108,101,32,101,120,112,108,105,99,105, + 116,108,121,59,32,105,116,32,105,115,10,117,115,101,100,32, + 98,121,32,116,104,101,32,98,117,105,108,116,105,110,32,105, + 109,112,111,114,116,32,109,101,99,104,97,110,105,115,109,32, + 102,111,114,32,115,121,115,46,112,97,116,104,32,105,116,101, + 109,115,32,116,104,97,116,32,97,114,101,32,112,97,116,104, + 115,10,116,111,32,90,105,112,32,97,114,99,104,105,118,101, + 115,46,10,233,0,0,0,0,78,41,2,218,14,95,117,110, + 112,97,99,107,95,117,105,110,116,49,54,218,14,95,117,110, + 112,97,99,107,95,117,105,110,116,51,50,218,14,90,105,112, + 73,109,112,111,114,116,69,114,114,111,114,218,11,122,105,112, + 105,109,112,111,114,116,101,114,233,1,0,0,0,99,0,0, + 0,0,0,0,0,0,0,0,0,0,1,0,0,0,64,0, + 0,0,115,12,0,0,0,101,0,90,1,100,0,90,2,100, + 1,83,0,41,2,114,3,0,0,0,78,41,3,218,8,95, + 95,110,97,109,101,95,95,218,10,95,95,109,111,100,117,108, + 101,95,95,218,12,95,95,113,117,97,108,110,97,109,101,95, + 95,169,0,114,9,0,0,0,114,9,0,0,0,250,18,60, + 102,114,111,122,101,110,32,122,105,112,105,109,112,111,114,116, + 62,114,3,0,0,0,33,0,0,0,115,2,0,0,0,8, + 1,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,3,0,0,0,64,0,0,0,115,108,0,0,0,101,0, + 90,1,100,0,90,2,100,1,90,3,100,2,100,3,132,0, + 90,4,100,25,100,5,100,6,132,1,90,5,100,26,100,7, + 100,8,132,1,90,6,100,9,100,10,132,0,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,4,83,0,41,27,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,8,0,0,0,9,0,0,0,67,0, - 0,0,115,36,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,122,14,116,8,160,9,124,1,161, - 1,125,4,87,0,110,72,4,0,116,10,116,11,102,2,107, - 10,114,150,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,132,116, - 4,100,4,124,1,100,3,141,2,130,1,124,5,125,1,124, - 3,160,13,124,6,161,1,1,0,89,0,113,64,88,0,124, - 4,106,14,100,5,64,0,100,6,107,3,114,182,116,4,100, - 4,124,1,100,3,141,2,130,1,113,182,113,64,122,12,116, - 15,124,1,25,0,125,7,87,0,110,36,4,0,116,16,107, - 10,114,230,1,0,1,0,1,0,116,17,124,1,131,1,125, - 7,124,7,116,15,124,1,60,0,89,0,110,2,88,0,124, - 7,124,0,95,18,124,1,124,0,95,19,116,8,106,20,124, - 3,100,0,100,0,100,7,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,41,8,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,41,1,218,4,112,97, - 116,104,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,12,0,0,0,114, - 16,0,0,0,114,30,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, - 63,0,0,0,115,58,0,0,0,0,1,10,1,8,1,10, - 1,4,1,12,1,4,1,12,2,4,2,2,1,14,1,18, - 3,14,1,8,1,12,1,4,1,16,3,14,2,12,1,4, - 2,2,1,12,1,14,1,8,1,14,1,6,1,6,2,22, - 1,8,1,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,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,107,9,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,239,1,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, - 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,28,0,0,0,114,19,0, - 0,0,41,5,114,31,0,0,0,218,8,102,117,108,108,110, - 97,109,101,114,12,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,109,0,0,0,115,14,0,0,0,0,10,10,1,8,2, - 8,7,10,1,10,4,24,2,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,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,2,97,139,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,32,32,32,32,32,32,32,32,114,0,0, - 0,0,41,1,114,40,0,0,0,41,3,114,31,0,0,0, - 114,37,0,0,0,114,12,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,141,0,0,0,115,2,0,0,0,0, - 9,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,2,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,1,122,163,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, - 102,111,117,110,100,46,10,32,32,32,32,32,32,32,32,41, - 1,218,16,95,103,101,116,95,109,111,100,117,108,101,95,99, - 111,100,101,41,5,114,31,0,0,0,114,37,0,0,0,218, - 4,99,111,100,101,218,9,105,115,112,97,99,107,97,103,101, - 114,39,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,153,0, - 0,0,115,4,0,0,0,0,6,16,1,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,4,0,0,0,8,0, - 0,0,67,0,0,0,115,118,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,32,4,0,116,7,107,10,114,104,1,0,1, - 0,1,0,116,8,100,2,100,3,124,2,131,3,130,1,89, - 0,110,2,88,0,116,9,124,0,106,4,124,3,131,2,83, - 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,17,0,0,0,114,18, - 0,0,0,114,19,0,0,0,218,10,115,116,97,114,116,115, - 119,105,116,104,114,28,0,0,0,218,3,108,101,110,114,27, - 0,0,0,114,25,0,0,0,114,21,0,0,0,218,9,95, - 103,101,116,95,100,97,116,97,41,4,114,31,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,163,0,0,0,115,20,0,0,0,0,6,4,1,12, - 2,4,1,16,1,22,2,2,1,14,1,14,1,18,1,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,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,1,122,106,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,46,10,32,32,32,32,32,32,32, - 32,41,1,114,42,0,0,0,41,5,114,31,0,0,0,114, - 37,0,0,0,114,43,0,0,0,114,44,0,0,0,114,39, + 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,8,0, + 0,0,9,0,0,0,67,0,0,0,115,36,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,122, + 14,116,8,160,9,124,1,161,1,125,4,87,0,110,72,4, + 0,116,10,116,11,102,2,107,10,114,150,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,132,116,4,100,4,124,1,100,3,141, + 2,130,1,124,5,125,1,124,3,160,13,124,6,161,1,1, + 0,89,0,113,64,88,0,124,4,106,14,100,5,64,0,100, + 6,107,3,114,182,116,4,100,4,124,1,100,3,141,2,130, + 1,113,182,113,64,122,12,116,15,124,1,25,0,125,7,87, + 0,110,36,4,0,116,16,107,10,114,230,1,0,1,0,1, + 0,116,17,124,1,131,1,125,7,124,7,116,15,124,1,60, + 0,89,0,110,2,88,0,124,7,124,0,95,18,124,1,124, + 0,95,19,116,8,106,20,124,3,100,0,100,0,100,7,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,41,8,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,41,1,218,4,112,97,116,104,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,12,0,0,0,114,16,0,0,0,114,30,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,63,0,0,0,115,58,0,0, + 0,0,1,10,1,8,1,10,1,4,1,12,1,4,1,12, + 2,4,2,2,1,14,1,18,3,14,1,8,1,12,1,4, + 1,16,3,14,2,12,1,4,2,2,1,12,1,14,1,8, + 1,14,1,6,1,6,2,22,1,8,1,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,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,107,9,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,239,1,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,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,28,0,0,0,114,19,0,0,0,41,5,114,31,0,0, + 0,218,8,102,117,108,108,110,97,109,101,114,12,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,109,0,0,0,115,14,0, + 0,0,0,10,10,1,8,2,8,7,10,1,10,4,24,2, + 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,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,2,97,139,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,32,32,32, + 32,32,32,32,32,114,0,0,0,0,41,1,114,40,0,0, + 0,41,3,114,31,0,0,0,114,37,0,0,0,114,12,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,141,0, + 0,0,115,2,0,0,0,0,9,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,2,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,1,122,163,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,102,111,117,110,100,46,10,32, + 32,32,32,32,32,32,32,41,1,218,16,95,103,101,116,95, + 109,111,100,117,108,101,95,99,111,100,101,41,5,114,31,0, + 0,0,114,37,0,0,0,218,4,99,111,100,101,218,9,105, + 115,112,97,99,107,97,103,101,114,39,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,153,0,0,0,115,4,0,0,0,0, + 6,16,1,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,4,0,0,0,8,0,0,0,67,0,0,0,115,118, + 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,32,4,0,116, + 7,107,10,114,104,1,0,1,0,1,0,116,8,100,2,100, + 3,124,2,131,3,130,1,89,0,110,2,88,0,116,9,124, + 0,106,4,124,3,131,2,83,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,17,0,0,0,114,18,0,0,0,114,19,0,0,0, + 218,10,115,116,97,114,116,115,119,105,116,104,114,28,0,0, + 0,218,3,108,101,110,114,27,0,0,0,114,25,0,0,0, + 114,21,0,0,0,218,9,95,103,101,116,95,100,97,116,97, + 41,4,114,31,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,163,0,0,0,115,20, + 0,0,0,0,6,4,1,12,2,4,1,16,1,22,2,2, + 1,14,1,14,1,18,1,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,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,1,122,106,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,46, + 10,32,32,32,32,32,32,32,32,41,1,114,42,0,0,0, + 41,5,114,31,0,0,0,114,37,0,0,0,114,43,0,0, + 0,114,44,0,0,0,114,39,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,184,0,0,0,115,4,0,0, + 0,0,7,16,1,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,6,0,0,0,8,0,0,0, + 67,0,0,0,115,128,0,0,0,116,0,124,0,124,1,131, + 2,125,2,124,2,100,1,107,8,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,22,4,0,116,6,107,10,114,110,1,0,1,0,1, + 0,89,0,100,1,83,0,88,0,116,7,124,0,106,8,124, + 5,131,2,160,9,161,0,83,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,122,18,99,97,110, + 39,116,32,102,105,110,100,32,109,111,100,117,108,101,32,41, + 1,218,4,110,97,109,101,122,11,95,95,105,110,105,116,95, + 95,46,112,121,122,3,46,112,121,41,10,114,34,0,0,0, + 114,3,0,0,0,114,35,0,0,0,114,20,0,0,0,114, + 29,0,0,0,114,27,0,0,0,114,25,0,0,0,114,49, + 0,0,0,114,28,0,0,0,218,6,100,101,99,111,100,101, + 41,6,114,31,0,0,0,114,37,0,0,0,114,38,0,0, + 0,114,12,0,0,0,218,8,102,117,108,108,112,97,116,104, + 114,51,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, + 195,0,0,0,115,24,0,0,0,0,7,10,1,8,1,18, + 2,10,1,4,1,14,2,10,2,2,1,14,1,14,2,8, + 1,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,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,107,8,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,122,18,99,97,110, + 39,116,32,102,105,110,100,32,109,111,100,117,108,101,32,41, + 1,114,54,0,0,0,41,2,114,34,0,0,0,114,3,0, + 0,0,41,3,114,31,0,0,0,114,37,0,0,0,114,38, 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, - 184,0,0,0,115,4,0,0,0,0,7,16,1,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, - 6,0,0,0,8,0,0,0,67,0,0,0,115,128,0,0, - 0,116,0,124,0,124,1,131,2,125,2,124,2,100,1,107, - 8,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,22,4,0,116,6,107, - 10,114,110,1,0,1,0,1,0,89,0,100,1,83,0,88, - 0,116,7,124,0,106,8,124,5,131,2,160,9,161,0,83, - 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,122,18,99,97,110,39,116,32,102,105,110,100,32, - 109,111,100,117,108,101,32,41,1,218,4,110,97,109,101,122, - 11,95,95,105,110,105,116,95,95,46,112,121,122,3,46,112, - 121,41,10,114,34,0,0,0,114,3,0,0,0,114,35,0, - 0,0,114,20,0,0,0,114,29,0,0,0,114,27,0,0, - 0,114,25,0,0,0,114,49,0,0,0,114,28,0,0,0, - 218,6,100,101,99,111,100,101,41,6,114,31,0,0,0,114, - 37,0,0,0,114,38,0,0,0,114,12,0,0,0,218,8, - 102,117,108,108,112,97,116,104,114,51,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,195,0,0,0,115,24,0,0, - 0,0,7,10,1,8,1,18,2,10,1,4,1,14,2,10, - 2,2,1,14,1,14,2,8,1,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,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,107,8,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,122,18,99,97,110,39,116,32,102,105,110,100,32, - 109,111,100,117,108,101,32,41,1,114,54,0,0,0,41,2, - 114,34,0,0,0,114,3,0,0,0,41,3,114,31,0,0, - 0,114,37,0,0,0,114,38,0,0,0,114,9,0,0,0, - 114,9,0,0,0,114,10,0,0,0,218,10,105,115,95,112, - 97,99,107,97,103,101,221,0,0,0,115,8,0,0,0,0, - 6,10,1,8,1,18,1,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,8,0,0,0,8,0,0,0, - 67,0,0,0,115,248,0,0,0,116,0,124,0,124,1,131, - 2,92,3,125,2,125,3,125,4,116,1,106,2,160,3,124, - 1,161,1,125,5,124,5,100,1,107,8,115,46,116,4,124, - 5,116,5,131,2,115,64,116,5,124,1,131,1,125,5,124, - 5,116,1,106,2,124,1,60,0,124,0,124,5,95,6,122, - 84,124,3,114,108,116,7,124,0,124,1,131,2,125,6,116, - 8,160,9,124,0,106,10,124,6,161,2,125,7,124,7,103, - 1,124,5,95,11,116,12,124,5,100,2,131,2,115,124,116, - 13,124,5,95,13,116,8,160,14,124,5,106,15,124,1,124, - 4,161,3,1,0,116,16,124,2,124,5,106,15,131,2,1, - 0,87,0,110,22,1,0,1,0,1,0,116,1,106,2,124, - 1,61,0,130,0,89,0,110,2,88,0,122,14,116,1,106, - 2,124,1,25,0,125,5,87,0,110,36,4,0,116,17,107, - 10,114,228,1,0,1,0,1,0,116,18,100,3,124,1,155, - 2,100,4,157,3,131,1,130,1,89,0,110,2,88,0,116, - 19,160,20,100,5,124,1,124,4,161,3,1,0,124,5,83, - 0,41,6,122,245,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,119,97,115,110,39,116,32,102,111,117,110,100, - 46,10,32,32,32,32,32,32,32,32,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,21,114,42,0,0,0,218,3,115,121,115, - 218,7,109,111,100,117,108,101,115,218,3,103,101,116,114,14, - 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,35,0, - 0,0,114,20,0,0,0,114,29,0,0,0,114,28,0,0, - 0,90,8,95,95,112,97,116,104,95,95,218,7,104,97,115, - 97,116,116,114,114,59,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,25,0,0,0,218,11, - 73,109,112,111,114,116,69,114,114,111,114,218,10,95,98,111, - 111,116,115,116,114,97,112,218,16,95,118,101,114,98,111,115, - 101,95,109,101,115,115,97,103,101,41,8,114,31,0,0,0, - 114,37,0,0,0,114,43,0,0,0,114,44,0,0,0,114, - 39,0,0,0,90,3,109,111,100,114,12,0,0,0,114,56, + 0,0,218,10,105,115,95,112,97,99,107,97,103,101,221,0, + 0,0,115,8,0,0,0,0,6,10,1,8,1,18,1,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, + 8,0,0,0,8,0,0,0,67,0,0,0,115,248,0,0, + 0,116,0,124,0,124,1,131,2,92,3,125,2,125,3,125, + 4,116,1,106,2,160,3,124,1,161,1,125,5,124,5,100, + 1,107,8,115,46,116,4,124,5,116,5,131,2,115,64,116, + 5,124,1,131,1,125,5,124,5,116,1,106,2,124,1,60, + 0,124,0,124,5,95,6,122,84,124,3,114,108,116,7,124, + 0,124,1,131,2,125,6,116,8,160,9,124,0,106,10,124, + 6,161,2,125,7,124,7,103,1,124,5,95,11,116,12,124, + 5,100,2,131,2,115,124,116,13,124,5,95,13,116,8,160, + 14,124,5,106,15,124,1,124,4,161,3,1,0,116,16,124, + 2,124,5,106,15,131,2,1,0,87,0,110,22,1,0,1, + 0,1,0,116,1,106,2,124,1,61,0,130,0,89,0,110, + 2,88,0,122,14,116,1,106,2,124,1,25,0,125,5,87, + 0,110,36,4,0,116,17,107,10,114,228,1,0,1,0,1, + 0,116,18,100,3,124,1,155,2,100,4,157,3,131,1,130, + 1,89,0,110,2,88,0,116,19,160,20,100,5,124,1,124, + 4,161,3,1,0,124,5,83,0,41,6,122,245,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,119,97,115,110, + 39,116,32,102,111,117,110,100,46,10,32,32,32,32,32,32, + 32,32,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,21,114,42, + 0,0,0,218,3,115,121,115,218,7,109,111,100,117,108,101, + 115,218,3,103,101,116,114,14,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,35,0,0,0,114,20,0,0,0,114, + 29,0,0,0,114,28,0,0,0,90,8,95,95,112,97,116, + 104,95,95,218,7,104,97,115,97,116,116,114,114,59,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,25,0,0,0,218,11,73,109,112,111,114,116,69,114, + 114,111,114,218,10,95,98,111,111,116,115,116,114,97,112,218, + 16,95,118,101,114,98,111,115,101,95,109,101,115,115,97,103, + 101,41,8,114,31,0,0,0,114,37,0,0,0,114,43,0, + 0,0,114,44,0,0,0,114,39,0,0,0,90,3,109,111, + 100,114,12,0,0,0,114,56,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,234,0,0,0,115,48,0,0,0, + 0,7,16,1,12,1,18,1,8,1,10,1,6,2,2,1, + 4,3,10,1,14,1,8,2,10,1,6,1,16,1,16,1, + 6,1,8,1,8,2,2,1,14,1,14,1,22,1,14,1, + 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,3,0,0,0,8,0,0,0,67,0,0,0,115,88, + 0,0,0,122,20,124,0,160,0,124,1,161,1,115,18,87, + 0,100,1,83,0,87,0,110,22,4,0,116,1,107,10,114, + 42,1,0,1,0,1,0,89,0,100,1,83,0,88,0,116, + 2,106,3,115,78,100,2,100,3,108,4,109,5,125,2,1, + 0,124,2,160,6,116,2,161,1,1,0,100,4,116,2,95, + 3,116,2,124,0,124,1,131,2,83,0,41,5,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,14,82,101,115,111,117,114,99,101,82,101,97, + 100,101,114,84,41,7,114,58,0,0,0,114,3,0,0,0, + 218,24,95,90,105,112,73,109,112,111,114,116,82,101,115,111, + 117,114,99,101,82,101,97,100,101,114,218,11,95,114,101,103, + 105,115,116,101,114,101,100,90,13,105,109,112,111,114,116,108, + 105,98,46,97,98,99,114,72,0,0,0,90,8,114,101,103, + 105,115,116,101,114,41,3,114,31,0,0,0,114,37,0,0, + 0,114,72,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,16,1,0,0,115,20, + 0,0,0,0,6,2,1,10,1,10,1,14,1,8,1,6, + 1,12,1,10,1,6,1,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,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,28,0,0,0,114, + 19,0,0,0,114,30,0,0,0,41,1,114,31,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,34,1,0,0,115,2,0, + 0,0,0,1,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,15,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,33,0,0,0,114, + 40,0,0,0,114,41,0,0,0,114,45,0,0,0,114,52, + 0,0,0,114,53,0,0,0,114,57,0,0,0,114,58,0, + 0,0,114,71,0,0,0,114,75,0,0,0,114,76,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,45,0,0,0,115,24, + 0,0,0,8,13,4,5,8,46,10,32,10,12,8,10,8, + 21,8,11,8,26,8,13,8,38,8,18,122,12,95,95,105, + 110,105,116,95,95,46,112,121,99,84,122,11,95,95,105,110, + 105,116,95,95,46,112,121,70,41,3,122,4,46,112,121,99, + 84,70,41,3,122,3,46,112,121,70,70,99,2,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,30,0,0,0,218,10,114,112,97, + 114,116,105,116,105,111,110,41,2,114,31,0,0,0,114,37, 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,234, - 0,0,0,115,48,0,0,0,0,7,16,1,12,1,18,1, - 8,1,10,1,6,2,2,1,4,3,10,1,14,1,8,2, - 10,1,6,1,16,1,16,1,6,1,8,1,8,2,2,1, - 14,1,14,1,22,1,14,1,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,3,0,0,0,8,0, - 0,0,67,0,0,0,115,88,0,0,0,122,20,124,0,160, - 0,124,1,161,1,115,18,87,0,100,1,83,0,87,0,110, - 22,4,0,116,1,107,10,114,42,1,0,1,0,1,0,89, - 0,100,1,83,0,88,0,116,2,106,3,115,78,100,2,100, - 3,108,4,109,5,125,2,1,0,124,2,160,6,116,2,161, - 1,1,0,100,4,116,2,95,3,116,2,124,0,124,1,131, - 2,83,0,41,5,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,14,82,101,115, - 111,117,114,99,101,82,101,97,100,101,114,84,41,7,114,58, - 0,0,0,114,3,0,0,0,218,24,95,90,105,112,73,109, - 112,111,114,116,82,101,115,111,117,114,99,101,82,101,97,100, - 101,114,218,11,95,114,101,103,105,115,116,101,114,101,100,90, - 13,105,109,112,111,114,116,108,105,98,46,97,98,99,114,72, - 0,0,0,90,8,114,101,103,105,115,116,101,114,41,3,114, - 31,0,0,0,114,37,0,0,0,114,72,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,16,1,0,0,115,20,0,0,0,0,6,2,1,10, - 1,10,1,14,1,8,1,6,1,12,1,10,1,6,1,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,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,28,0,0,0,114,19,0,0,0,114,30,0,0, - 0,41,1,114,31,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,34,1,0,0,115,2,0,0,0,0,1,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,15,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,33,0,0,0,114,40,0,0,0,114,41,0,0, - 0,114,45,0,0,0,114,52,0,0,0,114,53,0,0,0, - 114,57,0,0,0,114,58,0,0,0,114,71,0,0,0,114, - 75,0,0,0,114,76,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,45,0,0,0,115,24,0,0,0,8,13,4,5,8, - 46,10,32,10,12,8,10,8,21,8,11,8,26,8,13,8, - 38,8,18,122,12,95,95,105,110,105,116,95,95,46,112,121, - 99,84,122,11,95,95,105,110,105,116,95,95,46,112,121,70, - 41,3,122,4,46,112,121,99,84,70,41,3,122,3,46,112, - 121,70,70,99,2,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,30, - 0,0,0,218,10,114,112,97,114,116,105,116,105,111,110,41, - 2,114,31,0,0,0,114,37,0,0,0,114,9,0,0,0, - 114,9,0,0,0,114,10,0,0,0,114,35,0,0,0,52, - 1,0,0,115,2,0,0,0,0,1,114,35,0,0,0,99, - 2,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,107,6,83,0,41,1,78,41,2, - 114,19,0,0,0,114,27,0,0,0,41,3,114,31,0,0, - 0,114,12,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,36, - 0,0,0,56,1,0,0,115,4,0,0,0,0,4,8,2, - 114,36,0,0,0,99,2,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,107,6,114,14,124,5,2,0,1,0,83, - 0,113,14,100,0,83,0,41,1,78,41,3,114,35,0,0, - 0,218,16,95,122,105,112,95,115,101,97,114,99,104,111,114, - 100,101,114,114,27,0,0,0,41,7,114,31,0,0,0,114, - 37,0,0,0,114,12,0,0,0,218,6,115,117,102,102,105, - 120,218,10,105,115,98,121,116,101,99,111,100,101,114,44,0, - 0,0,114,56,0,0,0,114,9,0,0,0,114,9,0,0, - 0,114,10,0,0,0,114,34,0,0,0,65,1,0,0,115, - 12,0,0,0,0,1,10,1,14,1,8,1,10,1,10,1, - 114,34,0,0,0,99,1,0,0,0,0,0,0,0,26,0, - 0,0,9,0,0,0,67,0,0,0,115,254,4,0,0,122, - 16,116,0,160,1,124,0,100,1,161,2,125,1,87,0,110, - 38,4,0,116,2,107,10,114,54,1,0,1,0,1,0,116, - 3,100,2,124,0,155,2,157,2,124,0,100,3,141,2,130, - 1,89,0,110,2,88,0,124,1,144,4,143,168,1,0,122, - 36,124,1,160,4,116,5,11,0,100,4,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,38,4,0,116,2,107,10,114,138,1,0,1, - 0,1,0,116,3,100,5,124,0,155,2,157,2,124,0,100, - 3,141,2,130,1,89,0,110,2,88,0,116,8,124,3,131, - 1,116,5,107,3,114,170,116,3,100,5,124,0,155,2,157, - 2,124,0,100,3,141,2,130,1,124,3,100,0,100,6,133, - 2,25,0,116,9,107,3,144,1,114,180,122,24,124,1,160, - 4,100,7,100,4,161,2,1,0,124,1,160,6,161,0,125, - 4,87,0,110,38,4,0,116,2,107,10,114,250,1,0,1, - 0,1,0,116,3,100,5,124,0,155,2,157,2,124,0,100, - 3,141,2,130,1,89,0,110,2,88,0,116,10,124,4,116, - 11,24,0,116,5,24,0,100,7,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,40,4,0,116,2,107,10,144,1,114,76,1, - 0,1,0,1,0,116,3,100,5,124,0,155,2,157,2,124, - 0,100,3,141,2,130,1,89,0,110,2,88,0,124,6,160, - 12,116,9,161,1,125,7,124,7,100,7,107,0,144,1,114, - 116,116,3,100,8,124,0,155,2,157,2,124,0,100,3,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, - 164,116,3,100,9,124,0,155,2,157,2,124,0,100,3,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,10,100,11,133,2,25,0,131, - 1,125,8,116,13,124,3,100,11,100,12,133,2,25,0,131, - 1,125,9,124,2,124,8,107,0,144,1,114,240,116,3,100, - 13,124,0,155,2,157,2,124,0,100,3,141,2,130,1,124, - 2,124,9,107,0,144,2,114,12,116,3,100,14,124,0,155, - 2,157,2,124,0,100,3,141,2,130,1,124,2,124,8,56, - 0,125,2,124,2,124,9,24,0,125,10,124,10,100,7,107, - 0,144,2,114,56,116,3,100,15,124,0,155,2,157,2,124, - 0,100,3,141,2,130,1,105,0,125,11,100,7,125,12,122, - 14,124,1,160,4,124,2,161,1,1,0,87,0,110,40,4, - 0,116,2,107,10,144,2,114,118,1,0,1,0,1,0,116, - 3,100,5,124,0,155,2,157,2,124,0,100,3,141,2,130, - 1,89,0,110,2,88,0,124,1,160,7,100,16,161,1,125, - 3,116,8,124,3,131,1,100,6,107,0,144,2,114,152,116, - 14,100,17,131,1,130,1,124,3,100,0,100,6,133,2,25, - 0,100,18,107,3,144,2,114,174,144,4,113,226,116,8,124, - 3,131,1,100,16,107,3,144,2,114,196,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,10,133,2,25,0,131, - 1,125,14,116,15,124,3,100,10,100,21,133,2,25,0,131, - 1,125,15,116,15,124,3,100,21,100,11,133,2,25,0,131, - 1,125,16,116,13,124,3,100,11,100,12,133,2,25,0,131, - 1,125,17,116,13,124,3,100,12,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,156,116,3,100,28,124,0,155, - 2,157,2,124,0,100,3,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,40,4,0,116,2,107,10,144,3,114,218,1,0,1, - 0,1,0,116,3,100,5,124,0,155,2,157,2,124,0,100, - 3,141,2,130,1,89,0,110,2,88,0,116,8,124,23,131, - 1,124,19,107,3,144,3,114,252,116,3,100,5,124,0,155, - 2,157,2,124,0,100,3,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,44,116,3,100,5,124,0,155, - 2,157,2,124,0,100,3,141,2,130,1,87,0,110,40,4, - 0,116,2,107,10,144,4,114,86,1,0,1,0,1,0,116, + 0,0,114,35,0,0,0,52,1,0,0,115,2,0,0,0, + 0,1,114,35,0,0,0,99,2,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,107, + 6,83,0,41,1,78,41,2,114,19,0,0,0,114,27,0, + 0,0,41,3,114,31,0,0,0,114,12,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,36,0,0,0,56,1,0,0,115, + 4,0,0,0,0,4,8,2,114,36,0,0,0,99,2,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,107,6,114, + 14,124,5,2,0,1,0,83,0,113,14,100,0,83,0,41, + 1,78,41,3,114,35,0,0,0,218,16,95,122,105,112,95, + 115,101,97,114,99,104,111,114,100,101,114,114,27,0,0,0, + 41,7,114,31,0,0,0,114,37,0,0,0,114,12,0,0, + 0,218,6,115,117,102,102,105,120,218,10,105,115,98,121,116, + 101,99,111,100,101,114,44,0,0,0,114,56,0,0,0,114, + 9,0,0,0,114,9,0,0,0,114,10,0,0,0,114,34, + 0,0,0,65,1,0,0,115,12,0,0,0,0,1,10,1, + 14,1,8,1,10,1,10,1,114,34,0,0,0,99,1,0, + 0,0,0,0,0,0,26,0,0,0,9,0,0,0,67,0, + 0,0,115,254,4,0,0,122,16,116,0,160,1,124,0,100, + 1,161,2,125,1,87,0,110,38,4,0,116,2,107,10,114, + 54,1,0,1,0,1,0,116,3,100,2,124,0,155,2,157, + 2,124,0,100,3,141,2,130,1,89,0,110,2,88,0,124, + 1,144,4,143,168,1,0,122,36,124,1,160,4,116,5,11, + 0,100,4,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,38,4,0,116, + 2,107,10,114,138,1,0,1,0,1,0,116,3,100,5,124, + 0,155,2,157,2,124,0,100,3,141,2,130,1,89,0,110, + 2,88,0,116,8,124,3,131,1,116,5,107,3,114,170,116, 3,100,5,124,0,155,2,157,2,124,0,100,3,141,2,130, - 1,89,0,110,2,88,0,124,13,100,29,64,0,144,4,114, - 108,124,23,160,16,161,0,125,23,110,54,122,14,124,23,160, - 16,100,30,161,1,125,23,87,0,110,38,4,0,116,17,107, - 10,144,4,114,160,1,0,1,0,1,0,124,23,160,16,100, - 31,161,1,160,18,116,19,161,1,125,23,89,0,110,2,88, - 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, - 120,87,0,53,0,81,0,82,0,88,0,116,24,160,25,100, - 34,124,12,124,0,161,3,1,0,124,11,83,0,41,35,78, - 218,2,114,98,122,21,99,97,110,39,116,32,111,112,101,110, - 32,90,105,112,32,102,105,108,101,58,32,41,1,114,12,0, - 0,0,114,79,0,0,0,122,21,99,97,110,39,116,32,114, - 101,97,100,32,90,105,112,32,102,105,108,101,58,32,233,4, - 0,0,0,114,0,0,0,0,122,16,110,111,116,32,97,32, - 90,105,112,32,102,105,108,101,58,32,122,18,99,111,114,114, - 117,112,116,32,90,105,112,32,102,105,108,101,58,32,233,12, - 0,0,0,233,16,0,0,0,233,20,0,0,0,122,28,98, - 97,100,32,99,101,110,116,114,97,108,32,100,105,114,101,99, - 116,111,114,121,32,115,105,122,101,58,32,122,30,98,97,100, - 32,99,101,110,116,114,97,108,32,100,105,114,101,99,116,111, - 114,121,32,111,102,102,115,101,116,58,32,122,38,98,97,100, - 32,99,101,110,116,114,97,108,32,100,105,114,101,99,116,111, - 114,121,32,115,105,122,101,32,111,114,32,111,102,102,115,101, - 116,58,32,233,46,0,0,0,122,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,4,111,112, - 101,110,114,21,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,48,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,55, - 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, - 18,0,0,0,114,19,0,0,0,114,20,0,0,0,114,29, - 0,0,0,114,69,0,0,0,114,70,0,0,0,41,26,114, - 28,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,32,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,54,0, - 0,0,114,12,0,0,0,218,1,116,114,9,0,0,0,114, - 9,0,0,0,114,10,0,0,0,114,26,0,0,0,96,1, - 0,0,115,212,0,0,0,0,1,2,1,16,1,14,1,24, - 2,8,1,2,1,14,1,8,1,14,1,14,1,24,1,12, - 1,18,1,18,3,2,1,12,1,12,1,14,1,10,1,2, - 255,12,2,8,1,2,255,2,1,2,255,4,2,2,1,10, - 1,12,1,16,1,10,1,2,255,12,2,10,1,10,1,10, - 1,2,255,6,2,16,1,14,1,10,1,2,255,6,2,16, - 2,16,1,16,1,10,1,18,1,10,1,18,1,8,1,8, - 1,10,1,18,2,4,2,4,1,2,1,14,1,16,1,24, - 2,10,1,14,1,8,2,18,1,4,1,14,1,8,1,16, - 1,16,1,16,1,16,1,16,1,16,1,16,1,16,1,16, - 1,16,1,16,1,12,1,10,1,18,1,8,2,2,1,14, - 1,16,1,24,1,14,1,18,4,2,1,28,1,22,1,16, - 1,24,2,10,2,10,3,2,1,14,1,16,1,22,2,12, - 1,12,1,20,1,8,1,22,1,14,1,114,26,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,1,0,0,0, - 8,0,0,0,67,0,0,0,115,108,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,60,122,16,100,4,100,5,108, - 4,109,5,125,0,1,0,87,0,110,38,4,0,116,6,107, - 10,114,82,1,0,1,0,1,0,116,1,160,2,100,1,161, - 1,1,0,116,3,100,2,131,1,130,1,89,0,110,2,88, - 0,87,0,53,0,100,6,97,0,88,0,116,1,160,2,100, - 7,161,1,1,0,124,0,83,0,41,8,78,122,27,122,105, - 112,105,109,112,111,114,116,58,32,122,108,105,98,32,85,78, - 65,86,65,73,76,65,66,76,69,122,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,41,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,69,0,0,0,114,70,0,0, - 0,114,3,0,0,0,90,4,122,108,105,98,114,130,0,0, - 0,218,9,69,120,99,101,112,116,105,111,110,41,1,114,130, - 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,254,1,0,0,115,24,0,0, - 0,0,2,4,3,10,1,8,2,4,1,4,1,16,1,14, - 1,10,1,18,2,6,2,10,1,114,133,0,0,0,99,2, - 0,0,0,0,0,0,0,17,0,0,0,9,0,0,0,67, - 0,0,0,115,130,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,100,3,161,2,144,1,143,8,125,10,122,14,124,10, - 160,3,124,6,161,1,1,0,87,0,110,38,4,0,116,4, - 107,10,114,104,1,0,1,0,1,0,116,0,100,4,124,0, - 155,2,157,2,124,0,100,5,141,2,130,1,89,0,110,2, - 88,0,124,10,160,5,100,6,161,1,125,11,116,6,124,11, - 131,1,100,6,107,3,114,136,116,7,100,7,131,1,130,1, - 124,11,100,0,100,8,133,2,25,0,100,9,107,3,114,170, - 116,0,100,10,124,0,155,2,157,2,124,0,100,5,141,2, - 130,1,116,8,124,11,100,11,100,12,133,2,25,0,131,1, - 125,12,116,8,124,11,100,12,100,6,133,2,25,0,131,1, - 125,13,100,6,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,40,4,0,116,4,107,10,144,1,114,20, - 1,0,1,0,1,0,116,0,100,4,124,0,155,2,157,2, - 124,0,100,5,141,2,130,1,89,0,110,2,88,0,124,10, - 160,5,124,4,161,1,125,15,116,6,124,15,131,1,124,4, - 107,3,144,1,114,54,116,4,100,13,131,1,130,1,87,0, - 53,0,81,0,82,0,88,0,124,3,100,1,107,2,144,1, - 114,78,124,15,83,0,122,10,116,9,131,0,125,16,87,0, - 110,30,4,0,116,10,107,10,144,1,114,118,1,0,1,0, - 1,0,116,0,100,14,131,1,130,1,89,0,110,2,88,0, - 124,16,124,15,100,15,131,2,83,0,41,16,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,84,0,0,0,122,21,99,97,110, - 39,116,32,114,101,97,100,32,90,105,112,32,102,105,108,101, - 58,32,41,1,114,12,0,0,0,114,95,0,0,0,122,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,114,85,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,94,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,122,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,105,241,255,255,255,41,11,114,3,0,0,0,114, - 101,0,0,0,114,102,0,0,0,114,103,0,0,0,114,21, - 0,0,0,114,105,0,0,0,114,48,0,0,0,114,110,0, - 0,0,114,1,0,0,0,114,133,0,0,0,114,132,0,0, - 0,41,17,114,28,0,0,0,114,51,0,0,0,90,8,100, - 97,116,97,112,97,116,104,114,121,0,0,0,114,125,0,0, - 0,114,116,0,0,0,114,128,0,0,0,114,122,0,0,0, - 114,123,0,0,0,114,124,0,0,0,114,114,0,0,0,114, - 115,0,0,0,114,126,0,0,0,114,127,0,0,0,114,118, - 0,0,0,90,8,114,97,119,95,100,97,116,97,114,130,0, - 0,0,114,9,0,0,0,114,9,0,0,0,114,10,0,0, - 0,114,49,0,0,0,19,2,0,0,115,62,0,0,0,0, - 1,20,1,8,1,8,2,16,2,2,1,14,1,14,1,24, - 1,10,1,12,1,8,2,16,2,18,2,16,1,16,1,12, - 1,8,1,2,1,14,1,16,1,24,1,10,1,14,1,18, - 2,10,2,4,3,2,1,10,1,16,1,14,1,114,49,0, - 0,0,99,2,0,0,0,0,0,0,0,2,0,0,0,3, - 0,0,0,67,0,0,0,115,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,65, - 2,0,0,115,2,0,0,0,0,2,114,136,0,0,0,99, - 3,0,0,0,0,0,0,0,5,0,0,0,5,0,0,0, - 67,0,0,0,115,206,0,0,0,116,0,124,1,131,1,100, - 1,107,0,114,20,116,1,100,2,131,1,130,1,124,1,100, - 0,100,3,133,2,25,0,116,2,106,3,107,3,114,54,116, - 4,160,5,100,4,124,0,161,2,1,0,100,0,83,0,116, - 6,124,1,100,3,100,5,133,2,25,0,131,1,125,3,124, - 3,100,6,107,3,114,112,116,7,106,8,100,7,107,3,114, - 110,124,3,100,8,107,3,115,106,116,7,106,8,100,9,107, - 2,114,110,100,0,83,0,110,46,124,2,100,6,107,3,114, - 158,116,9,116,6,124,1,100,5,100,10,133,2,25,0,131, - 1,124,2,131,2,115,158,116,4,160,5,100,11,124,0,161, - 2,1,0,100,0,83,0,116,10,160,11,124,1,100,1,100, - 0,133,2,25,0,161,1,125,4,116,12,124,4,116,13,131, - 2,115,202,116,14,100,12,124,0,155,2,100,13,157,3,131, - 1,130,1,124,4,83,0,41,14,78,114,87,0,0,0,122, - 12,98,97,100,32,112,121,99,32,100,97,116,97,114,85,0, - 0,0,122,18,123,33,114,125,32,104,97,115,32,98,97,100, - 32,109,97,103,105,99,114,90,0,0,0,114,0,0,0,0, - 90,5,110,101,118,101,114,114,5,0,0,0,90,6,97,108, - 119,97,121,115,114,86,0,0,0,122,18,123,33,114,125,32, - 104,97,115,32,98,97,100,32,109,116,105,109,101,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,15,114,48,0,0,0,114,3,0, - 0,0,114,20,0,0,0,90,12,77,65,71,73,67,95,78, - 85,77,66,69,82,114,69,0,0,0,114,70,0,0,0,114, - 2,0,0,0,218,4,95,105,109,112,90,21,99,104,101,99, - 107,95,104,97,115,104,95,98,97,115,101,100,95,112,121,99, - 115,114,136,0,0,0,218,7,109,97,114,115,104,97,108,90, + 1,124,3,100,0,100,6,133,2,25,0,116,9,107,3,144, + 1,114,180,122,24,124,1,160,4,100,7,100,4,161,2,1, + 0,124,1,160,6,161,0,125,4,87,0,110,38,4,0,116, + 2,107,10,114,250,1,0,1,0,1,0,116,3,100,5,124, + 0,155,2,157,2,124,0,100,3,141,2,130,1,89,0,110, + 2,88,0,116,10,124,4,116,11,24,0,116,5,24,0,100, + 7,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,40,4,0,116, + 2,107,10,144,1,114,76,1,0,1,0,1,0,116,3,100, + 5,124,0,155,2,157,2,124,0,100,3,141,2,130,1,89, + 0,110,2,88,0,124,6,160,12,116,9,161,1,125,7,124, + 7,100,7,107,0,144,1,114,116,116,3,100,8,124,0,155, + 2,157,2,124,0,100,3,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,164,116,3,100,9,124,0,155, + 2,157,2,124,0,100,3,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, + 10,100,11,133,2,25,0,131,1,125,8,116,13,124,3,100, + 11,100,12,133,2,25,0,131,1,125,9,124,2,124,8,107, + 0,144,1,114,240,116,3,100,13,124,0,155,2,157,2,124, + 0,100,3,141,2,130,1,124,2,124,9,107,0,144,2,114, + 12,116,3,100,14,124,0,155,2,157,2,124,0,100,3,141, + 2,130,1,124,2,124,8,56,0,125,2,124,2,124,9,24, + 0,125,10,124,10,100,7,107,0,144,2,114,56,116,3,100, + 15,124,0,155,2,157,2,124,0,100,3,141,2,130,1,105, + 0,125,11,100,7,125,12,122,14,124,1,160,4,124,2,161, + 1,1,0,87,0,110,40,4,0,116,2,107,10,144,2,114, + 118,1,0,1,0,1,0,116,3,100,5,124,0,155,2,157, + 2,124,0,100,3,141,2,130,1,89,0,110,2,88,0,124, + 1,160,7,100,16,161,1,125,3,116,8,124,3,131,1,100, + 6,107,0,144,2,114,152,116,14,100,17,131,1,130,1,124, + 3,100,0,100,6,133,2,25,0,100,18,107,3,144,2,114, + 174,144,4,113,226,116,8,124,3,131,1,100,16,107,3,144, + 2,114,196,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,10,133,2,25,0,131,1,125,14,116,15,124,3,100, + 10,100,21,133,2,25,0,131,1,125,15,116,15,124,3,100, + 21,100,11,133,2,25,0,131,1,125,16,116,13,124,3,100, + 11,100,12,133,2,25,0,131,1,125,17,116,13,124,3,100, + 12,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, + 156,116,3,100,28,124,0,155,2,157,2,124,0,100,3,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,40,4,0,116,2,107, + 10,144,3,114,218,1,0,1,0,1,0,116,3,100,5,124, + 0,155,2,157,2,124,0,100,3,141,2,130,1,89,0,110, + 2,88,0,116,8,124,23,131,1,124,19,107,3,144,3,114, + 252,116,3,100,5,124,0,155,2,157,2,124,0,100,3,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, + 44,116,3,100,5,124,0,155,2,157,2,124,0,100,3,141, + 2,130,1,87,0,110,40,4,0,116,2,107,10,144,4,114, + 86,1,0,1,0,1,0,116,3,100,5,124,0,155,2,157, + 2,124,0,100,3,141,2,130,1,89,0,110,2,88,0,124, + 13,100,29,64,0,144,4,114,108,124,23,160,16,161,0,125, + 23,110,54,122,14,124,23,160,16,100,30,161,1,125,23,87, + 0,110,38,4,0,116,17,107,10,144,4,114,160,1,0,1, + 0,1,0,124,23,160,16,100,31,161,1,160,18,116,19,161, + 1,125,23,89,0,110,2,88,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,120,87,0,53,0,81,0,82, + 0,88,0,116,24,160,25,100,34,124,12,124,0,161,3,1, + 0,124,11,83,0,41,35,78,218,2,114,98,122,21,99,97, + 110,39,116,32,111,112,101,110,32,90,105,112,32,102,105,108, + 101,58,32,41,1,114,12,0,0,0,114,79,0,0,0,122, + 21,99,97,110,39,116,32,114,101,97,100,32,90,105,112,32, + 102,105,108,101,58,32,233,4,0,0,0,114,0,0,0,0, + 122,16,110,111,116,32,97,32,90,105,112,32,102,105,108,101, + 58,32,122,18,99,111,114,114,117,112,116,32,90,105,112,32, + 102,105,108,101,58,32,233,12,0,0,0,233,16,0,0,0, + 233,20,0,0,0,122,28,98,97,100,32,99,101,110,116,114, + 97,108,32,100,105,114,101,99,116,111,114,121,32,115,105,122, + 101,58,32,122,30,98,97,100,32,99,101,110,116,114,97,108, + 32,100,105,114,101,99,116,111,114,121,32,111,102,102,115,101, + 116,58,32,122,38,98,97,100,32,99,101,110,116,114,97,108, + 32,100,105,114,101,99,116,111,114,121,32,115,105,122,101,32, + 111,114,32,111,102,102,115,101,116,58,32,233,46,0,0,0, + 122,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,4,111,112,101,110,114,21,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,48,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,55,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,18,0,0,0,114,19,0,0, + 0,114,20,0,0,0,114,29,0,0,0,114,69,0,0,0, + 114,70,0,0,0,41,26,114,28,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,32,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,54,0,0,0,114,12,0,0,0,218, + 1,116,114,9,0,0,0,114,9,0,0,0,114,10,0,0, + 0,114,26,0,0,0,96,1,0,0,115,212,0,0,0,0, + 1,2,1,16,1,14,1,24,2,8,1,2,1,14,1,8, + 1,14,1,14,1,24,1,12,1,18,1,18,3,2,1,12, + 1,12,1,14,1,10,1,2,255,12,2,8,1,2,255,2, + 1,2,255,4,2,2,1,10,1,12,1,16,1,10,1,2, + 255,12,2,10,1,10,1,10,1,2,255,6,2,16,1,14, + 1,10,1,2,255,6,2,16,2,16,1,16,1,10,1,18, + 1,10,1,18,1,8,1,8,1,10,1,18,2,4,2,4, + 1,2,1,14,1,16,1,24,2,10,1,14,1,8,2,18, + 1,4,1,14,1,8,1,16,1,16,1,16,1,16,1,16, + 1,16,1,16,1,16,1,16,1,16,1,16,1,12,1,10, + 1,18,1,8,2,2,1,14,1,16,1,24,1,14,1,18, + 4,2,1,28,1,22,1,16,1,24,2,10,2,10,3,2, + 1,14,1,16,1,22,2,12,1,12,1,20,1,8,1,22, + 1,14,1,114,26,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,1,0,0,0,8,0,0,0,67,0,0,0, + 115,108,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, + 60,122,16,100,4,100,5,108,4,109,5,125,0,1,0,87, + 0,110,38,4,0,116,6,107,10,114,82,1,0,1,0,1, + 0,116,1,160,2,100,1,161,1,1,0,116,3,100,2,131, + 1,130,1,89,0,110,2,88,0,87,0,53,0,100,6,97, + 0,88,0,116,1,160,2,100,7,161,1,1,0,124,0,83, + 0,41,8,78,122,27,122,105,112,105,109,112,111,114,116,58, + 32,122,108,105,98,32,85,78,65,86,65,73,76,65,66,76, + 69,122,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,41,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, + 69,0,0,0,114,70,0,0,0,114,3,0,0,0,90,4, + 122,108,105,98,114,130,0,0,0,218,9,69,120,99,101,112, + 116,105,111,110,41,1,114,130,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, + 254,1,0,0,115,24,0,0,0,0,2,4,3,10,1,8, + 2,4,1,4,1,16,1,14,1,10,1,18,2,6,2,10, + 1,114,133,0,0,0,99,2,0,0,0,0,0,0,0,17, + 0,0,0,9,0,0,0,67,0,0,0,115,130,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,100,3,161,2,144,1, + 143,8,125,10,122,14,124,10,160,3,124,6,161,1,1,0, + 87,0,110,38,4,0,116,4,107,10,114,104,1,0,1,0, + 1,0,116,0,100,4,124,0,155,2,157,2,124,0,100,5, + 141,2,130,1,89,0,110,2,88,0,124,10,160,5,100,6, + 161,1,125,11,116,6,124,11,131,1,100,6,107,3,114,136, + 116,7,100,7,131,1,130,1,124,11,100,0,100,8,133,2, + 25,0,100,9,107,3,114,170,116,0,100,10,124,0,155,2, + 157,2,124,0,100,5,141,2,130,1,116,8,124,11,100,11, + 100,12,133,2,25,0,131,1,125,12,116,8,124,11,100,12, + 100,6,133,2,25,0,131,1,125,13,100,6,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,40,4,0, + 116,4,107,10,144,1,114,20,1,0,1,0,1,0,116,0, + 100,4,124,0,155,2,157,2,124,0,100,5,141,2,130,1, + 89,0,110,2,88,0,124,10,160,5,124,4,161,1,125,15, + 116,6,124,15,131,1,124,4,107,3,144,1,114,54,116,4, + 100,13,131,1,130,1,87,0,53,0,81,0,82,0,88,0, + 124,3,100,1,107,2,144,1,114,78,124,15,83,0,122,10, + 116,9,131,0,125,16,87,0,110,30,4,0,116,10,107,10, + 144,1,114,118,1,0,1,0,1,0,116,0,100,14,131,1, + 130,1,89,0,110,2,88,0,124,16,124,15,100,15,131,2, + 83,0,41,16,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,84, + 0,0,0,122,21,99,97,110,39,116,32,114,101,97,100,32, + 90,105,112,32,102,105,108,101,58,32,41,1,114,12,0,0, + 0,114,95,0,0,0,122,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,114,85,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, + 94,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, + 122,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,105,241,255,255,255, + 41,11,114,3,0,0,0,114,101,0,0,0,114,102,0,0, + 0,114,103,0,0,0,114,21,0,0,0,114,105,0,0,0, + 114,48,0,0,0,114,110,0,0,0,114,1,0,0,0,114, + 133,0,0,0,114,132,0,0,0,41,17,114,28,0,0,0, + 114,51,0,0,0,90,8,100,97,116,97,112,97,116,104,114, + 121,0,0,0,114,125,0,0,0,114,116,0,0,0,114,128, + 0,0,0,114,122,0,0,0,114,123,0,0,0,114,124,0, + 0,0,114,114,0,0,0,114,115,0,0,0,114,126,0,0, + 0,114,127,0,0,0,114,118,0,0,0,90,8,114,97,119, + 95,100,97,116,97,114,130,0,0,0,114,9,0,0,0,114, + 9,0,0,0,114,10,0,0,0,114,49,0,0,0,19,2, + 0,0,115,62,0,0,0,0,1,20,1,8,1,8,2,16, + 2,2,1,14,1,14,1,24,1,10,1,12,1,8,2,16, + 2,18,2,16,1,16,1,12,1,8,1,2,1,14,1,16, + 1,24,1,10,1,14,1,18,2,10,2,4,3,2,1,10, + 1,16,1,14,1,114,49,0,0,0,99,2,0,0,0,0, + 0,0,0,2,0,0,0,3,0,0,0,67,0,0,0,115, + 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,65,2,0,0,115,2,0,0,0, + 0,2,114,136,0,0,0,99,5,0,0,0,0,0,0,0, + 14,0,0,0,8,0,0,0,67,0,0,0,115,68,1,0, + 0,124,3,124,2,100,1,156,2,125,5,122,18,116,0,160, + 1,124,4,124,3,124,5,161,3,125,6,87,0,110,26,4, + 0,116,2,107,10,114,54,1,0,1,0,1,0,89,0,100, + 0,83,0,89,0,110,2,88,0,124,6,100,2,64,0,100, + 3,107,3,125,7,124,7,114,190,124,6,100,4,64,0,100, + 3,107,3,125,8,116,3,106,4,100,5,107,3,114,188,124, + 8,115,108,116,3,106,4,100,6,107,2,114,188,116,5,124, + 0,124,2,131,2,125,9,124,9,100,0,107,9,114,188,116, + 3,160,6,116,0,106,7,124,9,161,2,125,10,122,20,116, + 8,160,9,124,4,124,10,124,3,124,5,161,4,1,0,87, + 0,110,26,4,0,116,2,107,10,114,186,1,0,1,0,1, + 0,89,0,100,0,83,0,89,0,110,2,88,0,110,84,116, + 10,124,0,124,2,131,2,92,2,125,11,125,12,124,11,144, + 1,114,18,116,11,116,12,124,4,100,7,100,8,133,2,25, + 0,131,1,124,11,131,2,114,254,116,12,124,4,100,8,100, + 9,133,2,25,0,131,1,124,12,107,3,144,1,114,18,116, + 13,160,14,100,10,124,3,155,2,157,2,161,1,1,0,100, + 0,83,0,116,15,160,16,124,4,100,9,100,0,133,2,25, + 0,161,1,125,13,116,17,124,13,116,18,131,2,144,1,115, + 64,116,19,100,11,124,1,155,2,100,12,157,3,131,1,130, + 1,124,13,83,0,41,13,78,41,2,114,54,0,0,0,114, + 12,0,0,0,114,5,0,0,0,114,0,0,0,0,114,79, + 0,0,0,90,5,110,101,118,101,114,90,6,97,108,119,97, + 121,115,114,90,0,0,0,114,86,0,0,0,114,87,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,20,114,20,0,0,0,90,13,95,99,108,97,115, + 115,105,102,121,95,112,121,99,114,68,0,0,0,218,4,95, + 105,109,112,90,21,99,104,101,99,107,95,104,97,115,104,95, + 98,97,115,101,100,95,112,121,99,115,218,15,95,103,101,116, + 95,112,121,99,95,115,111,117,114,99,101,218,11,115,111,117, + 114,99,101,95,104,97,115,104,90,17,95,82,65,87,95,77, + 65,71,73,67,95,78,85,77,66,69,82,90,18,95,98,111, + 111,115,116,114,97,112,95,101,120,116,101,114,110,97,108,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,136,0,0,0,114,2,0,0,0,114,69,0,0, + 0,114,70,0,0,0,218,7,109,97,114,115,104,97,108,90, 5,108,111,97,100,115,114,14,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,5,114,50,0,0,0,114,117,0,0,0,218,5, - 109,116,105,109,101,114,120,0,0,0,114,43,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,73, - 2,0,0,115,40,0,0,0,0,1,12,1,8,2,18,1, - 12,1,4,2,16,1,8,5,10,1,6,255,2,1,8,255, - 2,2,6,1,30,1,12,1,4,4,18,1,10,1,16,1, - 114,142,0,0,0,99,1,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,18,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,106,2,0,0,115,6, - 0,0,0,0,1,12,1,12,1,114,146,0,0,0,99,2, - 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,67,0,0,0,84,41,1,90,12,100,111,110, - 116,95,105,110,104,101,114,105,116,41,2,114,146,0,0,0, - 218,7,99,111,109,112,105,108,101,41,2,114,50,0,0,0, - 114,145,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,113,2,0,0,115,4,0,0,0,0,1, - 8,1,114,148,0,0,0,99,2,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,79,0,0,0, - 114,13,0,0,0,41,2,114,122,0,0,0,90,6,109,107, - 116,105,109,101,41,2,218,1,100,114,129,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,119,2,0, - 0,115,24,0,0,0,0,1,4,1,10,1,10,1,6,1, - 6,1,10,1,10,1,2,0,2,0,2,250,2,255,114,156, - 0,0,0,99,2,0,0,0,0,0,0,0,5,0,0,0, - 10,0,0,0,67,0,0,0,115,104,0,0,0,122,70,124, - 1,100,1,100,0,133,2,25,0,100,2,107,6,115,22,116, - 0,130,1,124,1,100,0,100,1,133,2,25,0,125,1,124, - 0,106,1,124,1,25,0,125,2,124,2,100,3,25,0,125, - 3,124,2,100,4,25,0,125,4,116,2,124,4,124,3,131, - 2,87,0,83,0,4,0,116,3,116,4,116,5,102,3,107, - 10,114,98,1,0,1,0,1,0,89,0,100,5,83,0,88, - 0,100,0,83,0,41,6,78,114,13,0,0,0,41,2,218, - 1,99,218,1,111,114,150,0,0,0,233,6,0,0,0,114, - 0,0,0,0,41,6,218,14,65,115,115,101,114,116,105,111, - 110,69,114,114,111,114,114,27,0,0,0,114,156,0,0,0, - 114,25,0,0,0,218,10,73,110,100,101,120,69,114,114,111, - 114,114,140,0,0,0,41,5,114,31,0,0,0,114,12,0, - 0,0,114,51,0,0,0,114,122,0,0,0,114,123,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,109,116,105,109,101,95,111,102,95, - 115,111,117,114,99,101,132,2,0,0,115,18,0,0,0,0, - 1,2,2,20,1,12,1,10,3,8,1,8,1,12,1,20, - 1,114,162,0,0,0,99,2,0,0,0,0,0,0,0,12, - 0,0,0,9,0,0,0,67,0,0,0,115,204,0,0,0, - 116,0,124,0,124,1,131,2,125,2,116,1,68,0,93,166, - 92,3,125,3,125,4,125,5,124,2,124,3,23,0,125,6, - 116,2,106,3,100,1,124,0,106,4,116,5,124,6,100,2, - 100,3,141,5,1,0,122,14,124,0,106,6,124,6,25,0, - 125,7,87,0,110,20,4,0,116,7,107,10,114,88,1,0, - 1,0,1,0,89,0,113,14,88,0,124,7,100,4,25,0, - 125,8,116,8,124,0,106,4,124,7,131,2,125,9,124,4, - 114,138,116,9,124,0,124,6,131,2,125,10,116,10,124,8, - 124,9,124,10,131,3,125,11,110,10,116,11,124,8,124,9, - 131,2,125,11,124,11,100,0,107,8,114,158,113,14,124,7, - 100,4,25,0,125,8,124,11,124,5,124,8,102,3,2,0, - 1,0,83,0,113,14,116,12,100,5,124,1,155,2,157,2, - 124,1,100,6,141,2,130,1,100,0,83,0,41,7,78,122, - 13,116,114,121,105,110,103,32,123,125,123,125,123,125,114,79, - 0,0,0,41,1,90,9,118,101,114,98,111,115,105,116,121, - 114,0,0,0,0,122,18,99,97,110,39,116,32,102,105,110, - 100,32,109,111,100,117,108,101,32,41,1,114,54,0,0,0, - 41,13,114,35,0,0,0,114,81,0,0,0,114,69,0,0, - 0,114,70,0,0,0,114,28,0,0,0,114,19,0,0,0, - 114,27,0,0,0,114,25,0,0,0,114,49,0,0,0,114, - 162,0,0,0,114,142,0,0,0,114,148,0,0,0,114,3, - 0,0,0,41,12,114,31,0,0,0,114,37,0,0,0,114, - 12,0,0,0,114,82,0,0,0,114,83,0,0,0,114,44, - 0,0,0,114,56,0,0,0,114,51,0,0,0,114,39,0, - 0,0,114,117,0,0,0,114,141,0,0,0,114,43,0,0, - 0,114,9,0,0,0,114,9,0,0,0,114,10,0,0,0, - 114,42,0,0,0,148,2,0,0,115,38,0,0,0,0,1, - 10,1,14,1,8,1,22,1,2,1,14,1,14,1,6,2, - 8,1,12,1,4,1,10,1,14,2,10,1,8,3,2,1, - 8,1,16,2,114,42,0,0,0,99,0,0,0,0,0,0, - 0,0,0,0,0,0,2,0,0,0,64,0,0,0,115,60, - 0,0,0,101,0,90,1,100,0,90,2,100,1,90,3,100, - 2,90,4,100,3,100,4,132,0,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,83,0,41, - 14,114,73,0,0,0,122,165,80,114,105,118,97,116,101,32, - 99,108,97,115,115,32,117,115,101,100,32,116,111,32,115,117, - 112,112,111,114,116,32,90,105,112,73,109,112,111,114,116,46, - 103,101,116,95,114,101,115,111,117,114,99,101,95,114,101,97, - 100,101,114,40,41,46,10,10,32,32,32,32,84,104,105,115, - 32,99,108,97,115,115,32,105,115,32,97,108,108,111,119,101, - 100,32,116,111,32,114,101,102,101,114,101,110,99,101,32,97, - 108,108,32,116,104,101,32,105,110,110,97,114,100,115,32,97, - 110,100,32,112,114,105,118,97,116,101,32,112,97,114,116,115, - 32,111,102,10,32,32,32,32,116,104,101,32,122,105,112,105, - 109,112,111,114,116,101,114,46,10,32,32,32,32,70,99,3, - 0,0,0,0,0,0,0,3,0,0,0,2,0,0,0,67, - 0,0,0,115,16,0,0,0,124,1,124,0,95,0,124,2, - 124,0,95,1,100,0,83,0,41,1,78,41,2,114,4,0, - 0,0,114,37,0,0,0,41,3,114,31,0,0,0,114,4, - 0,0,0,114,37,0,0,0,114,9,0,0,0,114,9,0, - 0,0,114,10,0,0,0,114,33,0,0,0,183,2,0,0, - 115,4,0,0,0,0,1,6,1,122,33,95,90,105,112,73, - 109,112,111,114,116,82,101,115,111,117,114,99,101,82,101,97, - 100,101,114,46,95,95,105,110,105,116,95,95,99,2,0,0, - 0,0,0,0,0,5,0,0,0,8,0,0,0,67,0,0, - 0,115,92,0,0,0,124,0,106,0,160,1,100,1,100,2, - 161,2,125,2,124,2,155,0,100,2,124,1,155,0,157,3, - 125,3,100,3,100,4,108,2,109,3,125,4,1,0,122,18, - 124,4,124,0,106,4,160,5,124,3,161,1,131,1,87,0, - 83,0,4,0,116,6,107,10,114,86,1,0,1,0,1,0, - 116,7,124,3,131,1,130,1,89,0,110,2,88,0,100,0, - 83,0,41,5,78,114,78,0,0,0,114,100,0,0,0,114, - 0,0,0,0,41,1,218,7,66,121,116,101,115,73,79,41, - 8,114,37,0,0,0,114,18,0,0,0,90,2,105,111,114, - 163,0,0,0,114,4,0,0,0,114,52,0,0,0,114,21, - 0,0,0,218,17,70,105,108,101,78,111,116,70,111,117,110, - 100,69,114,114,111,114,41,5,114,31,0,0,0,218,8,114, - 101,115,111,117,114,99,101,218,16,102,117,108,108,110,97,109, - 101,95,97,115,95,112,97,116,104,114,12,0,0,0,114,163, - 0,0,0,114,9,0,0,0,114,9,0,0,0,114,10,0, - 0,0,218,13,111,112,101,110,95,114,101,115,111,117,114,99, - 101,187,2,0,0,115,14,0,0,0,0,1,14,1,14,1, - 12,1,2,1,18,1,14,1,122,38,95,90,105,112,73,109, + 111,114,41,14,114,31,0,0,0,114,50,0,0,0,114,56, + 0,0,0,114,37,0,0,0,114,117,0,0,0,90,11,101, + 120,99,95,100,101,116,97,105,108,115,114,120,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,139,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,43,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,75,2,0,0, + 115,88,0,0,0,0,2,2,1,2,254,6,5,2,1,18, + 1,14,1,12,2,12,1,4,1,12,1,10,1,2,255,2, + 1,8,255,2,2,10,1,8,1,4,1,4,1,2,254,4, + 5,2,1,4,1,2,0,2,0,2,0,2,255,8,2,14, + 1,14,3,8,255,6,3,6,3,22,1,18,255,4,2,4, + 1,8,255,4,2,4,2,18,1,12,1,16,1,114,144,0, + 0,0,99,1,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,18,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,126,2,0,0,115,6,0,0,0, + 0,1,12,1,12,1,114,148,0,0,0,99,2,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,67,0,0,0,84,41,1,90,12,100,111,110,116,95,105, + 110,104,101,114,105,116,41,2,114,148,0,0,0,218,7,99, + 111,109,112,105,108,101,41,2,114,50,0,0,0,114,147,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,133,2,0,0,115,4,0,0,0,0,1,8,1,114, + 150,0,0,0,99,2,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,79,0,0,0,114,13,0, + 0,0,41,2,114,122,0,0,0,90,6,109,107,116,105,109, + 101,41,2,218,1,100,114,129,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,139,2,0,0,115,24, + 0,0,0,0,1,4,1,10,1,10,1,6,1,6,1,10, + 1,10,1,2,0,2,0,2,250,2,255,114,158,0,0,0, + 99,2,0,0,0,0,0,0,0,6,0,0,0,10,0,0, + 0,67,0,0,0,115,116,0,0,0,122,82,124,1,100,1, + 100,0,133,2,25,0,100,2,107,6,115,22,116,0,130,1, + 124,1,100,0,100,1,133,2,25,0,125,1,124,0,106,1, + 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,2, + 124,4,124,3,131,2,124,5,102,2,87,0,83,0,4,0, + 116,3,116,4,116,5,102,3,107,10,114,110,1,0,1,0, + 1,0,89,0,100,6,83,0,88,0,100,0,83,0,41,7, + 78,114,13,0,0,0,41,2,218,1,99,218,1,111,114,152, + 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,6,218,14,65,115,115, + 101,114,116,105,111,110,69,114,114,111,114,114,27,0,0,0, + 114,158,0,0,0,114,25,0,0,0,218,10,73,110,100,101, + 120,69,114,114,111,114,114,143,0,0,0,41,6,114,31,0, + 0,0,114,12,0,0,0,114,51,0,0,0,114,122,0,0, + 0,114,123,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,140,0,0,0,152,2,0, + 0,115,20,0,0,0,0,1,2,2,20,1,12,1,10,3, + 8,1,8,1,8,1,16,1,20,1,114,140,0,0,0,99, + 2,0,0,0,0,0,0,0,3,0,0,0,8,0,0,0, + 67,0,0,0,115,86,0,0,0,124,1,100,1,100,0,133, + 2,25,0,100,2,107,6,115,20,116,0,130,1,124,1,100, + 0,100,1,133,2,25,0,125,1,122,14,124,0,106,1,124, + 1,25,0,125,2,87,0,110,22,4,0,116,2,107,10,114, + 68,1,0,1,0,1,0,89,0,100,0,83,0,88,0,116, + 3,124,0,106,4,124,2,131,2,83,0,100,0,83,0,41, + 3,78,114,13,0,0,0,41,2,114,159,0,0,0,114,160, + 0,0,0,41,5,114,163,0,0,0,114,27,0,0,0,114, + 25,0,0,0,114,49,0,0,0,114,28,0,0,0,41,3, + 114,31,0,0,0,114,12,0,0,0,114,51,0,0,0,114, + 9,0,0,0,114,9,0,0,0,114,10,0,0,0,114,138, + 0,0,0,171,2,0,0,115,14,0,0,0,0,2,20,1, + 12,2,2,1,14,1,14,1,8,2,114,138,0,0,0,99, + 2,0,0,0,0,0,0,0,11,0,0,0,9,0,0,0, + 67,0,0,0,115,198,0,0,0,116,0,124,0,124,1,131, + 2,125,2,116,1,68,0,93,160,92,3,125,3,125,4,125, + 5,124,2,124,3,23,0,125,6,116,2,106,3,100,1,124, + 0,106,4,116,5,124,6,100,2,100,3,141,5,1,0,122, + 14,124,0,106,6,124,6,25,0,125,7,87,0,110,20,4, + 0,116,7,107,10,114,88,1,0,1,0,1,0,89,0,113, + 14,88,0,124,7,100,4,25,0,125,8,116,8,124,0,106, + 4,124,7,131,2,125,9,124,4,114,132,116,9,124,0,124, + 8,124,6,124,1,124,9,131,5,125,10,110,10,116,10,124, + 8,124,9,131,2,125,10,124,10,100,0,107,8,114,152,113, + 14,124,7,100,4,25,0,125,8,124,10,124,5,124,8,102, + 3,2,0,1,0,83,0,113,14,116,11,100,5,124,1,155, + 2,157,2,124,1,100,6,141,2,130,1,100,0,83,0,41, + 7,78,122,13,116,114,121,105,110,103,32,123,125,123,125,123, + 125,114,79,0,0,0,41,1,90,9,118,101,114,98,111,115, + 105,116,121,114,0,0,0,0,122,18,99,97,110,39,116,32, + 102,105,110,100,32,109,111,100,117,108,101,32,41,1,114,54, + 0,0,0,41,12,114,35,0,0,0,114,81,0,0,0,114, + 69,0,0,0,114,70,0,0,0,114,28,0,0,0,114,19, + 0,0,0,114,27,0,0,0,114,25,0,0,0,114,49,0, + 0,0,114,144,0,0,0,114,150,0,0,0,114,3,0,0, + 0,41,11,114,31,0,0,0,114,37,0,0,0,114,12,0, + 0,0,114,82,0,0,0,114,83,0,0,0,114,44,0,0, + 0,114,56,0,0,0,114,51,0,0,0,114,39,0,0,0, + 114,117,0,0,0,114,43,0,0,0,114,9,0,0,0,114, + 9,0,0,0,114,10,0,0,0,114,42,0,0,0,186,2, + 0,0,115,36,0,0,0,0,1,10,1,14,1,8,1,22, + 1,2,1,14,1,14,1,6,2,8,1,12,1,4,1,18, + 2,10,1,8,3,2,1,8,1,16,2,114,42,0,0,0, + 99,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0, + 0,64,0,0,0,115,60,0,0,0,101,0,90,1,100,0, + 90,2,100,1,90,3,100,2,90,4,100,3,100,4,132,0, + 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,83,0,41,14,114,73,0,0,0,122,165,80, + 114,105,118,97,116,101,32,99,108,97,115,115,32,117,115,101, + 100,32,116,111,32,115,117,112,112,111,114,116,32,90,105,112, + 73,109,112,111,114,116,46,103,101,116,95,114,101,115,111,117, + 114,99,101,95,114,101,97,100,101,114,40,41,46,10,10,32, + 32,32,32,84,104,105,115,32,99,108,97,115,115,32,105,115, + 32,97,108,108,111,119,101,100,32,116,111,32,114,101,102,101, + 114,101,110,99,101,32,97,108,108,32,116,104,101,32,105,110, + 110,97,114,100,115,32,97,110,100,32,112,114,105,118,97,116, + 101,32,112,97,114,116,115,32,111,102,10,32,32,32,32,116, + 104,101,32,122,105,112,105,109,112,111,114,116,101,114,46,10, + 32,32,32,32,70,99,3,0,0,0,0,0,0,0,3,0, + 0,0,2,0,0,0,67,0,0,0,115,16,0,0,0,124, + 1,124,0,95,0,124,2,124,0,95,1,100,0,83,0,41, + 1,78,41,2,114,4,0,0,0,114,37,0,0,0,41,3, + 114,31,0,0,0,114,4,0,0,0,114,37,0,0,0,114, + 9,0,0,0,114,9,0,0,0,114,10,0,0,0,114,33, + 0,0,0,220,2,0,0,115,4,0,0,0,0,1,6,1, + 122,33,95,90,105,112,73,109,112,111,114,116,82,101,115,111, + 117,114,99,101,82,101,97,100,101,114,46,95,95,105,110,105, + 116,95,95,99,2,0,0,0,0,0,0,0,5,0,0,0, + 8,0,0,0,67,0,0,0,115,92,0,0,0,124,0,106, + 0,160,1,100,1,100,2,161,2,125,2,124,2,155,0,100, + 2,124,1,155,0,157,3,125,3,100,3,100,4,108,2,109, + 3,125,4,1,0,122,18,124,4,124,0,106,4,160,5,124, + 3,161,1,131,1,87,0,83,0,4,0,116,6,107,10,114, + 86,1,0,1,0,1,0,116,7,124,3,131,1,130,1,89, + 0,110,2,88,0,100,0,83,0,41,5,78,114,78,0,0, + 0,114,100,0,0,0,114,0,0,0,0,41,1,218,7,66, + 121,116,101,115,73,79,41,8,114,37,0,0,0,114,18,0, + 0,0,90,2,105,111,114,165,0,0,0,114,4,0,0,0, + 114,52,0,0,0,114,21,0,0,0,218,17,70,105,108,101, + 78,111,116,70,111,117,110,100,69,114,114,111,114,41,5,114, + 31,0,0,0,218,8,114,101,115,111,117,114,99,101,218,16, + 102,117,108,108,110,97,109,101,95,97,115,95,112,97,116,104, + 114,12,0,0,0,114,165,0,0,0,114,9,0,0,0,114, + 9,0,0,0,114,10,0,0,0,218,13,111,112,101,110,95, + 114,101,115,111,117,114,99,101,224,2,0,0,115,14,0,0, + 0,0,1,14,1,14,1,12,1,2,1,18,1,14,1,122, + 38,95,90,105,112,73,109,112,111,114,116,82,101,115,111,117, + 114,99,101,82,101,97,100,101,114,46,111,112,101,110,95,114, + 101,115,111,117,114,99,101,99,2,0,0,0,0,0,0,0, + 2,0,0,0,1,0,0,0,67,0,0,0,115,8,0,0, + 0,116,0,130,1,100,0,83,0,41,1,78,41,1,114,166, + 0,0,0,41,2,114,31,0,0,0,114,167,0,0,0,114, + 9,0,0,0,114,9,0,0,0,114,10,0,0,0,218,13, + 114,101,115,111,117,114,99,101,95,112,97,116,104,233,2,0, + 0,115,2,0,0,0,0,4,122,38,95,90,105,112,73,109, 112,111,114,116,82,101,115,111,117,114,99,101,82,101,97,100, - 101,114,46,111,112,101,110,95,114,101,115,111,117,114,99,101, - 99,2,0,0,0,0,0,0,0,2,0,0,0,1,0,0, - 0,67,0,0,0,115,8,0,0,0,116,0,130,1,100,0, - 83,0,41,1,78,41,1,114,164,0,0,0,41,2,114,31, - 0,0,0,114,165,0,0,0,114,9,0,0,0,114,9,0, - 0,0,114,10,0,0,0,218,13,114,101,115,111,117,114,99, - 101,95,112,97,116,104,196,2,0,0,115,2,0,0,0,0, - 4,122,38,95,90,105,112,73,109,112,111,114,116,82,101,115, - 111,117,114,99,101,82,101,97,100,101,114,46,114,101,115,111, - 117,114,99,101,95,112,97,116,104,99,2,0,0,0,0,0, - 0,0,4,0,0,0,8,0,0,0,67,0,0,0,115,72, - 0,0,0,124,0,106,0,160,1,100,1,100,2,161,2,125, - 2,124,2,155,0,100,2,124,1,155,0,157,3,125,3,122, - 16,124,0,106,2,160,3,124,3,161,1,1,0,87,0,110, - 22,4,0,116,4,107,10,114,66,1,0,1,0,1,0,89, - 0,100,3,83,0,88,0,100,4,83,0,41,5,78,114,78, - 0,0,0,114,100,0,0,0,70,84,41,5,114,37,0,0, - 0,114,18,0,0,0,114,4,0,0,0,114,52,0,0,0, - 114,21,0,0,0,41,4,114,31,0,0,0,114,54,0,0, - 0,114,166,0,0,0,114,12,0,0,0,114,9,0,0,0, - 114,9,0,0,0,114,10,0,0,0,218,11,105,115,95,114, - 101,115,111,117,114,99,101,202,2,0,0,115,14,0,0,0, - 0,3,14,1,14,1,2,1,16,1,14,1,8,1,122,36, - 95,90,105,112,73,109,112,111,114,116,82,101,115,111,117,114, - 99,101,82,101,97,100,101,114,46,105,115,95,114,101,115,111, - 117,114,99,101,99,1,0,0,0,0,0,0,0,9,0,0, - 0,9,0,0,0,99,0,0,0,115,186,0,0,0,100,1, - 100,2,108,0,109,1,125,1,1,0,124,1,124,0,106,2, - 160,3,124,0,106,4,161,1,131,1,125,2,124,2,160,5, - 124,0,106,2,106,6,161,1,125,3,124,3,106,7,100,3, - 107,2,115,58,116,8,130,1,124,3,106,9,125,4,116,10, - 131,0,125,5,124,0,106,2,106,11,68,0,93,102,125,6, - 122,18,124,1,124,6,131,1,160,5,124,4,161,1,125,7, - 87,0,110,24,4,0,116,12,107,10,114,124,1,0,1,0, - 1,0,89,0,113,78,89,0,110,2,88,0,124,7,106,9, - 106,7,125,8,116,13,124,8,131,1,100,1,107,2,114,156, - 124,7,106,7,86,0,1,0,113,78,124,8,124,5,107,7, - 114,78,124,5,160,14,124,8,161,1,1,0,124,8,86,0, - 1,0,113,78,100,0,83,0,41,4,78,114,0,0,0,0, - 41,1,218,4,80,97,116,104,122,11,95,95,105,110,105,116, - 95,95,46,112,121,41,15,90,7,112,97,116,104,108,105,98, - 114,170,0,0,0,114,4,0,0,0,114,53,0,0,0,114, - 37,0,0,0,90,11,114,101,108,97,116,105,118,101,95,116, - 111,114,28,0,0,0,114,54,0,0,0,114,160,0,0,0, - 90,6,112,97,114,101,110,116,218,3,115,101,116,114,27,0, - 0,0,114,22,0,0,0,114,48,0,0,0,218,3,97,100, - 100,41,9,114,31,0,0,0,114,170,0,0,0,90,13,102, - 117,108,108,110,97,109,101,95,112,97,116,104,90,13,114,101, - 108,97,116,105,118,101,95,112,97,116,104,90,12,112,97,99, - 107,97,103,101,95,112,97,116,104,90,12,115,117,98,100,105, - 114,115,95,115,101,101,110,218,8,102,105,108,101,110,97,109, - 101,90,8,114,101,108,97,116,105,118,101,90,11,112,97,114, - 101,110,116,95,110,97,109,101,114,9,0,0,0,114,9,0, - 0,0,114,10,0,0,0,218,8,99,111,110,116,101,110,116, - 115,213,2,0,0,115,34,0,0,0,0,8,12,1,18,1, - 14,3,14,1,6,1,6,1,12,1,2,1,18,1,14,1, - 10,5,8,1,12,1,10,1,8,1,10,1,122,33,95,90, - 105,112,73,109,112,111,114,116,82,101,115,111,117,114,99,101, - 82,101,97,100,101,114,46,99,111,110,116,101,110,116,115,78, - 41,10,114,6,0,0,0,114,7,0,0,0,114,8,0,0, - 0,114,77,0,0,0,114,74,0,0,0,114,33,0,0,0, - 114,167,0,0,0,114,168,0,0,0,114,169,0,0,0,114, - 174,0,0,0,114,9,0,0,0,114,9,0,0,0,114,9, - 0,0,0,114,10,0,0,0,114,73,0,0,0,175,2,0, - 0,115,14,0,0,0,8,5,4,1,4,2,8,4,8,9, - 8,6,8,11,114,73,0,0,0,41,44,114,77,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,20,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,69, - 0,0,0,114,137,0,0,0,114,101,0,0,0,114,138,0, - 0,0,114,60,0,0,0,114,122,0,0,0,90,7,95,95, - 97,108,108,95,95,114,19,0,0,0,90,15,112,97,116,104, - 95,115,101,112,97,114,97,116,111,114,115,114,17,0,0,0, - 114,68,0,0,0,114,3,0,0,0,114,24,0,0,0,218, - 4,116,121,112,101,114,63,0,0,0,114,104,0,0,0,114, - 106,0,0,0,114,108,0,0,0,114,4,0,0,0,114,81, - 0,0,0,114,35,0,0,0,114,36,0,0,0,114,34,0, - 0,0,114,26,0,0,0,114,113,0,0,0,114,131,0,0, - 0,114,133,0,0,0,114,49,0,0,0,114,136,0,0,0, - 114,142,0,0,0,218,8,95,95,99,111,100,101,95,95,114, - 139,0,0,0,114,146,0,0,0,114,148,0,0,0,114,156, - 0,0,0,114,162,0,0,0,114,42,0,0,0,114,73,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, - 13,0,0,0,115,88,0,0,0,4,4,8,1,16,1,8, - 1,8,1,8,1,8,1,8,1,8,2,8,3,6,1,14, - 3,16,4,4,2,8,2,4,1,4,1,4,2,14,127,0, - 127,0,1,12,1,12,1,2,1,2,253,2,255,2,9,8, - 4,8,9,8,31,8,126,2,254,2,29,4,5,8,21,8, - 46,8,8,8,28,10,5,8,7,8,6,8,13,8,16,8, - 27, + 101,114,46,114,101,115,111,117,114,99,101,95,112,97,116,104, + 99,2,0,0,0,0,0,0,0,4,0,0,0,8,0,0, + 0,67,0,0,0,115,72,0,0,0,124,0,106,0,160,1, + 100,1,100,2,161,2,125,2,124,2,155,0,100,2,124,1, + 155,0,157,3,125,3,122,16,124,0,106,2,160,3,124,3, + 161,1,1,0,87,0,110,22,4,0,116,4,107,10,114,66, + 1,0,1,0,1,0,89,0,100,3,83,0,88,0,100,4, + 83,0,41,5,78,114,78,0,0,0,114,100,0,0,0,70, + 84,41,5,114,37,0,0,0,114,18,0,0,0,114,4,0, + 0,0,114,52,0,0,0,114,21,0,0,0,41,4,114,31, + 0,0,0,114,54,0,0,0,114,168,0,0,0,114,12,0, + 0,0,114,9,0,0,0,114,9,0,0,0,114,10,0,0, + 0,218,11,105,115,95,114,101,115,111,117,114,99,101,239,2, + 0,0,115,14,0,0,0,0,3,14,1,14,1,2,1,16, + 1,14,1,8,1,122,36,95,90,105,112,73,109,112,111,114, + 116,82,101,115,111,117,114,99,101,82,101,97,100,101,114,46, + 105,115,95,114,101,115,111,117,114,99,101,99,1,0,0,0, + 0,0,0,0,9,0,0,0,9,0,0,0,99,0,0,0, + 115,186,0,0,0,100,1,100,2,108,0,109,1,125,1,1, + 0,124,1,124,0,106,2,160,3,124,0,106,4,161,1,131, + 1,125,2,124,2,160,5,124,0,106,2,106,6,161,1,125, + 3,124,3,106,7,100,3,107,2,115,58,116,8,130,1,124, + 3,106,9,125,4,116,10,131,0,125,5,124,0,106,2,106, + 11,68,0,93,102,125,6,122,18,124,1,124,6,131,1,160, + 5,124,4,161,1,125,7,87,0,110,24,4,0,116,12,107, + 10,114,124,1,0,1,0,1,0,89,0,113,78,89,0,110, + 2,88,0,124,7,106,9,106,7,125,8,116,13,124,8,131, + 1,100,1,107,2,114,156,124,7,106,7,86,0,1,0,113, + 78,124,8,124,5,107,7,114,78,124,5,160,14,124,8,161, + 1,1,0,124,8,86,0,1,0,113,78,100,0,83,0,41, + 4,78,114,0,0,0,0,41,1,218,4,80,97,116,104,122, + 11,95,95,105,110,105,116,95,95,46,112,121,41,15,90,7, + 112,97,116,104,108,105,98,114,172,0,0,0,114,4,0,0, + 0,114,53,0,0,0,114,37,0,0,0,90,11,114,101,108, + 97,116,105,118,101,95,116,111,114,28,0,0,0,114,54,0, + 0,0,114,163,0,0,0,90,6,112,97,114,101,110,116,218, + 3,115,101,116,114,27,0,0,0,114,22,0,0,0,114,48, + 0,0,0,218,3,97,100,100,41,9,114,31,0,0,0,114, + 172,0,0,0,90,13,102,117,108,108,110,97,109,101,95,112, + 97,116,104,90,13,114,101,108,97,116,105,118,101,95,112,97, + 116,104,90,12,112,97,99,107,97,103,101,95,112,97,116,104, + 90,12,115,117,98,100,105,114,115,95,115,101,101,110,218,8, + 102,105,108,101,110,97,109,101,90,8,114,101,108,97,116,105, + 118,101,90,11,112,97,114,101,110,116,95,110,97,109,101,114, + 9,0,0,0,114,9,0,0,0,114,10,0,0,0,218,8, + 99,111,110,116,101,110,116,115,250,2,0,0,115,34,0,0, + 0,0,8,12,1,18,1,14,3,14,1,6,1,6,1,12, + 1,2,1,18,1,14,1,10,5,8,1,12,1,10,1,8, + 1,10,1,122,33,95,90,105,112,73,109,112,111,114,116,82, + 101,115,111,117,114,99,101,82,101,97,100,101,114,46,99,111, + 110,116,101,110,116,115,78,41,10,114,6,0,0,0,114,7, + 0,0,0,114,8,0,0,0,114,77,0,0,0,114,74,0, + 0,0,114,33,0,0,0,114,169,0,0,0,114,170,0,0, + 0,114,171,0,0,0,114,176,0,0,0,114,9,0,0,0, + 114,9,0,0,0,114,9,0,0,0,114,10,0,0,0,114, + 73,0,0,0,212,2,0,0,115,14,0,0,0,8,5,4, + 1,4,2,8,4,8,9,8,6,8,11,114,73,0,0,0, + 41,45,114,77,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,20,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,69,0,0,0,114,137,0,0,0,114, + 101,0,0,0,114,141,0,0,0,114,60,0,0,0,114,122, + 0,0,0,90,7,95,95,97,108,108,95,95,114,19,0,0, + 0,90,15,112,97,116,104,95,115,101,112,97,114,97,116,111, + 114,115,114,17,0,0,0,114,68,0,0,0,114,3,0,0, + 0,114,24,0,0,0,218,4,116,121,112,101,114,63,0,0, + 0,114,104,0,0,0,114,106,0,0,0,114,108,0,0,0, + 114,4,0,0,0,114,81,0,0,0,114,35,0,0,0,114, + 36,0,0,0,114,34,0,0,0,114,26,0,0,0,114,113, + 0,0,0,114,131,0,0,0,114,133,0,0,0,114,49,0, + 0,0,114,136,0,0,0,114,144,0,0,0,218,8,95,95, + 99,111,100,101,95,95,114,142,0,0,0,114,148,0,0,0, + 114,150,0,0,0,114,158,0,0,0,114,140,0,0,0,114, + 138,0,0,0,114,42,0,0,0,114,73,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,13,0,0,0, + 115,90,0,0,0,4,4,8,1,16,1,8,1,8,1,8, + 1,8,1,8,1,8,2,8,3,6,1,14,3,16,4,4, + 2,8,2,4,1,4,1,4,2,14,127,0,127,0,1,12, + 1,12,1,2,1,2,253,2,255,2,9,8,4,8,9,8, + 31,8,126,2,254,2,29,4,5,8,21,8,46,8,10,8, + 46,10,5,8,7,8,6,8,13,8,19,8,15,8,26, }; From webhook-mailer at python.org Wed Nov 7 13:35:43 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 07 Nov 2018 18:35:43 -0000 Subject: [Python-checkins] Add link to PEP 525 in Expressions. (GH-10333) Message-ID: https://github.com/python/cpython/commit/774d46f86cb3addfec7a5c48077bd554c0c02104 commit: 774d46f86cb3addfec7a5c48077bd554c0c02104 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-07T10:35:39-08:00 summary: Add link to PEP 525 in Expressions. (GH-10333) (cherry picked from commit bfe1839aa994f0d84471254418a4ecfa7c7c9b9c) Co-authored-by: Andr?s Delfino files: M Doc/reference/expressions.rst diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst index 879eba8f586c..05f62cd38ba9 100644 --- a/Doc/reference/expressions.rst +++ b/Doc/reference/expressions.rst @@ -384,7 +384,7 @@ coroutine function to be an asynchronous generator. For example:: def gen(): # defines a generator function yield 123 - async def agen(): # defines an asynchronous generator function (PEP 525) + async def agen(): # defines an asynchronous generator function yield 123 Generator functions are described below, while asynchronous generator @@ -459,6 +459,10 @@ on the right hand side of an assignment statement. The proposal to introduce the :token:`yield_from` syntax, making delegation to sub-generators easy. + :pep:`525` - Asynchronous Generators + The proposal that expanded on :pep:`492` by adding generator capabilities to + coroutine functions. + .. index:: object: generator .. _generator-methods: From webhook-mailer at python.org Wed Nov 7 14:26:18 2018 From: webhook-mailer at python.org (Vinay Sajip) Date: Wed, 07 Nov 2018 19:26:18 -0000 Subject: [Python-checkins] bpo-32409: Fix regression in activate.bat on international Windows (GH-10295) (GH-10377) Message-ID: https://github.com/python/cpython/commit/881e273c795f2f5154b8afebfa299f0e830f3712 commit: 881e273c795f2f5154b8afebfa299f0e830f3712 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Vinay Sajip date: 2018-11-07T19:26:15Z summary: bpo-32409: Fix regression in activate.bat on international Windows (GH-10295) (GH-10377) Handle Unicode contents on localised Windows systems when activating a venv. activate.bat currently breaks on German Windows systems, as chcp.com does not return a plain number as on English systems, but (arbitrarily) appends a dot at the end (for example "Aktive Codepage: 850." instead of "Active Codepage: 850"). The dependency to chcp.com is removed and ctypes is used to get, set and restore the console output code page. The code page for console input is not changed. We can't use __VENV_PYTHON__ to find python.exe, since it's UTF-8. cmd.exe decodes the script using the console output code page. (cherry picked from commit c64583b6d3e8516a8cd2b5f84fc1e300bfac2206) Co-authored-by: samstagern <30337691+samstagern at users.noreply.github.com> files: A Misc/NEWS.d/next/Library/2018-11-02-12-01-00.bpo-32409.MFRX2Q.rst M Lib/venv/scripts/nt/activate.bat diff --git a/Lib/venv/scripts/nt/activate.bat b/Lib/venv/scripts/nt/activate.bat index 126049f495fe..2c81a28ce938 100644 --- a/Lib/venv/scripts/nt/activate.bat +++ b/Lib/venv/scripts/nt/activate.bat @@ -1,11 +1,10 @@ @echo off -rem This file is UTF-8 encoded, so we need to update the current code page while executing it -for /f "tokens=2 delims=:" %%a in ('"%SystemRoot%\System32\chcp.com"') do ( - set "_OLD_CODEPAGE=%%a" -) +rem This file is UTF-8 encoded, so we need to update the current code page while executing it. +for /f %%a in ('%~dp0python.exe -Ic "import ctypes; print(ctypes.windll.kernel32.GetConsoleOutputCP())"') do (set "_OLD_CODEPAGE=%%a") + if defined _OLD_CODEPAGE ( - "%SystemRoot%\System32\chcp.com" 65001 > nul + %~dp0python.exe -Ic "import ctypes; ctypes.windll.kernel32.SetConsoleOutputCP(65001)" ) set "VIRTUAL_ENV=__VENV_DIR__" @@ -40,6 +39,6 @@ set "PATH=%VIRTUAL_ENV%\__VENV_BIN_NAME__;%PATH%" :END if defined _OLD_CODEPAGE ( - "%SystemRoot%\System32\chcp.com" %_OLD_CODEPAGE% > nul + %~dp0python.exe -Ic "import ctypes; ctypes.windll.kernel32.SetConsoleOutputCP(%_OLD_CODEPAGE%)" set "_OLD_CODEPAGE=" ) diff --git a/Misc/NEWS.d/next/Library/2018-11-02-12-01-00.bpo-32409.MFRX2Q.rst b/Misc/NEWS.d/next/Library/2018-11-02-12-01-00.bpo-32409.MFRX2Q.rst new file mode 100644 index 000000000000..9b57c5b89ae5 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-11-02-12-01-00.bpo-32409.MFRX2Q.rst @@ -0,0 +1,2 @@ +Fixed implementation of :file:`activate.bat` to handle Unicode contents on +localized Windows systems (eg. German). Patch by Martin Bijl. \ No newline at end of file From webhook-mailer at python.org Wed Nov 7 16:42:47 2018 From: webhook-mailer at python.org (Julien Palard) Date: Wed, 07 Nov 2018 21:42:47 -0000 Subject: [Python-checkins] bpo-35015: Doc: Fix internationalisation of the availability directive. (GH-10360) Message-ID: https://github.com/python/cpython/commit/beed84ca5e0f2784d758478d4e7c81c9c1088c4e commit: beed84ca5e0f2784d758478d4e7c81c9c1088c4e branch: master author: Julien Palard committer: GitHub date: 2018-11-07T22:42:40+01:00 summary: bpo-35015: Doc: Fix internationalisation of the availability directive. (GH-10360) files: M Doc/tools/extensions/pyspecific.py diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py index 08fa9df44183..10e4a4d11671 100644 --- a/Doc/tools/extensions/pyspecific.py +++ b/Doc/tools/extensions/pyspecific.py @@ -141,9 +141,10 @@ class Availability(Directive): final_argument_whitespace = True def run(self): - pnode = nodes.paragraph(classes=['availability']) - n, m = self.state.inline_text(':ref:`Availability `: ', - self.lineno) + availability_ref = ':ref:`Availability `: ' + pnode = nodes.paragraph(availability_ref + self.arguments[0], + classes=["availability"],) + n, m = self.state.inline_text(availability_ref, self.lineno) pnode.extend(n + m) n, m = self.state.inline_text(self.arguments[0], self.lineno) pnode.extend(n + m) From webhook-mailer at python.org Wed Nov 7 16:48:51 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 07 Nov 2018 21:48:51 -0000 Subject: [Python-checkins] bpo-35015: Doc: Fix internationalisation of the availability directive. (GH-10360) Message-ID: https://github.com/python/cpython/commit/363839caf9dac796783c74b682a70680a15fa8a7 commit: 363839caf9dac796783c74b682a70680a15fa8a7 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-07T13:48:47-08:00 summary: bpo-35015: Doc: Fix internationalisation of the availability directive. (GH-10360) (cherry picked from commit beed84ca5e0f2784d758478d4e7c81c9c1088c4e) Co-authored-by: Julien Palard files: M Doc/tools/extensions/pyspecific.py diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py index a7f7797861bf..3070c6ed461e 100644 --- a/Doc/tools/extensions/pyspecific.py +++ b/Doc/tools/extensions/pyspecific.py @@ -141,9 +141,10 @@ class Availability(Directive): final_argument_whitespace = True def run(self): - pnode = nodes.paragraph(classes=['availability']) - n, m = self.state.inline_text(':ref:`Availability `: ', - self.lineno) + availability_ref = ':ref:`Availability `: ' + pnode = nodes.paragraph(availability_ref + self.arguments[0], + classes=["availability"],) + n, m = self.state.inline_text(availability_ref, self.lineno) pnode.extend(n + m) n, m = self.state.inline_text(self.arguments[0], self.lineno) pnode.extend(n + m) From webhook-mailer at python.org Wed Nov 7 17:05:17 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 07 Nov 2018 22:05:17 -0000 Subject: [Python-checkins] [3.6] bpo-31354: Let configure --with-lto work on all builds (GH-10261) Message-ID: https://github.com/python/cpython/commit/f6b9459996f5166300982d0427119eb326e74dac commit: f6b9459996f5166300982d0427119eb326e74dac branch: 3.6 author: stratakis committer: Victor Stinner date: 2018-11-07T23:05:13+01:00 summary: [3.6] bpo-31354: Let configure --with-lto work on all builds (GH-10261) Allow configure --with-lto to apply to all builds, not just profile-opt builds. Whether this is actually useful or not must be determined by the person building CPython using their own toolchain. My own quick test on x86_64 Debian 9 (gcc 6.3, binutils 2.28) seemed to suggest that it wasn't, but I expect better toolchains can or will exist at some point. The point is to allow it at all. files: A Misc/NEWS.d/next/Build/2017-09-08-11-48-11.bpo-31354.4f-VJK.rst M Makefile.pre.in M configure M configure.ac diff --git a/Makefile.pre.in b/Makefile.pre.in index d912a19e79f5..82f7edd1014c 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -473,7 +473,7 @@ profile-opt: $(MAKE) profile-removal build_all_generate_profile: - $(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS) $(PGO_PROF_GEN_FLAG) @LTOFLAGS@" LDFLAGS="$(LDFLAGS) $(PGO_PROF_GEN_FLAG) @LTOFLAGS@" LIBS="$(LIBS)" + $(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS) $(PGO_PROF_GEN_FLAG)" LDFLAGS="$(LDFLAGS) $(PGO_PROF_GEN_FLAG)" LIBS="$(LIBS)" run_profile_task: : # FIXME: can't run for a cross build @@ -483,7 +483,7 @@ build_all_merge_profile: $(LLVM_PROF_MERGER) build_all_use_profile: - $(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS) $(PGO_PROF_USE_FLAG) @LTOFLAGS@" LDFLAGS="$(LDFLAGS) @LTOFLAGS@" + $(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS) $(PGO_PROF_USE_FLAG)" LDFLAGS="$(LDFLAGS)" # Compile and run with gcov .PHONY=coverage coverage-lcov coverage-report diff --git a/Misc/NEWS.d/next/Build/2017-09-08-11-48-11.bpo-31354.4f-VJK.rst b/Misc/NEWS.d/next/Build/2017-09-08-11-48-11.bpo-31354.4f-VJK.rst new file mode 100644 index 000000000000..b63c9ea6e01f --- /dev/null +++ b/Misc/NEWS.d/next/Build/2017-09-08-11-48-11.bpo-31354.4f-VJK.rst @@ -0,0 +1 @@ +Allow --with-lto to be used on all builds, not just `make profile-opt`. diff --git a/configure b/configure index bfa4b83cd6c0..75a80a797d34 100755 --- a/configure +++ b/configure @@ -681,7 +681,6 @@ LLVM_PROF_FILE LLVM_PROF_MERGER PGO_PROF_USE_FLAG PGO_PROF_GEN_FLAG -LTOFLAGS DEF_MAKE_RULE DEF_MAKE_ALL_RULE ABIFLAGS @@ -1516,8 +1515,8 @@ Optional Packages: --with-suffix=.exe set executable suffix --with-pydebug build with Py_DEBUG defined --with-assertions build with C assertions enabled - --with-lto Enable Link Time Optimization in PGO builds. - Disabled by default. + --with-lto Enable Link Time Optimization in any build. Disabled + by default. --with-hash-algorithm=[fnv|siphash24] select hash algorithm --with-address-sanitizer @@ -6584,7 +6583,6 @@ else fi # Enable LTO flags - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-lto" >&5 $as_echo_n "checking for --with-lto... " >&6; } @@ -6637,6 +6635,9 @@ if test "$Py_LTO" = 'true' ; then # to get debug symbols. LTOFLAGS="$LTOFLAGS -g" fi + + CFLAGS="$CFLAGS $LTOFLAGS" + LDFLAGS="$LDFLAGS $LTOFLAGS" fi # Enable PGO flags. diff --git a/configure.ac b/configure.ac index 3f2459ab7100..b411c3e8f6f1 100644 --- a/configure.ac +++ b/configure.ac @@ -1310,9 +1310,8 @@ else fi # Enable LTO flags -AC_SUBST(LTOFLAGS) AC_MSG_CHECKING(for --with-lto) -AC_ARG_WITH(lto, AS_HELP_STRING([--with-lto], [Enable Link Time Optimization in PGO builds. Disabled by default.]), +AC_ARG_WITH(lto, AS_HELP_STRING([--with-lto], [Enable Link Time Optimization in any build. Disabled by default.]), [ if test "$withval" != no then @@ -1354,6 +1353,9 @@ if test "$Py_LTO" = 'true' ; then # to get debug symbols. LTOFLAGS="$LTOFLAGS -g" fi + + CFLAGS="$CFLAGS $LTOFLAGS" + LDFLAGS="$LDFLAGS $LTOFLAGS" fi # Enable PGO flags. From webhook-mailer at python.org Wed Nov 7 17:21:22 2018 From: webhook-mailer at python.org (Pablo Galindo) Date: Wed, 07 Nov 2018 22:21:22 -0000 Subject: [Python-checkins] Fix the construction of subprocess.CalledProcessError in test_venv (GH-10400) Message-ID: https://github.com/python/cpython/commit/b93925047a025511c48a7bf3e6e6f0cfec79b8ed commit: b93925047a025511c48a7bf3e6e6f0cfec79b8ed branch: master author: Pablo Galindo committer: GitHub date: 2018-11-07T22:21:17Z summary: Fix the construction of subprocess.CalledProcessError in test_venv (GH-10400) The constructor of subprocess.CalledProcessError in the check_output function had an extra None in it. files: M Lib/test/test_venv.py diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py index c86f7a1a07ae..461fe7afd213 100644 --- a/Lib/test/test_venv.py +++ b/Lib/test/test_venv.py @@ -35,7 +35,7 @@ def check_output(cmd, encoding=None): out, err = p.communicate() if p.returncode: raise subprocess.CalledProcessError( - p.returncode, cmd, None, out, err) + p.returncode, cmd, out, err) return out, err class BaseTest(unittest.TestCase): From webhook-mailer at python.org Wed Nov 7 17:39:26 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 07 Nov 2018 22:39:26 -0000 Subject: [Python-checkins] Fix the construction of subprocess.CalledProcessError in test_venv (GH-10400) Message-ID: https://github.com/python/cpython/commit/b097f9fe2b359f8b64c030db51cfa2930c26971b commit: b097f9fe2b359f8b64c030db51cfa2930c26971b branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-07T14:39:21-08:00 summary: Fix the construction of subprocess.CalledProcessError in test_venv (GH-10400) The constructor of subprocess.CalledProcessError in the check_output function had an extra None in it. (cherry picked from commit b93925047a025511c48a7bf3e6e6f0cfec79b8ed) Co-authored-by: Pablo Galindo files: M Lib/test/test_venv.py diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py index c86f7a1a07ae..461fe7afd213 100644 --- a/Lib/test/test_venv.py +++ b/Lib/test/test_venv.py @@ -35,7 +35,7 @@ def check_output(cmd, encoding=None): out, err = p.communicate() if p.returncode: raise subprocess.CalledProcessError( - p.returncode, cmd, None, out, err) + p.returncode, cmd, out, err) return out, err class BaseTest(unittest.TestCase): From webhook-mailer at python.org Wed Nov 7 17:46:14 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 07 Nov 2018 22:46:14 -0000 Subject: [Python-checkins] Fix the construction of subprocess.CalledProcessError in test_venv (GH-10400) Message-ID: https://github.com/python/cpython/commit/0e3983689bc5c09ce9220c7976d94adf68ef118c commit: 0e3983689bc5c09ce9220c7976d94adf68ef118c branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-07T14:46:10-08:00 summary: Fix the construction of subprocess.CalledProcessError in test_venv (GH-10400) The constructor of subprocess.CalledProcessError in the check_output function had an extra None in it. (cherry picked from commit b93925047a025511c48a7bf3e6e6f0cfec79b8ed) Co-authored-by: Pablo Galindo files: M Lib/test/test_venv.py diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py index d1ffb8132d81..842470fef08a 100644 --- a/Lib/test/test_venv.py +++ b/Lib/test/test_venv.py @@ -40,7 +40,7 @@ def check_output(cmd, encoding=None): out, err = p.communicate() if p.returncode: raise subprocess.CalledProcessError( - p.returncode, cmd, None, out, err) + p.returncode, cmd, out, err) return out, err class BaseTest(unittest.TestCase): From webhook-mailer at python.org Wed Nov 7 18:11:52 2018 From: webhook-mailer at python.org (Julien Palard) Date: Wed, 07 Nov 2018 23:11:52 -0000 Subject: [Python-checkins] Doc: Make all versions sidebars the same for consistency. (GH-10288) Message-ID: https://github.com/python/cpython/commit/556d50d03dd1d457c01ab552c8bc81f3431a0746 commit: 556d50d03dd1d457c01ab552c8bc81f3431a0746 branch: master author: Julien Palard committer: GitHub date: 2018-11-08T00:11:49+01:00 summary: Doc: Make all versions sidebars the same for consistency. (GH-10288) files: M Doc/tools/templates/indexsidebar.html diff --git a/Doc/tools/templates/indexsidebar.html b/Doc/tools/templates/indexsidebar.html index 8abce8ed6a87..5bb26a998fb2 100644 --- a/Doc/tools/templates/indexsidebar.html +++ b/Doc/tools/templates/indexsidebar.html @@ -1,12 +1,13 @@

    {% trans %}Download{% endtrans %}

    {% trans %}Download these documents{% endtrans %}

    -

    {% trans %}Docs for other versions{% endtrans %}

    +

    {% trans %}Docs by version{% endtrans %}

    {% trans %}Other resources{% endtrans %}

    From webhook-mailer at python.org Wed Nov 7 18:55:44 2018 From: webhook-mailer at python.org (Pablo Galindo) Date: Wed, 07 Nov 2018 23:55:44 -0000 Subject: [Python-checkins] Revert "bpo-32409: Fix regression in activate.bat on international Windows (GH-10295)" (GH-10403) Message-ID: https://github.com/python/cpython/commit/6843ffe4533e9f2cde036296fd932fef6f059687 commit: 6843ffe4533e9f2cde036296fd932fef6f059687 branch: master author: Pablo Galindo committer: GitHub date: 2018-11-07T23:55:40Z summary: Revert "bpo-32409: Fix regression in activate.bat on international Windows (GH-10295)" (GH-10403) This reverts commit c64583b6d3e8516a8cd2b5f84fc1e300bfac2206 due to multiple buildbot failures when building it. files: D Misc/NEWS.d/next/Library/2018-11-02-12-01-00.bpo-32409.MFRX2Q.rst M Lib/venv/scripts/nt/activate.bat diff --git a/Lib/venv/scripts/nt/activate.bat b/Lib/venv/scripts/nt/activate.bat index 2c81a28ce938..126049f495fe 100644 --- a/Lib/venv/scripts/nt/activate.bat +++ b/Lib/venv/scripts/nt/activate.bat @@ -1,10 +1,11 @@ @echo off -rem This file is UTF-8 encoded, so we need to update the current code page while executing it. -for /f %%a in ('%~dp0python.exe -Ic "import ctypes; print(ctypes.windll.kernel32.GetConsoleOutputCP())"') do (set "_OLD_CODEPAGE=%%a") - +rem This file is UTF-8 encoded, so we need to update the current code page while executing it +for /f "tokens=2 delims=:" %%a in ('"%SystemRoot%\System32\chcp.com"') do ( + set "_OLD_CODEPAGE=%%a" +) if defined _OLD_CODEPAGE ( - %~dp0python.exe -Ic "import ctypes; ctypes.windll.kernel32.SetConsoleOutputCP(65001)" + "%SystemRoot%\System32\chcp.com" 65001 > nul ) set "VIRTUAL_ENV=__VENV_DIR__" @@ -39,6 +40,6 @@ set "PATH=%VIRTUAL_ENV%\__VENV_BIN_NAME__;%PATH%" :END if defined _OLD_CODEPAGE ( - %~dp0python.exe -Ic "import ctypes; ctypes.windll.kernel32.SetConsoleOutputCP(%_OLD_CODEPAGE%)" + "%SystemRoot%\System32\chcp.com" %_OLD_CODEPAGE% > nul set "_OLD_CODEPAGE=" ) diff --git a/Misc/NEWS.d/next/Library/2018-11-02-12-01-00.bpo-32409.MFRX2Q.rst b/Misc/NEWS.d/next/Library/2018-11-02-12-01-00.bpo-32409.MFRX2Q.rst deleted file mode 100644 index 9b57c5b89ae5..000000000000 --- a/Misc/NEWS.d/next/Library/2018-11-02-12-01-00.bpo-32409.MFRX2Q.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fixed implementation of :file:`activate.bat` to handle Unicode contents on -localized Windows systems (eg. German). Patch by Martin Bijl. \ No newline at end of file From webhook-mailer at python.org Wed Nov 7 19:14:06 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 08 Nov 2018 00:14:06 -0000 Subject: [Python-checkins] Revert "bpo-32409: Fix regression in activate.bat on international Windows (GH-10295)" (GH-10403) Message-ID: https://github.com/python/cpython/commit/3ba5e253de1a52e9692aa645c95072705f08b7bb commit: 3ba5e253de1a52e9692aa645c95072705f08b7bb branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-07T16:13:58-08:00 summary: Revert "bpo-32409: Fix regression in activate.bat on international Windows (GH-10295)" (GH-10403) This reverts commit c64583b6d3e8516a8cd2b5f84fc1e300bfac2206 due to multiple buildbot failures when building it. (cherry picked from commit 6843ffe4533e9f2cde036296fd932fef6f059687) Co-authored-by: Pablo Galindo files: D Misc/NEWS.d/next/Library/2018-11-02-12-01-00.bpo-32409.MFRX2Q.rst M Lib/venv/scripts/nt/activate.bat diff --git a/Lib/venv/scripts/nt/activate.bat b/Lib/venv/scripts/nt/activate.bat index 2c81a28ce938..126049f495fe 100644 --- a/Lib/venv/scripts/nt/activate.bat +++ b/Lib/venv/scripts/nt/activate.bat @@ -1,10 +1,11 @@ @echo off -rem This file is UTF-8 encoded, so we need to update the current code page while executing it. -for /f %%a in ('%~dp0python.exe -Ic "import ctypes; print(ctypes.windll.kernel32.GetConsoleOutputCP())"') do (set "_OLD_CODEPAGE=%%a") - +rem This file is UTF-8 encoded, so we need to update the current code page while executing it +for /f "tokens=2 delims=:" %%a in ('"%SystemRoot%\System32\chcp.com"') do ( + set "_OLD_CODEPAGE=%%a" +) if defined _OLD_CODEPAGE ( - %~dp0python.exe -Ic "import ctypes; ctypes.windll.kernel32.SetConsoleOutputCP(65001)" + "%SystemRoot%\System32\chcp.com" 65001 > nul ) set "VIRTUAL_ENV=__VENV_DIR__" @@ -39,6 +40,6 @@ set "PATH=%VIRTUAL_ENV%\__VENV_BIN_NAME__;%PATH%" :END if defined _OLD_CODEPAGE ( - %~dp0python.exe -Ic "import ctypes; ctypes.windll.kernel32.SetConsoleOutputCP(%_OLD_CODEPAGE%)" + "%SystemRoot%\System32\chcp.com" %_OLD_CODEPAGE% > nul set "_OLD_CODEPAGE=" ) diff --git a/Misc/NEWS.d/next/Library/2018-11-02-12-01-00.bpo-32409.MFRX2Q.rst b/Misc/NEWS.d/next/Library/2018-11-02-12-01-00.bpo-32409.MFRX2Q.rst deleted file mode 100644 index 9b57c5b89ae5..000000000000 --- a/Misc/NEWS.d/next/Library/2018-11-02-12-01-00.bpo-32409.MFRX2Q.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fixed implementation of :file:`activate.bat` to handle Unicode contents on -localized Windows systems (eg. German). Patch by Martin Bijl. \ No newline at end of file From webhook-mailer at python.org Thu Nov 8 00:16:19 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 08 Nov 2018 05:16:19 -0000 Subject: [Python-checkins] Add future_stmt to simple_stmt production list. (GH-8239) Message-ID: https://github.com/python/cpython/commit/842efd008761e678aebe44d45000c6832725235d commit: 842efd008761e678aebe44d45000c6832725235d branch: 2.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-07T21:16:15-08:00 summary: Add future_stmt to simple_stmt production list. (GH-8239) (cherry picked from commit cdb96f45b61a40a7e7c4c83b4b1f14ef6f5cf4fa) Co-authored-by: Andr?s Delfino files: M Doc/reference/simple_stmts.rst diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst index 43935da4406e..e2d643f7e47b 100644 --- a/Doc/reference/simple_stmts.rst +++ b/Doc/reference/simple_stmts.rst @@ -25,6 +25,7 @@ simple statements is: : | `break_stmt` : | `continue_stmt` : | `import_stmt` + : | `future_stmt` : | `global_stmt` : | `exec_stmt` From webhook-mailer at python.org Thu Nov 8 00:16:19 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 08 Nov 2018 05:16:19 -0000 Subject: [Python-checkins] Add future_stmt to simple_stmt production list. (GH-8239) Message-ID: https://github.com/python/cpython/commit/de25071f49b3f9bf9cdef32204a4516bbb259626 commit: de25071f49b3f9bf9cdef32204a4516bbb259626 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-07T21:16:16-08:00 summary: Add future_stmt to simple_stmt production list. (GH-8239) (cherry picked from commit cdb96f45b61a40a7e7c4c83b4b1f14ef6f5cf4fa) Co-authored-by: Andr?s Delfino files: M Doc/reference/simple_stmts.rst diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst index 3ab0029698c7..3fea709d3857 100644 --- a/Doc/reference/simple_stmts.rst +++ b/Doc/reference/simple_stmts.rst @@ -25,6 +25,7 @@ simple statements is: : | `break_stmt` : | `continue_stmt` : | `import_stmt` + : | `future_stmt` : | `global_stmt` : | `nonlocal_stmt` From webhook-mailer at python.org Thu Nov 8 01:48:15 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Thu, 08 Nov 2018 06:48:15 -0000 Subject: [Python-checkins] bpo-34966: Improve support of method aliases in pydoc. (GH-9823) Message-ID: https://github.com/python/cpython/commit/a44d34e17908a49d584f86c4f8642a50707b7150 commit: a44d34e17908a49d584f86c4f8642a50707b7150 branch: master author: Serhiy Storchaka committer: GitHub date: 2018-11-08T08:48:11+02:00 summary: bpo-34966: Improve support of method aliases in pydoc. (GH-9823) Pydoc now does not duplicate docstrings for aliases of inherited methods. files: A Misc/NEWS.d/next/Library/2018-10-12-18-57-52.bpo-34966.WZeBHO.rst M Lib/pydoc.py M Lib/test/test_pydoc.py diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 3a461714821d..54e6ce8b25bc 100644 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -958,8 +958,7 @@ def docroutine(self, object, name=None, mod=None, if name == realname: title = '%s' % (anchor, realname) else: - if (cl and realname in cl.__dict__ and - cl.__dict__[realname] is object): + if cl and inspect.getattr_static(cl, realname, []) is object: reallink = '%s' % ( cl.__name__ + '-' + realname, realname) skipdocs = 1 @@ -1393,8 +1392,7 @@ def docroutine(self, object, name=None, mod=None, cl=None): if name == realname: title = self.bold(realname) else: - if (cl and realname in cl.__dict__ and - cl.__dict__[realname] is object): + if cl and inspect.getattr_static(cl, realname, []) is object: skipdocs = 1 title = self.bold(name) + ' = ' + realname argspec = None diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index 6cd81ec5c334..d521deda1760 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -417,6 +417,7 @@ def call_url_handler(self, url, expected_title): class PydocDocTest(unittest.TestCase): + maxDiff = None @unittest.skipIf(sys.flags.optimize >= 2, "Docstrings are omitted with -O2 and above") @@ -766,6 +767,104 @@ def method_returning_true(self): methods = pydoc.allmethods(TestClass) self.assertDictEqual(methods, expected) + def test_method_aliases(self): + class A: + def tkraise(self, aboveThis=None): + """Raise this widget in the stacking order.""" + lift = tkraise + def a_size(self): + """Return size""" + class B(A): + def itemconfigure(self, tagOrId, cnf=None, **kw): + """Configure resources of an item TAGORID.""" + itemconfig = itemconfigure + b_size = A.a_size + + doc = pydoc.render_doc(B) + # clean up the extra text formatting that pydoc performs + doc = re.sub('\b.', '', doc) + self.assertEqual(doc, '''\ +Python Library Documentation: class B in module %s + +class B(A) + | Method resolution order: + | B + | A + | builtins.object + |\x20\x20 + | Methods defined here: + |\x20\x20 + | b_size = a_size(self) + |\x20\x20 + | itemconfig = itemconfigure(self, tagOrId, cnf=None, **kw) + |\x20\x20 + | itemconfigure(self, tagOrId, cnf=None, **kw) + | Configure resources of an item TAGORID. + |\x20\x20 + | ---------------------------------------------------------------------- + | Methods inherited from A: + |\x20\x20 + | a_size(self) + | Return size + |\x20\x20 + | lift = tkraise(self, aboveThis=None) + |\x20\x20 + | tkraise(self, aboveThis=None) + | Raise this widget in the stacking order. + |\x20\x20 + | ---------------------------------------------------------------------- + | Data descriptors inherited from A: + |\x20\x20 + | __dict__ + | dictionary for instance variables (if defined) + |\x20\x20 + | __weakref__ + | list of weak references to the object (if defined) +''' % __name__) + + doc = pydoc.render_doc(B, renderer=pydoc.HTMLDoc()) + self.assertEqual(doc, '''\ +Python Library Documentation: class B in module %s + +

    + + + +\x20\x20\x20\x20 + +
     
    +class B(A)
        
    Method resolution order:
    +
    B
    +
    A
    +
    builtins.object
    +
    +
    +Methods defined here:
    +
    b_size = a_size(self)
    + +
    itemconfig = itemconfigure(self, tagOrId, cnf=None, **kw)
    + +
    itemconfigure(self, tagOrId, cnf=None, **kw)
    Configure resources of an item TAGORID.
    + +
    +Methods inherited from A:
    +
    a_size(self)
    Return size
    + +
    lift = tkraise(self, aboveThis=None)
    + +
    tkraise(self, aboveThis=None)
    Raise this widget in the stacking order.
    + +
    +Data descriptors inherited from A:
    +
    __dict__
    +
    dictionary for instance variables (if defined)
    +
    +
    __weakref__
    +
    list of weak references to the object (if defined)
    +
    +
    \ +''' % __name__) + class PydocImportTest(PydocBaseTest): diff --git a/Misc/NEWS.d/next/Library/2018-10-12-18-57-52.bpo-34966.WZeBHO.rst b/Misc/NEWS.d/next/Library/2018-10-12-18-57-52.bpo-34966.WZeBHO.rst new file mode 100644 index 000000000000..b861405297f4 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-12-18-57-52.bpo-34966.WZeBHO.rst @@ -0,0 +1,3 @@ +:mod:`pydoc` now supports aliases not only to methods defined in +the end class, but also to inherited methods. The docstring is not +duplicated for aliases. From webhook-mailer at python.org Thu Nov 8 02:08:10 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 08 Nov 2018 07:08:10 -0000 Subject: [Python-checkins] bpo-34966: Improve support of method aliases in pydoc. (GH-9823) Message-ID: https://github.com/python/cpython/commit/9d3658147b56e24e96e174510b6ee91c8141e530 commit: 9d3658147b56e24e96e174510b6ee91c8141e530 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-07T23:08:05-08:00 summary: bpo-34966: Improve support of method aliases in pydoc. (GH-9823) Pydoc now does not duplicate docstrings for aliases of inherited methods. (cherry picked from commit a44d34e17908a49d584f86c4f8642a50707b7150) Co-authored-by: Serhiy Storchaka files: A Misc/NEWS.d/next/Library/2018-10-12-18-57-52.bpo-34966.WZeBHO.rst M Lib/pydoc.py M Lib/test/test_pydoc.py diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 8a6b27b16e52..09992cd08245 100644 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -958,8 +958,7 @@ def docroutine(self, object, name=None, mod=None, if name == realname: title = '%s' % (anchor, realname) else: - if (cl and realname in cl.__dict__ and - cl.__dict__[realname] is object): + if cl and inspect.getattr_static(cl, realname, []) is object: reallink = '%s' % ( cl.__name__ + '-' + realname, realname) skipdocs = 1 @@ -1375,8 +1374,7 @@ def docroutine(self, object, name=None, mod=None, cl=None): if name == realname: title = self.bold(realname) else: - if (cl and realname in cl.__dict__ and - cl.__dict__[realname] is object): + if cl and inspect.getattr_static(cl, realname, []) is object: skipdocs = 1 title = self.bold(name) + ' = ' + realname argspec = None diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index 06f872999515..9bf365ed4b95 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -417,6 +417,7 @@ def call_url_handler(self, url, expected_title): class PydocDocTest(unittest.TestCase): + maxDiff = None @unittest.skipIf(sys.flags.optimize >= 2, "Docstrings are omitted with -O2 and above") @@ -648,6 +649,104 @@ def method_returning_true(self): methods = pydoc.allmethods(TestClass) self.assertDictEqual(methods, expected) + def test_method_aliases(self): + class A: + def tkraise(self, aboveThis=None): + """Raise this widget in the stacking order.""" + lift = tkraise + def a_size(self): + """Return size""" + class B(A): + def itemconfigure(self, tagOrId, cnf=None, **kw): + """Configure resources of an item TAGORID.""" + itemconfig = itemconfigure + b_size = A.a_size + + doc = pydoc.render_doc(B) + # clean up the extra text formatting that pydoc performs + doc = re.sub('\b.', '', doc) + self.assertEqual(doc, '''\ +Python Library Documentation: class B in module %s + +class B(A) + | Method resolution order: + | B + | A + | builtins.object + |\x20\x20 + | Methods defined here: + |\x20\x20 + | b_size = a_size(self) + |\x20\x20 + | itemconfig = itemconfigure(self, tagOrId, cnf=None, **kw) + |\x20\x20 + | itemconfigure(self, tagOrId, cnf=None, **kw) + | Configure resources of an item TAGORID. + |\x20\x20 + | ---------------------------------------------------------------------- + | Methods inherited from A: + |\x20\x20 + | a_size(self) + | Return size + |\x20\x20 + | lift = tkraise(self, aboveThis=None) + |\x20\x20 + | tkraise(self, aboveThis=None) + | Raise this widget in the stacking order. + |\x20\x20 + | ---------------------------------------------------------------------- + | Data descriptors inherited from A: + |\x20\x20 + | __dict__ + | dictionary for instance variables (if defined) + |\x20\x20 + | __weakref__ + | list of weak references to the object (if defined) +''' % __name__) + + doc = pydoc.render_doc(B, renderer=pydoc.HTMLDoc()) + self.assertEqual(doc, '''\ +Python Library Documentation: class B in module %s + +

    + + + +\x20\x20\x20\x20 + +
     
    +class B(A)
        
    Method resolution order:
    +
    B
    +
    A
    +
    builtins.object
    +
    +
    +Methods defined here:
    +
    b_size = a_size(self)
    + +
    itemconfig = itemconfigure(self, tagOrId, cnf=None, **kw)
    + +
    itemconfigure(self, tagOrId, cnf=None, **kw)
    Configure resources of an item TAGORID.
    + +
    +Methods inherited from A:
    +
    a_size(self)
    Return size
    + +
    lift = tkraise(self, aboveThis=None)
    + +
    tkraise(self, aboveThis=None)
    Raise this widget in the stacking order.
    + +
    +Data descriptors inherited from A:
    +
    __dict__
    +
    dictionary for instance variables (if defined)
    +
    +
    __weakref__
    +
    list of weak references to the object (if defined)
    +
    +
    \ +''' % __name__) + class PydocImportTest(PydocBaseTest): diff --git a/Misc/NEWS.d/next/Library/2018-10-12-18-57-52.bpo-34966.WZeBHO.rst b/Misc/NEWS.d/next/Library/2018-10-12-18-57-52.bpo-34966.WZeBHO.rst new file mode 100644 index 000000000000..b861405297f4 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-12-18-57-52.bpo-34966.WZeBHO.rst @@ -0,0 +1,3 @@ +:mod:`pydoc` now supports aliases not only to methods defined in +the end class, but also to inherited methods. The docstring is not +duplicated for aliases. From webhook-mailer at python.org Thu Nov 8 02:20:32 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 08 Nov 2018 07:20:32 -0000 Subject: [Python-checkins] bpo-34966: Improve support of method aliases in pydoc. (GH-9823) Message-ID: https://github.com/python/cpython/commit/11a33e171b89ea9267672b0664d739ca06e459ca commit: 11a33e171b89ea9267672b0664d739ca06e459ca branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-07T23:20:27-08:00 summary: bpo-34966: Improve support of method aliases in pydoc. (GH-9823) Pydoc now does not duplicate docstrings for aliases of inherited methods. (cherry picked from commit a44d34e17908a49d584f86c4f8642a50707b7150) Co-authored-by: Serhiy Storchaka files: A Misc/NEWS.d/next/Library/2018-10-12-18-57-52.bpo-34966.WZeBHO.rst M Lib/pydoc.py M Lib/test/test_pydoc.py diff --git a/Lib/pydoc.py b/Lib/pydoc.py index fffa2d50a29c..b521a5504728 100644 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -941,8 +941,7 @@ def docroutine(self, object, name=None, mod=None, if name == realname: title = '%s' % (anchor, realname) else: - if (cl and realname in cl.__dict__ and - cl.__dict__[realname] is object): + if cl and inspect.getattr_static(cl, realname, []) is object: reallink = '%s' % ( cl.__name__ + '-' + realname, realname) skipdocs = 1 @@ -1346,8 +1345,7 @@ def docroutine(self, object, name=None, mod=None, cl=None): if name == realname: title = self.bold(realname) else: - if (cl and realname in cl.__dict__ and - cl.__dict__[realname] is object): + if cl and inspect.getattr_static(cl, realname, []) is object: skipdocs = 1 title = self.bold(name) + ' = ' + realname argspec = None diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index 0383a6732401..00803d3305cb 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -419,6 +419,7 @@ def call_url_handler(self, url, expected_title): class PydocDocTest(unittest.TestCase): + maxDiff = None @unittest.skipIf(sys.flags.optimize >= 2, "Docstrings are omitted with -O2 and above") @@ -650,6 +651,104 @@ def method_returning_true(self): methods = pydoc.allmethods(TestClass) self.assertDictEqual(methods, expected) + def test_method_aliases(self): + class A: + def tkraise(self, aboveThis=None): + """Raise this widget in the stacking order.""" + lift = tkraise + def a_size(self): + """Return size""" + class B(A): + def itemconfigure(self, tagOrId, cnf=None, **kw): + """Configure resources of an item TAGORID.""" + itemconfig = itemconfigure + b_size = A.a_size + + doc = pydoc.render_doc(B) + # clean up the extra text formatting that pydoc performs + doc = re.sub('\b.', '', doc) + self.assertEqual(doc, '''\ +Python Library Documentation: class B in module %s + +class B(A) + | Method resolution order: + | B + | A + | builtins.object + |\x20\x20 + | Methods defined here: + |\x20\x20 + | b_size = a_size(self) + |\x20\x20 + | itemconfig = itemconfigure(self, tagOrId, cnf=None, **kw) + |\x20\x20 + | itemconfigure(self, tagOrId, cnf=None, **kw) + | Configure resources of an item TAGORID. + |\x20\x20 + | ---------------------------------------------------------------------- + | Methods inherited from A: + |\x20\x20 + | a_size(self) + | Return size + |\x20\x20 + | lift = tkraise(self, aboveThis=None) + |\x20\x20 + | tkraise(self, aboveThis=None) + | Raise this widget in the stacking order. + |\x20\x20 + | ---------------------------------------------------------------------- + | Data descriptors inherited from A: + |\x20\x20 + | __dict__ + | dictionary for instance variables (if defined) + |\x20\x20 + | __weakref__ + | list of weak references to the object (if defined) +''' % __name__) + + doc = pydoc.render_doc(B, renderer=pydoc.HTMLDoc()) + self.assertEqual(doc, '''\ +Python Library Documentation: class B in module %s + +

    + + + +\x20\x20\x20\x20 + +
     
    +class B(A)
        
    Method resolution order:
    +
    B
    +
    A
    +
    builtins.object
    +
    +
    +Methods defined here:
    +
    b_size = a_size(self)
    + +
    itemconfig = itemconfigure(self, tagOrId, cnf=None, **kw)
    + +
    itemconfigure(self, tagOrId, cnf=None, **kw)
    Configure resources of an item TAGORID.
    + +
    +Methods inherited from A:
    +
    a_size(self)
    Return size
    + +
    lift = tkraise(self, aboveThis=None)
    + +
    tkraise(self, aboveThis=None)
    Raise this widget in the stacking order.
    + +
    +Data descriptors inherited from A:
    +
    __dict__
    +
    dictionary for instance variables (if defined)
    +
    +
    __weakref__
    +
    list of weak references to the object (if defined)
    +
    +
    \ +''' % __name__) + class PydocImportTest(PydocBaseTest): diff --git a/Misc/NEWS.d/next/Library/2018-10-12-18-57-52.bpo-34966.WZeBHO.rst b/Misc/NEWS.d/next/Library/2018-10-12-18-57-52.bpo-34966.WZeBHO.rst new file mode 100644 index 000000000000..b861405297f4 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-12-18-57-52.bpo-34966.WZeBHO.rst @@ -0,0 +1,3 @@ +:mod:`pydoc` now supports aliases not only to methods defined in +the end class, but also to inherited methods. The docstring is not +duplicated for aliases. From webhook-mailer at python.org Thu Nov 8 03:07:09 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 08 Nov 2018 08:07:09 -0000 Subject: [Python-checkins] [3.7] Doc: Make all versions sidebars the same for consistency. (GH-10288) (GH-10409) Message-ID: https://github.com/python/cpython/commit/732f745a4a2d99319a5297552cf4883d8d9c3656 commit: 732f745a4a2d99319a5297552cf4883d8d9c3656 branch: 3.7 author: Julien Palard committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-11-08T00:07:05-08:00 summary: [3.7] Doc: Make all versions sidebars the same for consistency. (GH-10288) (GH-10409) files: M Doc/tools/templates/indexsidebar.html diff --git a/Doc/tools/templates/indexsidebar.html b/Doc/tools/templates/indexsidebar.html index 9c58036d6592..e69e9a305425 100644 --- a/Doc/tools/templates/indexsidebar.html +++ b/Doc/tools/templates/indexsidebar.html @@ -1,12 +1,13 @@

    {% trans %}Download{% endtrans %}

    {% trans %}Download these documents{% endtrans %}

    -

    {% trans %}Docs for other versions{% endtrans %}

    +

    {% trans %}Docs by version{% endtrans %}

    {% trans %}Other resources{% endtrans %}

    From webhook-mailer at python.org Thu Nov 8 03:09:41 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 08 Nov 2018 08:09:41 -0000 Subject: [Python-checkins] [2.7] Doc: Make all versions sidebars the same for consistency. (GH-10288) (GH-10410) Message-ID: https://github.com/python/cpython/commit/18ba4851aeb5dc5d6b4d22adc8d0555d0c2fdfe5 commit: 18ba4851aeb5dc5d6b4d22adc8d0555d0c2fdfe5 branch: 2.7 author: Julien Palard committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-11-08T00:09:38-08:00 summary: [2.7] Doc: Make all versions sidebars the same for consistency. (GH-10288) (GH-10410) files: M Doc/tools/templates/indexsidebar.html diff --git a/Doc/tools/templates/indexsidebar.html b/Doc/tools/templates/indexsidebar.html index d6b054e8766b..e69e9a305425 100644 --- a/Doc/tools/templates/indexsidebar.html +++ b/Doc/tools/templates/indexsidebar.html @@ -1,12 +1,13 @@

    {% trans %}Download{% endtrans %}

    {% trans %}Download these documents{% endtrans %}

    -

    {% trans %}Docs for other versions{% endtrans %}

    +

    {% trans %}Docs by version{% endtrans %}

    {% trans %}Other resources{% endtrans %}

    From solipsis at pitrou.net Thu Nov 8 04:09:51 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Thu, 08 Nov 2018 09:09:51 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=12 Message-ID: <20181108090951.1.6B2A2013C85D685C@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [0, 0, 7] memory blocks, sum=7 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_forkserver leaked [2, -2, 1] memory blocks, sum=1 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/refloggF8suT', '--timeout', '7200'] From webhook-mailer at python.org Thu Nov 8 04:45:13 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Thu, 08 Nov 2018 09:45:13 -0000 Subject: [Python-checkins] Replace dead code with an assertion in winreg.c. (GH-10028) Message-ID: https://github.com/python/cpython/commit/5d95312fb8eb1684879b9fb8c5c928089326d0df commit: 5d95312fb8eb1684879b9fb8c5c928089326d0df branch: master author: Zackery Spytz committer: Serhiy Storchaka date: 2018-11-08T11:45:00+02:00 summary: Replace dead code with an assertion in winreg.c. (GH-10028) files: M PC/winreg.c diff --git a/PC/winreg.c b/PC/winreg.c index 4f5a676f10b5..c6ad7ab64e16 100644 --- a/PC/winreg.c +++ b/PC/winreg.c @@ -651,8 +651,7 @@ Py2Reg(PyObject *value, DWORD typ, BYTE **retDataBuf, DWORD *retDataSize) t = PyList_GET_ITEM(value, j); wstr = PyUnicode_AsUnicodeAndSize(t, &len); - if (wstr == NULL) - return FALSE; + assert(wstr); wcscpy(P, wstr); P += (len + 1); } From webhook-mailer at python.org Thu Nov 8 07:21:52 2018 From: webhook-mailer at python.org (Andrew Svetlov) Date: Thu, 08 Nov 2018 12:21:52 -0000 Subject: [Python-checkins] bpo-35065: Remove `StreamReaderProtocol._untrack_reader` (#10212) Message-ID: https://github.com/python/cpython/commit/fd512d76456b65c529a5bc58d8cfe73e4a10de7a commit: fd512d76456b65c529a5bc58d8cfe73e4a10de7a branch: master author: Vincent Michel committer: Andrew Svetlov date: 2018-11-08T14:21:47+02:00 summary: bpo-35065: Remove `StreamReaderProtocol._untrack_reader` (#10212) The call to `_untrack_reader` is performed too soon, causing the protocol to forget about the reader before `connection_lost` can run and feed the EOF to the reader. See bpo-35065. files: A Misc/NEWS.d/next/Library/2018-10-29-10-18-31.bpo-35065.CulMN8.rst M Lib/asyncio/streams.py M Lib/asyncio/subprocess.py M Lib/test/test_asyncio/test_streams.py diff --git a/Lib/asyncio/streams.py b/Lib/asyncio/streams.py index 0afc66a473d4..33fc303a6ffc 100644 --- a/Lib/asyncio/streams.py +++ b/Lib/asyncio/streams.py @@ -227,9 +227,6 @@ def _on_reader_gc(self, wr): self._reject_connection = True self._stream_reader_wr = None - def _untrack_reader(self): - self._stream_reader_wr = None - @property def _stream_reader(self): if self._stream_reader_wr is None: @@ -345,9 +342,6 @@ def can_write_eof(self): return self._transport.can_write_eof() def close(self): - # a reader can be garbage collected - # after connection closing - self._protocol._untrack_reader() self._transport.close() def is_closing(self): diff --git a/Lib/asyncio/subprocess.py b/Lib/asyncio/subprocess.py index c86de3d08702..90fc00de8339 100644 --- a/Lib/asyncio/subprocess.py +++ b/Lib/asyncio/subprocess.py @@ -36,11 +36,6 @@ def __repr__(self): info.append(f'stderr={self.stderr!r}') return '<{}>'.format(' '.join(info)) - def _untrack_reader(self): - # StreamWriter.close() expects the protocol - # to have this method defined. - pass - def connection_made(self, transport): self._transport = transport diff --git a/Lib/test/test_asyncio/test_streams.py b/Lib/test/test_asyncio/test_streams.py index 0141df729ce0..043fac7c6a2d 100644 --- a/Lib/test/test_asyncio/test_streams.py +++ b/Lib/test/test_asyncio/test_streams.py @@ -589,6 +589,7 @@ def __init__(self, loop): client_writer.write(data) await client_writer.drain() client_writer.close() + await client_writer.wait_closed() def start(self): sock = socket.socket() @@ -628,6 +629,7 @@ def stop(self): # read it back msgback = await reader.readline() writer.close() + await writer.wait_closed() return msgback messages = [] @@ -666,6 +668,7 @@ def __init__(self, loop, path): client_writer.write(data) await client_writer.drain() client_writer.close() + await client_writer.wait_closed() def start(self): self.server = self.loop.run_until_complete( @@ -697,6 +700,7 @@ def stop(self): # read it back msgback = await reader.readline() writer.close() + await writer.wait_closed() return msgback messages = [] @@ -987,6 +991,25 @@ def test_async_writer_api(self): self.assertEqual(messages, []) + def test_eof_feed_when_closing_writer(self): + # See http://bugs.python.org/issue35065 + messages = [] + self.loop.set_exception_handler(lambda loop, ctx: messages.append(ctx)) + + with test_utils.run_test_server() as httpd: + rd, wr = self.loop.run_until_complete( + asyncio.open_connection(*httpd.address, + loop=self.loop)) + + f = wr.aclose() + self.loop.run_until_complete(f) + assert rd.at_eof() + f = rd.read() + data = self.loop.run_until_complete(f) + assert data == b'' + + self.assertEqual(messages, []) + if __name__ == '__main__': unittest.main() diff --git a/Misc/NEWS.d/next/Library/2018-10-29-10-18-31.bpo-35065.CulMN8.rst b/Misc/NEWS.d/next/Library/2018-10-29-10-18-31.bpo-35065.CulMN8.rst new file mode 100644 index 000000000000..9d5d61263f8c --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-29-10-18-31.bpo-35065.CulMN8.rst @@ -0,0 +1,3 @@ +Remove `StreamReaderProtocol._untrack_reader`. The call to `_untrack_reader` +is currently performed too soon, causing the protocol to forget about the +reader before `connection_lost` can run and feed the EOF to the reader. From webhook-mailer at python.org Thu Nov 8 20:55:13 2018 From: webhook-mailer at python.org (Gregory P. Smith) Date: Fri, 09 Nov 2018 01:55:13 -0000 Subject: [Python-checkins] bpo-35193: Fix an off by one error in the RETURN_VALUE case. (GH-10418) Message-ID: https://github.com/python/cpython/commit/49fa4a9f1ef387e16596f271414c855339eadf09 commit: 49fa4a9f1ef387e16596f271414c855339eadf09 branch: master author: Gregory P. Smith committer: GitHub date: 2018-11-08T17:55:07-08:00 summary: bpo-35193: Fix an off by one error in the RETURN_VALUE case. (GH-10418) Fix an off by one error in the peephole optimizer when checking for unreachable code beyond a return. Do a bounds check within find_op so it can return before going past the end as a safety measure. https://github.com/python/cpython/commit/7db3c488335168993689ddae5914a28e16188447#diff-a33329ae6ae0bb295d742f0caf93c137 introduced this off by one error while fixing another one nearby. This bug was shipped in all Python 3.6 and 3.7 releases. The included unittest won't fail unless you do a clang msan build. files: A Misc/NEWS.d/next/Core and Builtins/2018-11-08-15-00-58.bpo-35193.HzPS6R.rst M Lib/test/test_compile.py M Python/peephole.c diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index 6851f84b85a6..a086ef65b44a 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -1,3 +1,4 @@ +import dis import math import os import unittest @@ -621,6 +622,24 @@ def check_same_constant(const): self.check_constant(f1, frozenset({0})) self.assertTrue(f1(0)) + # This is a regression test for a CPython specific peephole optimizer + # implementation bug present in a few releases. It's assertion verifies + # that peephole optimization was actually done though that isn't an + # indication of the bugs presence or not (crashing is). + @support.cpython_only + def test_peephole_opt_unreachable_code_array_access_in_bounds(self): + """Regression test for issue35193 when run under clang msan.""" + def unused_code_at_end(): + return 3 + raise RuntimeError("unreachable") + # The above function definition will trigger the out of bounds + # bug in the peephole optimizer as it scans opcodes past the + # RETURN_VALUE opcode. This does not always crash an interpreter. + # When you build with the clang memory sanitizer it reliably aborts. + self.assertEqual( + 'RETURN_VALUE', + list(dis.get_instructions(unused_code_at_end))[-1].opname) + def test_dont_merge_constants(self): # Issue #25843: compile() must not merge constants which are equal # but have a different type. diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-11-08-15-00-58.bpo-35193.HzPS6R.rst b/Misc/NEWS.d/next/Core and Builtins/2018-11-08-15-00-58.bpo-35193.HzPS6R.rst new file mode 100644 index 000000000000..dddebe167080 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-11-08-15-00-58.bpo-35193.HzPS6R.rst @@ -0,0 +1,3 @@ +Fix an off by one error in the bytecode peephole optimizer where it could read +bytes beyond the end of bounds of an array when removing unreachable code. +This bug was present in every release of Python 3.6 and 3.7 until now. diff --git a/Python/peephole.c b/Python/peephole.c index 16fd5009bf1d..77d134939f8d 100644 --- a/Python/peephole.c +++ b/Python/peephole.c @@ -50,9 +50,9 @@ lastn_const_start(const _Py_CODEUNIT *codestr, Py_ssize_t i, Py_ssize_t n) /* Scans through EXTENDED ARGs, seeking the index of the effective opcode */ static Py_ssize_t -find_op(const _Py_CODEUNIT *codestr, Py_ssize_t i) +find_op(const _Py_CODEUNIT *codestr, Py_ssize_t codelen, Py_ssize_t i) { - while (_Py_OPCODE(codestr[i]) == EXTENDED_ARG) { + while (i < codelen && _Py_OPCODE(codestr[i]) == EXTENDED_ARG) { i++; } return i; @@ -128,8 +128,9 @@ copy_op_arg(_Py_CODEUNIT *codestr, Py_ssize_t i, unsigned char op, Called with codestr pointing to the first LOAD_CONST. */ static Py_ssize_t -fold_tuple_on_constants(_Py_CODEUNIT *codestr, Py_ssize_t c_start, - Py_ssize_t opcode_end, PyObject *consts, int n) +fold_tuple_on_constants(_Py_CODEUNIT *codestr, Py_ssize_t codelen, + Py_ssize_t c_start, Py_ssize_t opcode_end, + PyObject *consts, int n) { /* Pre-conditions */ assert(PyList_CheckExact(consts)); @@ -142,7 +143,7 @@ fold_tuple_on_constants(_Py_CODEUNIT *codestr, Py_ssize_t c_start, for (Py_ssize_t i = 0, pos = c_start; i < n; i++, pos++) { assert(pos < opcode_end); - pos = find_op(codestr, pos); + pos = find_op(codestr, codelen, pos); assert(_Py_OPCODE(codestr[pos]) == LOAD_CONST); unsigned int arg = get_arg(codestr, pos); @@ -265,7 +266,7 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names, goto exitError; assert(PyList_Check(consts)); - for (i=find_op(codestr, 0) ; i= 1 && _Py_OPCODE(codestr[op_start-1]) == EXTENDED_ARG) { @@ -303,7 +304,8 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names, if (j > 0 && lastlc >= j) { h = lastn_const_start(codestr, op_start, j); if (ISBASICBLOCK(blocks, h, op_start)) { - h = fold_tuple_on_constants(codestr, h, i+1, consts, j); + h = fold_tuple_on_constants(codestr, codelen, + h, i+1, consts, j); break; } } @@ -340,7 +342,7 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names, case JUMP_IF_FALSE_OR_POP: case JUMP_IF_TRUE_OR_POP: h = get_arg(codestr, i) / sizeof(_Py_CODEUNIT); - tgt = find_op(codestr, h); + tgt = find_op(codestr, codelen, h); j = _Py_OPCODE(codestr[tgt]); if (CONDITIONAL_JUMP(j)) { @@ -374,7 +376,7 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names, case JUMP_FORWARD: case JUMP_ABSOLUTE: h = GETJUMPTGT(codestr, i); - tgt = find_op(codestr, h); + tgt = find_op(codestr, codelen, h); /* Replace JUMP_* to a RETURN into just a RETURN */ if (UNCONDITIONAL_JUMP(opcode) && _Py_OPCODE(codestr[tgt]) == RETURN_VALUE) { @@ -417,7 +419,7 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names, } if (h > i + 1) { fill_nops(codestr, i + 1, h); - nexti = find_op(codestr, h); + nexti = find_op(codestr, codelen, h); } break; } From webhook-mailer at python.org Thu Nov 8 21:13:21 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 09 Nov 2018 02:13:21 -0000 Subject: [Python-checkins] bpo-35193: Fix an off by one error in the RETURN_VALUE case. (GH-10418) Message-ID: https://github.com/python/cpython/commit/f16ebcd460aaeb8d6b31db317d22f5ed68afbcc8 commit: f16ebcd460aaeb8d6b31db317d22f5ed68afbcc8 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-08T18:13:14-08:00 summary: bpo-35193: Fix an off by one error in the RETURN_VALUE case. (GH-10418) Fix an off by one error in the peephole optimizer when checking for unreachable code beyond a return. Do a bounds check within find_op so it can return before going past the end as a safety measure. https://github.com/python/cpython/commit/7db3c488335168993689ddae5914a28e16188447GH-diff-a33329ae6ae0bb295d742f0caf93c137 introduced this off by one error while fixing another one nearby. This bug was shipped in all Python 3.6 and 3.7 releases. The included unittest won't fail unless you do a clang msan build. (cherry picked from commit 49fa4a9f1ef387e16596f271414c855339eadf09) Co-authored-by: Gregory P. Smith files: A Misc/NEWS.d/next/Core and Builtins/2018-11-08-15-00-58.bpo-35193.HzPS6R.rst M Lib/test/test_compile.py M Python/peephole.c diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index d8a57e5e0925..5ac1c5f27131 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -1,3 +1,4 @@ +import dis import math import os import unittest @@ -621,6 +622,24 @@ def check_same_constant(const): self.check_constant(f1, frozenset({0})) self.assertTrue(f1(0)) + # This is a regression test for a CPython specific peephole optimizer + # implementation bug present in a few releases. It's assertion verifies + # that peephole optimization was actually done though that isn't an + # indication of the bugs presence or not (crashing is). + @support.cpython_only + def test_peephole_opt_unreachable_code_array_access_in_bounds(self): + """Regression test for issue35193 when run under clang msan.""" + def unused_code_at_end(): + return 3 + raise RuntimeError("unreachable") + # The above function definition will trigger the out of bounds + # bug in the peephole optimizer as it scans opcodes past the + # RETURN_VALUE opcode. This does not always crash an interpreter. + # When you build with the clang memory sanitizer it reliably aborts. + self.assertEqual( + 'RETURN_VALUE', + list(dis.get_instructions(unused_code_at_end))[-1].opname) + def test_dont_merge_constants(self): # Issue #25843: compile() must not merge constants which are equal # but have a different type. diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-11-08-15-00-58.bpo-35193.HzPS6R.rst b/Misc/NEWS.d/next/Core and Builtins/2018-11-08-15-00-58.bpo-35193.HzPS6R.rst new file mode 100644 index 000000000000..dddebe167080 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-11-08-15-00-58.bpo-35193.HzPS6R.rst @@ -0,0 +1,3 @@ +Fix an off by one error in the bytecode peephole optimizer where it could read +bytes beyond the end of bounds of an array when removing unreachable code. +This bug was present in every release of Python 3.6 and 3.7 until now. diff --git a/Python/peephole.c b/Python/peephole.c index 76a0edbcc2bc..a3b078fdf1d4 100644 --- a/Python/peephole.c +++ b/Python/peephole.c @@ -50,9 +50,9 @@ lastn_const_start(const _Py_CODEUNIT *codestr, Py_ssize_t i, Py_ssize_t n) /* Scans through EXTENDED ARGs, seeking the index of the effective opcode */ static Py_ssize_t -find_op(const _Py_CODEUNIT *codestr, Py_ssize_t i) +find_op(const _Py_CODEUNIT *codestr, Py_ssize_t codelen, Py_ssize_t i) { - while (_Py_OPCODE(codestr[i]) == EXTENDED_ARG) { + while (i < codelen && _Py_OPCODE(codestr[i]) == EXTENDED_ARG) { i++; } return i; @@ -128,8 +128,9 @@ copy_op_arg(_Py_CODEUNIT *codestr, Py_ssize_t i, unsigned char op, Called with codestr pointing to the first LOAD_CONST. */ static Py_ssize_t -fold_tuple_on_constants(_Py_CODEUNIT *codestr, Py_ssize_t c_start, - Py_ssize_t opcode_end, PyObject *consts, int n) +fold_tuple_on_constants(_Py_CODEUNIT *codestr, Py_ssize_t codelen, + Py_ssize_t c_start, Py_ssize_t opcode_end, + PyObject *consts, int n) { /* Pre-conditions */ assert(PyList_CheckExact(consts)); @@ -142,7 +143,7 @@ fold_tuple_on_constants(_Py_CODEUNIT *codestr, Py_ssize_t c_start, for (Py_ssize_t i = 0, pos = c_start; i < n; i++, pos++) { assert(pos < opcode_end); - pos = find_op(codestr, pos); + pos = find_op(codestr, codelen, pos); assert(_Py_OPCODE(codestr[pos]) == LOAD_CONST); unsigned int arg = get_arg(codestr, pos); @@ -267,7 +268,7 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names, goto exitError; assert(PyList_Check(consts)); - for (i=find_op(codestr, 0) ; i= 1 && _Py_OPCODE(codestr[op_start-1]) == EXTENDED_ARG) { @@ -305,7 +306,8 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names, if (j > 0 && lastlc >= j) { h = lastn_const_start(codestr, op_start, j); if (ISBASICBLOCK(blocks, h, op_start)) { - h = fold_tuple_on_constants(codestr, h, i+1, consts, j); + h = fold_tuple_on_constants(codestr, codelen, + h, i+1, consts, j); break; } } @@ -342,7 +344,7 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names, case JUMP_IF_FALSE_OR_POP: case JUMP_IF_TRUE_OR_POP: h = get_arg(codestr, i) / sizeof(_Py_CODEUNIT); - tgt = find_op(codestr, h); + tgt = find_op(codestr, codelen, h); j = _Py_OPCODE(codestr[tgt]); if (CONDITIONAL_JUMP(j)) { @@ -383,7 +385,7 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names, case SETUP_WITH: case SETUP_ASYNC_WITH: h = GETJUMPTGT(codestr, i); - tgt = find_op(codestr, h); + tgt = find_op(codestr, codelen, h); /* Replace JUMP_* to a RETURN into just a RETURN */ if (UNCONDITIONAL_JUMP(opcode) && _Py_OPCODE(codestr[tgt]) == RETURN_VALUE) { @@ -412,7 +414,7 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names, } if (h > i + 1) { fill_nops(codestr, i + 1, h); - nexti = find_op(codestr, h); + nexti = find_op(codestr, codelen, h); } break; } From webhook-mailer at python.org Thu Nov 8 21:34:39 2018 From: webhook-mailer at python.org (Lisa Roach) Date: Fri, 09 Nov 2018 02:34:39 -0000 Subject: [Python-checkins] bpo-24412: Adds cleanUps for setUpClass and setUpModule. (GH-9190) Message-ID: https://github.com/python/cpython/commit/0f221d09cad46bee38d1b7a7822772df66c53028 commit: 0f221d09cad46bee38d1b7a7822772df66c53028 branch: master author: Lisa Roach committer: GitHub date: 2018-11-08T18:34:33-08:00 summary: bpo-24412: Adds cleanUps for setUpClass and setUpModule. (GH-9190) files: A Misc/NEWS.d/next/Library/2018-09-11-10-51-16.bpo-24412.i-F_E5.rst M Doc/library/unittest.rst M Doc/whatsnew/3.8.rst M Lib/unittest/__init__.py M Lib/unittest/case.py M Lib/unittest/suite.py M Lib/unittest/test/test_runner.py diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index 1153459029ce..c4019088c79f 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -1448,6 +1448,39 @@ Test cases .. versionadded:: 3.1 + .. classmethod:: addClassCleanup(function, *args, **kwargs) + + Add a function to be called after :meth:`tearDownClass` to cleanup + resources used during the test class. Functions will be called in reverse + order to the order they are added (:abbr:`LIFO (last-in, first-out)`). + They are called with any arguments and keyword arguments passed into + :meth:`addClassCleanup` when they are added. + + If :meth:`setUpClass` fails, meaning that :meth:`tearDownClass` is not + called, then any cleanup functions added will still be called. + + .. versionadded:: 3.8 + + + .. classmethod:: doClassCleanups() + + This method is called unconditionally after :meth:`tearDownClass`, or + 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 + *prior* to :meth:`tearDownClass` then you can call + :meth:`doCleanupsClass` yourself. + + :meth:`doCleanupsClass` pops methods off the stack of cleanup + functions one at a time, so it can be called at any time. + + .. versionadded:: 3.8 + + + + + .. class:: FunctionTestCase(testFunc, setUp=None, tearDown=None, description=None) @@ -2268,6 +2301,38 @@ module will be run and the ``tearDownModule`` will not be run. If the exception :exc:`SkipTest` exception then the module will be reported as having been skipped instead of as an error. +To add cleanup code that must be run even in the case of an exception, use +``addModuleCleanup``: + + +.. function:: addModuleCleanup(function, *args, **kwargs) + + Add a function to be called after :func:`tearDownModule` to cleanup + resources used during the test class. Functions will be called in reverse + order to the order they are added (:abbr:`LIFO (last-in, first-out)`). + They are called with any arguments and keyword arguments passed into + :meth:`addModuleCleanup` when they are added. + + If :meth:`setUpModule` fails, meaning that :func:`tearDownModule` is not + called, then any cleanup functions added will still be called. + + .. versionadded:: 3.8 + + +.. function:: doModuleCleanups() + + This function is called unconditionally after :func:`tearDownModule`, or + after :func:`setUpModule` if :func:`setUpModule` raises an exception. + + It is responsible for calling all the cleanup functions added by + :func:`addCleanupModule`. If you need cleanup functions to be called + *prior* to :func:`tearDownModule` then you can call + :func:`doModuleCleanups` yourself. + + :func:`doModuleCleanups` pops methods off the stack of cleanup + functions one at a time, so it can be called at any time. + + .. versionadded:: 3.8 Signal Handling --------------- diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index 74bdba3375c9..91e0d5bb7b33 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -233,6 +233,15 @@ unicodedata is in a specific normal form. (Contributed by Max Belanger and David Euresti in :issue:`32285`). +unittest +-------- + +* Added :func:`~unittest.addModuleCleanup()` and + :meth:`~unittest.TestCase.addClassCleanup()` to unittest to support + cleanups for :func:`~unittest.setUpModule()` and + :meth:`~unittest.TestCase.setUpClass()`. + (Contributed by Lisa Roach in :issue:`24412`.) + venv ---- diff --git a/Lib/unittest/__init__.py b/Lib/unittest/__init__.py index c55d563e0c38..5ff1bf37b169 100644 --- a/Lib/unittest/__init__.py +++ b/Lib/unittest/__init__.py @@ -48,7 +48,8 @@ def testMultiply(self): 'TextTestRunner', 'TestLoader', 'FunctionTestCase', 'main', 'defaultTestLoader', 'SkipTest', 'skip', 'skipIf', 'skipUnless', 'expectedFailure', 'TextTestResult', 'installHandler', - 'registerResult', 'removeResult', 'removeHandler'] + 'registerResult', 'removeResult', 'removeHandler', + 'addModuleCleanup'] # Expose obsolete functions for backwards compatibility __all__.extend(['getTestCaseNames', 'makeSuite', 'findTestCases']) @@ -56,8 +57,8 @@ def testMultiply(self): __unittest = True from .result import TestResult -from .case import (TestCase, FunctionTestCase, SkipTest, skip, skipIf, - skipUnless, expectedFailure) +from .case import (addModuleCleanup, TestCase, FunctionTestCase, SkipTest, skip, + skipIf, skipUnless, expectedFailure) from .suite import BaseTestSuite, TestSuite from .loader import (TestLoader, defaultTestLoader, makeSuite, getTestCaseNames, findTestCases) diff --git a/Lib/unittest/case.py b/Lib/unittest/case.py index 2579c30474b5..a157ae8a14bc 100644 --- a/Lib/unittest/case.py +++ b/Lib/unittest/case.py @@ -84,6 +84,30 @@ def testPartExecutor(self, test_case, isTest=False): def _id(obj): return obj + +_module_cleanups = [] +def addModuleCleanup(function, *args, **kwargs): + """Same as addCleanup, except the cleanup items are called even if + setUpModule fails (unlike tearDownModule).""" + _module_cleanups.append((function, args, kwargs)) + + +def doModuleCleanups(): + """Execute all module cleanup functions. Normally called for you after + tearDownModule.""" + exceptions = [] + while _module_cleanups: + function, args, kwargs = _module_cleanups.pop() + try: + function(*args, **kwargs) + except Exception as exc: + exceptions.append(exc) + if exceptions: + # Swallows all but first exception. If a multi-exception handler + # gets written we should use that here instead. + raise exceptions[0] + + def skip(reason): """ Unconditionally skip a test. @@ -390,6 +414,8 @@ class TestCase(object): _classSetupFailed = False + _class_cleanups = [] + def __init__(self, methodName='runTest'): """Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does @@ -445,6 +471,12 @@ def addCleanup(self, function, *args, **kwargs): Cleanup items are called even if setUp fails (unlike tearDown).""" self._cleanups.append((function, args, kwargs)) + @classmethod + def addClassCleanup(cls, function, *args, **kwargs): + """Same as addCleanup, except the cleanup items are called even if + setUpClass fails (unlike tearDownClass).""" + cls._class_cleanups.append((function, args, kwargs)) + def setUp(self): "Hook method for setting up the test fixture before exercising it." pass @@ -651,9 +683,21 @@ def doCleanups(self): function(*args, **kwargs) # return this for backwards compatibility - # even though we no longer us it internally + # even though we no longer use it internally return outcome.success + @classmethod + def doClassCleanups(cls): + """Execute all class cleanup functions. Normally called for you after + tearDownClass.""" + cls.tearDown_exceptions = [] + while cls._class_cleanups: + function, args, kwargs = cls._class_cleanups.pop() + try: + function(*args, **kwargs) + except Exception as exc: + cls.tearDown_exceptions.append(sys.exc_info()) + def __call__(self, *args, **kwds): return self.run(*args, **kwds) diff --git a/Lib/unittest/suite.py b/Lib/unittest/suite.py index 353d4a17b963..41993f9cf69a 100644 --- a/Lib/unittest/suite.py +++ b/Lib/unittest/suite.py @@ -166,10 +166,18 @@ def _handleClassSetUp(self, test, result): raise currentClass._classSetupFailed = True className = util.strclass(currentClass) - errorName = 'setUpClass (%s)' % className - self._addClassOrModuleLevelException(result, e, errorName) + self._createClassOrModuleLevelException(result, e, + 'setUpClass', + className) finally: _call_if_exists(result, '_restoreStdout') + if currentClass._classSetupFailed is True: + currentClass.doClassCleanups() + if len(currentClass.tearDown_exceptions) > 0: + for exc in currentClass.tearDown_exceptions: + self._createClassOrModuleLevelException( + result, exc[1], 'setUpClass', className, + info=exc) def _get_previous_module(self, result): previousModule = None @@ -199,21 +207,37 @@ def _handleModuleFixture(self, test, result): try: setUpModule() except Exception as e: + try: + case.doModuleCleanups() + except Exception as exc: + self._createClassOrModuleLevelException(result, exc, + 'setUpModule', + currentModule) if isinstance(result, _DebugResult): raise result._moduleSetUpFailed = True - errorName = 'setUpModule (%s)' % currentModule - self._addClassOrModuleLevelException(result, e, errorName) + self._createClassOrModuleLevelException(result, e, + 'setUpModule', + currentModule) finally: _call_if_exists(result, '_restoreStdout') - def _addClassOrModuleLevelException(self, result, exception, errorName): + def _createClassOrModuleLevelException(self, result, exc, method_name, + parent, info=None): + errorName = f'{method_name} ({parent})' + self._addClassOrModuleLevelException(result, exc, errorName, info) + + def _addClassOrModuleLevelException(self, result, exception, errorName, + info=None): error = _ErrorHolder(errorName) addSkip = getattr(result, 'addSkip', None) if addSkip is not None and isinstance(exception, case.SkipTest): addSkip(error, str(exception)) else: - result.addError(error, sys.exc_info()) + if not info: + result.addError(error, sys.exc_info()) + else: + result.addError(error, info) def _handleModuleTearDown(self, result): previousModule = self._get_previous_module(result) @@ -235,10 +259,17 @@ def _handleModuleTearDown(self, result): except Exception as e: if isinstance(result, _DebugResult): raise - errorName = 'tearDownModule (%s)' % previousModule - self._addClassOrModuleLevelException(result, e, errorName) + self._createClassOrModuleLevelException(result, e, + 'tearDownModule', + previousModule) finally: _call_if_exists(result, '_restoreStdout') + try: + case.doModuleCleanups() + except Exception as e: + self._createClassOrModuleLevelException(result, e, + 'tearDownModule', + previousModule) def _tearDownPreviousClass(self, test, result): previousClass = getattr(result, '_previousTestClass', None) @@ -261,10 +292,19 @@ def _tearDownPreviousClass(self, test, result): if isinstance(result, _DebugResult): raise className = util.strclass(previousClass) - errorName = 'tearDownClass (%s)' % className - self._addClassOrModuleLevelException(result, e, errorName) + self._createClassOrModuleLevelException(result, e, + 'tearDownClass', + className) finally: _call_if_exists(result, '_restoreStdout') + previousClass.doClassCleanups() + if len(previousClass.tearDown_exceptions) > 0: + for exc in previousClass.tearDown_exceptions: + className = util.strclass(previousClass) + self._createClassOrModuleLevelException(result, exc[1], + 'tearDownClass', + className, + info=exc) class _ErrorHolder(object): diff --git a/Lib/unittest/test/test_runner.py b/Lib/unittest/test/test_runner.py index 3c4005671f73..6f89f77ff778 100644 --- a/Lib/unittest/test/test_runner.py +++ b/Lib/unittest/test/test_runner.py @@ -11,8 +11,41 @@ ResultWithNoStartTestRunStopTestRun) -class TestCleanUp(unittest.TestCase): +def resultFactory(*_): + return unittest.TestResult() + + +def getRunner(): + return unittest.TextTestRunner(resultclass=resultFactory, + stream=io.StringIO()) + + +def runTests(*cases): + suite = unittest.TestSuite() + for case in cases: + tests = unittest.defaultTestLoader.loadTestsFromTestCase(case) + suite.addTests(tests) + + runner = getRunner() + + # creating a nested suite exposes some potential bugs + realSuite = unittest.TestSuite() + realSuite.addTest(suite) + # adding empty suites to the end exposes potential bugs + suite.addTest(unittest.TestSuite()) + realSuite.addTest(unittest.TestSuite()) + return runner.run(realSuite) + + +def cleanup(ordering, blowUp=False): + if not blowUp: + ordering.append('cleanup_good') + else: + ordering.append('cleanup_exc') + raise Exception('CleanUpExc') + +class TestCleanUp(unittest.TestCase): def testCleanUp(self): class TestableTest(unittest.TestCase): def testNothing(self): @@ -47,10 +80,10 @@ def testNothing(self): test = TestableTest('testNothing') outcome = test._outcome = _Outcome() - exc1 = Exception('foo') + CleanUpExc = Exception('foo') exc2 = Exception('bar') def cleanup1(): - raise exc1 + raise CleanUpExc def cleanup2(): raise exc2 @@ -63,7 +96,7 @@ def cleanup2(): ((_, (Type1, instance1, _)), (_, (Type2, instance2, _))) = reversed(outcome.errors) - self.assertEqual((Type1, instance1), (Exception, exc1)) + self.assertEqual((Type1, instance1), (Exception, CleanUpExc)) self.assertEqual((Type2, instance2), (Exception, exc2)) def testCleanupInRun(self): @@ -135,6 +168,575 @@ def cleanup2(): self.assertEqual(ordering, ['setUp', 'test', 'tearDown', 'cleanup1', 'cleanup2']) +class TestClassCleanup(unittest.TestCase): + def test_addClassCleanUp(self): + class TestableTest(unittest.TestCase): + def testNothing(self): + pass + test = TestableTest('testNothing') + self.assertEqual(test._class_cleanups, []) + class_cleanups = [] + + def class_cleanup1(*args, **kwargs): + class_cleanups.append((3, args, kwargs)) + + def class_cleanup2(*args, **kwargs): + class_cleanups.append((4, args, kwargs)) + + TestableTest.addClassCleanup(class_cleanup1, 1, 2, 3, + four='hello', five='goodbye') + TestableTest.addClassCleanup(class_cleanup2) + + self.assertEqual(test._class_cleanups, + [(class_cleanup1, (1, 2, 3), + dict(four='hello', five='goodbye')), + (class_cleanup2, (), {})]) + + TestableTest.doClassCleanups() + self.assertEqual(class_cleanups, [(4, (), {}), (3, (1, 2, 3), + dict(four='hello', five='goodbye'))]) + + def test_run_class_cleanUp(self): + ordering = [] + blowUp = True + + class TestableTest(unittest.TestCase): + @classmethod + def setUpClass(cls): + ordering.append('setUpClass') + cls.addClassCleanup(cleanup, ordering) + if blowUp: + raise Exception() + def testNothing(self): + ordering.append('test') + @classmethod + def tearDownClass(cls): + ordering.append('tearDownClass') + + runTests(TestableTest) + self.assertEqual(ordering, ['setUpClass', 'cleanup_good']) + + ordering = [] + blowUp = False + runTests(TestableTest) + self.assertEqual(ordering, + ['setUpClass', 'test', 'tearDownClass', 'cleanup_good']) + + def test_debug_executes_classCleanUp(self): + ordering = [] + + class TestableTest(unittest.TestCase): + @classmethod + def setUpClass(cls): + ordering.append('setUpClass') + cls.addClassCleanup(cleanup, ordering) + def testNothing(self): + ordering.append('test') + @classmethod + def tearDownClass(cls): + ordering.append('tearDownClass') + + suite = unittest.defaultTestLoader.loadTestsFromTestCase(TestableTest) + suite.debug() + self.assertEqual(ordering, + ['setUpClass', 'test', 'tearDownClass', 'cleanup_good']) + + def test_doClassCleanups_with_errors_addClassCleanUp(self): + class TestableTest(unittest.TestCase): + def testNothing(self): + pass + + def cleanup1(): + raise Exception('cleanup1') + + def cleanup2(): + raise Exception('cleanup2') + + TestableTest.addClassCleanup(cleanup1) + TestableTest.addClassCleanup(cleanup2) + with self.assertRaises(Exception) as e: + TestableTest.doClassCleanups() + self.assertEquals(e, 'cleanup1') + + def test_with_errors_addCleanUp(self): + ordering = [] + class TestableTest(unittest.TestCase): + @classmethod + def setUpClass(cls): + ordering.append('setUpClass') + cls.addClassCleanup(cleanup, ordering) + def setUp(self): + ordering.append('setUp') + self.addCleanup(cleanup, ordering, blowUp=True) + def testNothing(self): + pass + @classmethod + def tearDownClass(cls): + ordering.append('tearDownClass') + + result = runTests(TestableTest) + self.assertEqual(result.errors[0][1].splitlines()[-1], + 'Exception: CleanUpExc') + self.assertEqual(ordering, + ['setUpClass', 'setUp', 'cleanup_exc', + 'tearDownClass', 'cleanup_good']) + + def test_run_with_errors_addClassCleanUp(self): + ordering = [] + class TestableTest(unittest.TestCase): + @classmethod + def setUpClass(cls): + ordering.append('setUpClass') + cls.addClassCleanup(cleanup, ordering, blowUp=True) + def setUp(self): + ordering.append('setUp') + self.addCleanup(cleanup, ordering) + def testNothing(self): + ordering.append('test') + @classmethod + def tearDownClass(cls): + ordering.append('tearDownClass') + + result = runTests(TestableTest) + self.assertEqual(result.errors[0][1].splitlines()[-1], + 'Exception: CleanUpExc') + self.assertEqual(ordering, + ['setUpClass', 'setUp', 'test', 'cleanup_good', + 'tearDownClass', 'cleanup_exc']) + + def test_with_errors_in_addClassCleanup_and_setUps(self): + ordering = [] + class_blow_up = False + method_blow_up = False + + class TestableTest(unittest.TestCase): + @classmethod + def setUpClass(cls): + ordering.append('setUpClass') + cls.addClassCleanup(cleanup, ordering, blowUp=True) + if class_blow_up: + raise Exception('ClassExc') + def setUp(self): + ordering.append('setUp') + if method_blow_up: + raise Exception('MethodExc') + def testNothing(self): + ordering.append('test') + @classmethod + def tearDownClass(cls): + ordering.append('tearDownClass') + + result = runTests(TestableTest) + self.assertEqual(result.errors[0][1].splitlines()[-1], + 'Exception: CleanUpExc') + self.assertEqual(ordering, + ['setUpClass', 'setUp', 'test', + 'tearDownClass', 'cleanup_exc']) + ordering = [] + class_blow_up = True + method_blow_up = False + result = runTests(TestableTest) + self.assertEqual(result.errors[0][1].splitlines()[-1], + 'Exception: ClassExc') + self.assertEqual(result.errors[1][1].splitlines()[-1], + 'Exception: CleanUpExc') + self.assertEqual(ordering, + ['setUpClass', 'cleanup_exc']) + + ordering = [] + class_blow_up = False + method_blow_up = True + result = runTests(TestableTest) + self.assertEqual(result.errors[0][1].splitlines()[-1], + 'Exception: MethodExc') + self.assertEqual(result.errors[1][1].splitlines()[-1], + 'Exception: CleanUpExc') + self.assertEqual(ordering, + ['setUpClass', 'setUp', 'tearDownClass', + 'cleanup_exc']) + + +class TestModuleCleanUp(unittest.TestCase): + def test_add_and_do_ModuleCleanup(self): + module_cleanups = [] + + def module_cleanup1(*args, **kwargs): + module_cleanups.append((3, args, kwargs)) + + def module_cleanup2(*args, **kwargs): + module_cleanups.append((4, args, kwargs)) + + class Module(object): + unittest.addModuleCleanup(module_cleanup1, 1, 2, 3, + four='hello', five='goodbye') + unittest.addModuleCleanup(module_cleanup2) + + self.assertEqual(unittest.case._module_cleanups, + [(module_cleanup1, (1, 2, 3), + dict(four='hello', five='goodbye')), + (module_cleanup2, (), {})]) + + unittest.case.doModuleCleanups() + self.assertEqual(module_cleanups, [(4, (), {}), (3, (1, 2, 3), + dict(four='hello', five='goodbye'))]) + self.assertEqual(unittest.case._module_cleanups, []) + + def test_doModuleCleanup_with_errors_in_addModuleCleanup(self): + module_cleanups = [] + + def module_cleanup_good(*args, **kwargs): + module_cleanups.append((3, args, kwargs)) + + def module_cleanup_bad(*args, **kwargs): + raise Exception('CleanUpExc') + + class Module(object): + unittest.addModuleCleanup(module_cleanup_good, 1, 2, 3, + four='hello', five='goodbye') + unittest.addModuleCleanup(module_cleanup_bad) + self.assertEqual(unittest.case._module_cleanups, + [(module_cleanup_good, (1, 2, 3), + dict(four='hello', five='goodbye')), + (module_cleanup_bad, (), {})]) + with self.assertRaises(Exception) as e: + unittest.case.doModuleCleanups() + self.assertEqual(str(e.exception), 'CleanUpExc') + self.assertEqual(unittest.case._module_cleanups, []) + + def test_run_module_cleanUp(self): + blowUp = True + ordering = [] + class Module(object): + @staticmethod + def setUpModule(): + ordering.append('setUpModule') + unittest.addModuleCleanup(cleanup, ordering) + if blowUp: + raise Exception('setUpModule Exc') + @staticmethod + def tearDownModule(): + ordering.append('tearDownModule') + + class TestableTest(unittest.TestCase): + @classmethod + def setUpClass(cls): + ordering.append('setUpClass') + def testNothing(self): + ordering.append('test') + @classmethod + def tearDownClass(cls): + ordering.append('tearDownClass') + + TestableTest.__module__ = 'Module' + sys.modules['Module'] = Module + result = runTests(TestableTest) + self.assertEqual(ordering, ['setUpModule', 'cleanup_good']) + self.assertEqual(result.errors[0][1].splitlines()[-1], + 'Exception: setUpModule Exc') + + ordering = [] + blowUp = False + runTests(TestableTest) + self.assertEqual(ordering, + ['setUpModule', 'setUpClass', 'test', 'tearDownClass', + 'tearDownModule', 'cleanup_good']) + self.assertEqual(unittest.case._module_cleanups, []) + + def test_run_multiple_module_cleanUp(self): + blowUp = True + blowUp2 = False + ordering = [] + class Module1(object): + @staticmethod + def setUpModule(): + ordering.append('setUpModule') + unittest.addModuleCleanup(cleanup, ordering) + if blowUp: + raise Exception() + @staticmethod + def tearDownModule(): + ordering.append('tearDownModule') + + class Module2(object): + @staticmethod + def setUpModule(): + ordering.append('setUpModule2') + unittest.addModuleCleanup(cleanup, ordering) + if blowUp2: + raise Exception() + @staticmethod + def tearDownModule(): + ordering.append('tearDownModule2') + + class TestableTest(unittest.TestCase): + @classmethod + def setUpClass(cls): + ordering.append('setUpClass') + def testNothing(self): + ordering.append('test') + @classmethod + def tearDownClass(cls): + ordering.append('tearDownClass') + + class TestableTest2(unittest.TestCase): + @classmethod + def setUpClass(cls): + ordering.append('setUpClass2') + def testNothing(self): + ordering.append('test2') + @classmethod + def tearDownClass(cls): + ordering.append('tearDownClass2') + + TestableTest.__module__ = 'Module1' + sys.modules['Module1'] = Module1 + TestableTest2.__module__ = 'Module2' + sys.modules['Module2'] = Module2 + runTests(TestableTest, TestableTest2) + self.assertEqual(ordering, ['setUpModule', 'cleanup_good', + 'setUpModule2', 'setUpClass2', 'test2', + 'tearDownClass2', 'tearDownModule2', + 'cleanup_good']) + ordering = [] + blowUp = False + blowUp2 = True + runTests(TestableTest, TestableTest2) + self.assertEqual(ordering, ['setUpModule', 'setUpClass', 'test', + 'tearDownClass', 'tearDownModule', + 'cleanup_good', 'setUpModule2', + 'cleanup_good']) + + ordering = [] + blowUp = False + blowUp2 = False + runTests(TestableTest, TestableTest2) + self.assertEqual(ordering, + ['setUpModule', 'setUpClass', 'test', 'tearDownClass', + 'tearDownModule', 'cleanup_good', 'setUpModule2', + 'setUpClass2', 'test2', 'tearDownClass2', + 'tearDownModule2', 'cleanup_good']) + self.assertEqual(unittest.case._module_cleanups, []) + + def test_debug_module_executes_cleanUp(self): + ordering = [] + class Module(object): + @staticmethod + def setUpModule(): + ordering.append('setUpModule') + unittest.addModuleCleanup(cleanup, ordering) + @staticmethod + def tearDownModule(): + ordering.append('tearDownModule') + + class TestableTest(unittest.TestCase): + @classmethod + def setUpClass(cls): + ordering.append('setUpClass') + def testNothing(self): + ordering.append('test') + @classmethod + def tearDownClass(cls): + ordering.append('tearDownClass') + + TestableTest.__module__ = 'Module' + sys.modules['Module'] = Module + suite = unittest.defaultTestLoader.loadTestsFromTestCase(TestableTest) + suite.debug() + self.assertEqual(ordering, + ['setUpModule', 'setUpClass', 'test', 'tearDownClass', + 'tearDownModule', 'cleanup_good']) + self.assertEqual(unittest.case._module_cleanups, []) + + def test_with_errors_in_addClassCleanup(self): + ordering = [] + + class Module(object): + @staticmethod + def setUpModule(): + ordering.append('setUpModule') + unittest.addModuleCleanup(cleanup, ordering) + @staticmethod + def tearDownModule(): + ordering.append('tearDownModule') + + class TestableTest(unittest.TestCase): + @classmethod + def setUpClass(cls): + ordering.append('setUpClass') + cls.addClassCleanup(cleanup, ordering, blowUp=True) + def testNothing(self): + ordering.append('test') + @classmethod + def tearDownClass(cls): + ordering.append('tearDownClass') + + TestableTest.__module__ = 'Module' + sys.modules['Module'] = Module + + result = runTests(TestableTest) + self.assertEqual(result.errors[0][1].splitlines()[-1], + 'Exception: CleanUpExc') + self.assertEqual(ordering, + ['setUpModule', 'setUpClass', 'test', 'tearDownClass', + 'cleanup_exc', 'tearDownModule', 'cleanup_good']) + + def test_with_errors_in_addCleanup(self): + ordering = [] + class Module(object): + @staticmethod + def setUpModule(): + ordering.append('setUpModule') + unittest.addModuleCleanup(cleanup, ordering) + @staticmethod + def tearDownModule(): + ordering.append('tearDownModule') + + class TestableTest(unittest.TestCase): + def setUp(self): + ordering.append('setUp') + self.addCleanup(cleanup, ordering, blowUp=True) + def testNothing(self): + ordering.append('test') + def tearDown(self): + ordering.append('tearDown') + + TestableTest.__module__ = 'Module' + sys.modules['Module'] = Module + + result = runTests(TestableTest) + self.assertEqual(result.errors[0][1].splitlines()[-1], + 'Exception: CleanUpExc') + self.assertEqual(ordering, + ['setUpModule', 'setUp', 'test', 'tearDown', + 'cleanup_exc', 'tearDownModule', 'cleanup_good']) + + def test_with_errors_in_addModuleCleanup_and_setUps(self): + ordering = [] + module_blow_up = False + class_blow_up = False + method_blow_up = False + class Module(object): + @staticmethod + def setUpModule(): + ordering.append('setUpModule') + unittest.addModuleCleanup(cleanup, ordering, blowUp=True) + if module_blow_up: + raise Exception('ModuleExc') + @staticmethod + def tearDownModule(): + ordering.append('tearDownModule') + + class TestableTest(unittest.TestCase): + @classmethod + def setUpClass(cls): + ordering.append('setUpClass') + if class_blow_up: + raise Exception('ClassExc') + def setUp(self): + ordering.append('setUp') + if method_blow_up: + raise Exception('MethodExc') + def testNothing(self): + ordering.append('test') + @classmethod + def tearDownClass(cls): + ordering.append('tearDownClass') + + TestableTest.__module__ = 'Module' + sys.modules['Module'] = Module + + result = runTests(TestableTest) + self.assertEqual(result.errors[0][1].splitlines()[-1], + 'Exception: CleanUpExc') + self.assertEqual(ordering, + ['setUpModule', 'setUpClass', 'setUp', 'test', + 'tearDownClass', 'tearDownModule', + 'cleanup_exc']) + + ordering = [] + module_blow_up = True + class_blow_up = False + method_blow_up = False + result = runTests(TestableTest) + self.assertEqual(result.errors[0][1].splitlines()[-1], + 'Exception: CleanUpExc') + self.assertEqual(result.errors[1][1].splitlines()[-1], + 'Exception: ModuleExc') + self.assertEqual(ordering, ['setUpModule', 'cleanup_exc']) + + ordering = [] + module_blow_up = False + class_blow_up = True + method_blow_up = False + result = runTests(TestableTest) + self.assertEqual(result.errors[0][1].splitlines()[-1], + 'Exception: ClassExc') + self.assertEqual(result.errors[1][1].splitlines()[-1], + 'Exception: CleanUpExc') + self.assertEqual(ordering, ['setUpModule', 'setUpClass', + 'tearDownModule', 'cleanup_exc']) + + ordering = [] + module_blow_up = False + class_blow_up = False + method_blow_up = True + result = runTests(TestableTest) + self.assertEqual(result.errors[0][1].splitlines()[-1], + 'Exception: MethodExc') + self.assertEqual(result.errors[1][1].splitlines()[-1], + 'Exception: CleanUpExc') + self.assertEqual(ordering, ['setUpModule', 'setUpClass', 'setUp', + 'tearDownClass', 'tearDownModule', + 'cleanup_exc']) + + def test_module_cleanUp_with_multiple_classes(self): + ordering =[] + def cleanup1(): + ordering.append('cleanup1') + + def cleanup2(): + ordering.append('cleanup2') + + def cleanup3(): + ordering.append('cleanup3') + + class Module(object): + @staticmethod + def setUpModule(): + ordering.append('setUpModule') + unittest.addModuleCleanup(cleanup1) + @staticmethod + def tearDownModule(): + ordering.append('tearDownModule') + + class TestableTest(unittest.TestCase): + def setUp(self): + ordering.append('setUp') + self.addCleanup(cleanup2) + def testNothing(self): + ordering.append('test') + def tearDown(self): + ordering.append('tearDown') + + class OtherTestableTest(unittest.TestCase): + def setUp(self): + ordering.append('setUp2') + self.addCleanup(cleanup3) + def testNothing(self): + ordering.append('test2') + def tearDown(self): + ordering.append('tearDown2') + + TestableTest.__module__ = 'Module' + OtherTestableTest.__module__ = 'Module' + sys.modules['Module'] = Module + runTests(TestableTest, OtherTestableTest) + self.assertEqual(ordering, + ['setUpModule', 'setUp', 'test', 'tearDown', + 'cleanup2', 'setUp2', 'test2', 'tearDown2', + 'cleanup3', 'tearDownModule', 'cleanup1']) + + class Test_TextTestRunner(unittest.TestCase): """Tests for TextTestRunner.""" diff --git a/Misc/NEWS.d/next/Library/2018-09-11-10-51-16.bpo-24412.i-F_E5.rst b/Misc/NEWS.d/next/Library/2018-09-11-10-51-16.bpo-24412.i-F_E5.rst new file mode 100644 index 000000000000..862500dd19fb --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-09-11-10-51-16.bpo-24412.i-F_E5.rst @@ -0,0 +1,4 @@ +Add :func:`~unittest.addModuleCleanup()` and +:meth:`~unittest.TestCase.addClassCleanup()` to unittest to support +cleanups for :func:`~unittest.setUpModule()` and +:meth:`~unittest.TestCase.setUpClass()`. Patch by Lisa Roach. From webhook-mailer at python.org Fri Nov 9 02:12:11 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 09 Nov 2018 07:12:11 -0000 Subject: [Python-checkins] bpo-35194: Fix a wrong constant in cp932 codec (GH-10420) Message-ID: https://github.com/python/cpython/commit/7a69cf47a9bbc95f95fd67c982bff121b2a903cb commit: 7a69cf47a9bbc95f95fd67c982bff121b2a903cb branch: master author: Alexey Izbyshev committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-11-08T23:12:06-08:00 summary: bpo-35194: Fix a wrong constant in cp932 codec (GH-10420) This typo doesn't affect the result because wrong bits are discarded on implicit conversion to unsigned char, but it trips UBSan with -fsanitize=implicit-integer-truncation. https://bugs.python.org/issue35194 files: M Modules/cjkcodecs/_codecs_jp.c diff --git a/Modules/cjkcodecs/_codecs_jp.c b/Modules/cjkcodecs/_codecs_jp.c index 2c7788a64581..3a332953b957 100644 --- a/Modules/cjkcodecs/_codecs_jp.c +++ b/Modules/cjkcodecs/_codecs_jp.c @@ -40,7 +40,7 @@ ENCODER(cp932) if (c == 0xf8f0) OUTBYTE1(0xa0); else - OUTBYTE1(c - 0xfef1 + 0xfd); + OUTBYTE1(c - 0xf8f1 + 0xfd); NEXT(1, 1); continue; } From webhook-mailer at python.org Fri Nov 9 02:30:41 2018 From: webhook-mailer at python.org (Gregory P. Smith) Date: Fri, 09 Nov 2018 07:30:41 -0000 Subject: [Python-checkins] bpo-35193: Fix an off by one error in the RETURN_VALUE case. (GH-10418) (GH-10422) Message-ID: https://github.com/python/cpython/commit/65e1a1fd311943866361fcb288c0df65dadbe092 commit: 65e1a1fd311943866361fcb288c0df65dadbe092 branch: 3.6 author: Gregory P. Smith committer: GitHub date: 2018-11-08T23:30:36-08:00 summary: bpo-35193: Fix an off by one error in the RETURN_VALUE case. (GH-10418) (GH-10422) Fix an off by one error in the peephole optimizer when checking for unreachable code beyond a return. Do a bounds check within find_op so it can return before going past the end as a safety measure. https://github.com/python/cpython/commit/7db3c488335168993689ddae5914a28e16188447#diff-a33329ae6ae0bb295d742f0caf93c137 introduced this off by one error while fixing another one nearby. This bug was shipped in all Python 3.6 and 3.7 releases. The included unittest won't fail unless you do a clang msan build. (cherry picked from commit 49fa4a9f1ef387e16596f271414c855339eadf09) files: A Misc/NEWS.d/next/Core and Builtins/2018-11-08-23-00-04.bpo-35193.WK2PDg.rst M Lib/test/test_compile.py M Python/peephole.c diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index 745ce029aa57..13cc8821b082 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -1,3 +1,4 @@ +import dis import math import os import unittest @@ -628,6 +629,24 @@ def check_same_constant(const): self.check_constant(f1, frozenset({0})) self.assertTrue(f1(0)) + # This is a regression test for a CPython specific peephole optimizer + # implementation bug present in a few releases. It's assertion verifies + # that peephole optimization was actually done though that isn't an + # indication of the bugs presence or not (crashing is). + @support.cpython_only + def test_peephole_opt_unreachable_code_array_access_in_bounds(self): + """Regression test for issue35193 when run under clang msan.""" + def unused_code_at_end(): + return 3 + raise RuntimeError("unreachable") + # The above function definition will trigger the out of bounds + # bug in the peephole optimizer as it scans opcodes past the + # RETURN_VALUE opcode. This does not always crash an interpreter. + # When you build with the clang memory sanitizer it reliably aborts. + self.assertEqual( + 'RETURN_VALUE', + list(dis.get_instructions(unused_code_at_end))[-1].opname) + def test_dont_merge_constants(self): # Issue #25843: compile() must not merge constants which are equal # but have a different type. diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-11-08-23-00-04.bpo-35193.WK2PDg.rst b/Misc/NEWS.d/next/Core and Builtins/2018-11-08-23-00-04.bpo-35193.WK2PDg.rst new file mode 100644 index 000000000000..a6b3c64beab7 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-11-08-23-00-04.bpo-35193.WK2PDg.rst @@ -0,0 +1,3 @@ +Fix an off by one error in the bytecode peephole optimizer where it could +read bytes beyond the end of bounds of an array when removing unreachable +code. This bug was present in every release of Python 3.6 until now. diff --git a/Python/peephole.c b/Python/peephole.c index 31d4e92cfd33..3fa3b7fcee62 100644 --- a/Python/peephole.c +++ b/Python/peephole.c @@ -96,9 +96,9 @@ lastn_const_start(const _Py_CODEUNIT *codestr, Py_ssize_t i, Py_ssize_t n) /* Scans through EXTENDED ARGs, seeking the index of the effective opcode */ static Py_ssize_t -find_op(const _Py_CODEUNIT *codestr, Py_ssize_t i) +find_op(const _Py_CODEUNIT *codestr, Py_ssize_t codelen, Py_ssize_t i) { - while (_Py_OPCODE(codestr[i]) == EXTENDED_ARG) { + while (i < codelen && _Py_OPCODE(codestr[i]) == EXTENDED_ARG) { i++; } return i; @@ -590,7 +590,7 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names, CONST_STACK_CREATE(); - for (i=find_op(codestr, 0) ; i= 1 && _Py_OPCODE(codestr[op_start-1]) == EXTENDED_ARG) { @@ -755,7 +755,7 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names, case JUMP_IF_FALSE_OR_POP: case JUMP_IF_TRUE_OR_POP: h = get_arg(codestr, i) / sizeof(_Py_CODEUNIT); - tgt = find_op(codestr, h); + tgt = find_op(codestr, codelen, h); j = _Py_OPCODE(codestr[tgt]); if (CONDITIONAL_JUMP(j)) { @@ -796,7 +796,7 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names, case SETUP_WITH: case SETUP_ASYNC_WITH: h = GETJUMPTGT(codestr, i); - tgt = find_op(codestr, h); + tgt = find_op(codestr, codelen, h); /* Replace JUMP_* to a RETURN into just a RETURN */ if (UNCONDITIONAL_JUMP(opcode) && _Py_OPCODE(codestr[tgt]) == RETURN_VALUE) { @@ -825,7 +825,7 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names, } if (h > i + 1) { fill_nops(codestr, i + 1, h); - nexti = find_op(codestr, h); + nexti = find_op(codestr, codelen, h); } break; } From webhook-mailer at python.org Fri Nov 9 02:33:14 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 09 Nov 2018 07:33:14 -0000 Subject: [Python-checkins] bpo-35194: Fix a wrong constant in cp932 codec (GH-10420) Message-ID: https://github.com/python/cpython/commit/49ee41f1c3934aa095e32fa751cdf3ba641ae34b commit: 49ee41f1c3934aa095e32fa751cdf3ba641ae34b branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-08T23:33:10-08:00 summary: bpo-35194: Fix a wrong constant in cp932 codec (GH-10420) This typo doesn't affect the result because wrong bits are discarded on implicit conversion to unsigned char, but it trips UBSan with -fsanitize=implicit-integer-truncation. https://bugs.python.org/issue35194 (cherry picked from commit 7a69cf47a9bbc95f95fd67c982bff121b2a903cb) Co-authored-by: Alexey Izbyshev files: M Modules/cjkcodecs/_codecs_jp.c diff --git a/Modules/cjkcodecs/_codecs_jp.c b/Modules/cjkcodecs/_codecs_jp.c index 2c7788a64581..3a332953b957 100644 --- a/Modules/cjkcodecs/_codecs_jp.c +++ b/Modules/cjkcodecs/_codecs_jp.c @@ -40,7 +40,7 @@ ENCODER(cp932) if (c == 0xf8f0) OUTBYTE1(0xa0); else - OUTBYTE1(c - 0xfef1 + 0xfd); + OUTBYTE1(c - 0xf8f1 + 0xfd); NEXT(1, 1); continue; } From webhook-mailer at python.org Fri Nov 9 02:35:09 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 09 Nov 2018 07:35:09 -0000 Subject: [Python-checkins] bpo-35194: Fix a wrong constant in cp932 codec (GH-10420) Message-ID: https://github.com/python/cpython/commit/22234f1375d28803074405497ea61315fb37240d commit: 22234f1375d28803074405497ea61315fb37240d branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-08T23:35:05-08:00 summary: bpo-35194: Fix a wrong constant in cp932 codec (GH-10420) This typo doesn't affect the result because wrong bits are discarded on implicit conversion to unsigned char, but it trips UBSan with -fsanitize=implicit-integer-truncation. https://bugs.python.org/issue35194 (cherry picked from commit 7a69cf47a9bbc95f95fd67c982bff121b2a903cb) Co-authored-by: Alexey Izbyshev files: M Modules/cjkcodecs/_codecs_jp.c diff --git a/Modules/cjkcodecs/_codecs_jp.c b/Modules/cjkcodecs/_codecs_jp.c index 2c7788a64581..3a332953b957 100644 --- a/Modules/cjkcodecs/_codecs_jp.c +++ b/Modules/cjkcodecs/_codecs_jp.c @@ -40,7 +40,7 @@ ENCODER(cp932) if (c == 0xf8f0) OUTBYTE1(0xa0); else - OUTBYTE1(c - 0xfef1 + 0xfd); + OUTBYTE1(c - 0xf8f1 + 0xfd); NEXT(1, 1); continue; } From webhook-mailer at python.org Fri Nov 9 04:06:10 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 09 Nov 2018 09:06:10 -0000 Subject: [Python-checkins] Fixing wording in comment. (GH-10425) Message-ID: https://github.com/python/cpython/commit/216aaaa0564951f2ca408e2086ba60d849d52902 commit: 216aaaa0564951f2ca408e2086ba60d849d52902 branch: master author: Raymond Hettinger committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-11-09T01:06:02-08:00 summary: Fixing wording in comment. (GH-10425) Since the n==1 case just returns *max*, it cannot be larger than the magnitude of the vector entry. files: M Modules/mathmodule.c diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c index e956314e27fc..b83befbd3194 100644 --- a/Modules/mathmodule.c +++ b/Modules/mathmodule.c @@ -2043,7 +2043,7 @@ Given an *n* length *vec* of values and a value *max*, compute: max * sqrt(sum((x / max) ** 2 for x in vec)) The value of the *max* variable must be non-negative and -at least equal to the absolute value of the largest magnitude +equal to the absolute value of the largest magnitude entry in the vector. If n==0, then *max* should be 0.0. If an infinity is present in the vec, *max* should be INF. From solipsis at pitrou.net Fri Nov 9 04:07:50 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Fri, 09 Nov 2018 09:07:50 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=11 Message-ID: <20181109090750.1.F0EA392F419087DE@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [0, 0, 7] memory blocks, sum=7 test_functools leaked [0, 3, 1] memory blocks, sum=4 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogGkGXJV', '--timeout', '7200'] From webhook-mailer at python.org Fri Nov 9 04:19:39 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 09 Nov 2018 09:19:39 -0000 Subject: [Python-checkins] Cleanup and improve the regex tokenizer example. (GH-10426) Message-ID: https://github.com/python/cpython/commit/b83942c755a78f6d917743b73ed87a8fd9f367de commit: b83942c755a78f6d917743b73ed87a8fd9f367de branch: master author: Raymond Hettinger committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-11-09T01:19:33-08:00 summary: Cleanup and improve the regex tokenizer example. (GH-10426) 1) Convert weird field name "typ" to the more standard "type". 2) For the NUMBER type, convert the value to an int() or float(). 3) Simplify ``group(kind)`` to the shorter and faster ``group()`` call. 4) Simplify logic go a single if-elif chain to make this easier to extend. 5) Reorder the tests to match the order the tokens are specified. This isn't necessary for correctness but does make the example easier to follow. 6) Move the "column" calculation before the if-elif chain so that users have the option of using this value in error messages. files: M Doc/library/re.rst diff --git a/Doc/library/re.rst b/Doc/library/re.rst index 31fb628dcaea..2f829559ff17 100644 --- a/Doc/library/re.rst +++ b/Doc/library/re.rst @@ -1609,38 +1609,40 @@ successive matches:: import collections import re - Token = collections.namedtuple('Token', ['typ', 'value', 'line', 'column']) + Token = collections.namedtuple('Token', ['type', 'value', 'line', 'column']) def tokenize(code): keywords = {'IF', 'THEN', 'ENDIF', 'FOR', 'NEXT', 'GOSUB', 'RETURN'} token_specification = [ - ('NUMBER', r'\d+(\.\d*)?'), # Integer or decimal number - ('ASSIGN', r':='), # Assignment operator - ('END', r';'), # Statement terminator - ('ID', r'[A-Za-z]+'), # Identifiers - ('OP', r'[+\-*/]'), # Arithmetic operators - ('NEWLINE', r'\n'), # Line endings - ('SKIP', r'[ \t]+'), # Skip over spaces and tabs - ('MISMATCH',r'.'), # Any other character + ('NUMBER', r'\d+(\.\d*)?'), # Integer or decimal number + ('ASSIGN', r':='), # Assignment operator + ('END', r';'), # Statement terminator + ('ID', r'[A-Za-z]+'), # Identifiers + ('OP', r'[+\-*/]'), # Arithmetic operators + ('NEWLINE', r'\n'), # Line endings + ('SKIP', r'[ \t]+'), # Skip over spaces and tabs + ('MISMATCH', r'.'), # Any other character ] tok_regex = '|'.join('(?P<%s>%s)' % pair for pair in token_specification) line_num = 1 line_start = 0 for mo in re.finditer(tok_regex, code): kind = mo.lastgroup - value = mo.group(kind) - if kind == 'NEWLINE': + value = mo.group() + column = mo.start() - line_start + if kind == 'NUMBER': + value = float(value) if '.' in value else int(value) + elif kind == 'ID' and value in keywords: + kind = value + elif kind == 'NEWLINE': line_start = mo.end() line_num += 1 + continue elif kind == 'SKIP': - pass + continue elif kind == 'MISMATCH': raise RuntimeError(f'{value!r} unexpected on line {line_num}') - else: - if kind == 'ID' and value in keywords: - kind = value - column = mo.start() - line_start - yield Token(kind, value, line_num, column) + yield Token(kind, value, line_num, column) statements = ''' IF quantity THEN @@ -1654,25 +1656,25 @@ successive matches:: The tokenizer produces the following output:: - Token(typ='IF', value='IF', line=2, column=4) - Token(typ='ID', value='quantity', line=2, column=7) - Token(typ='THEN', value='THEN', line=2, column=16) - Token(typ='ID', value='total', line=3, column=8) - Token(typ='ASSIGN', value=':=', line=3, column=14) - Token(typ='ID', value='total', line=3, column=17) - Token(typ='OP', value='+', line=3, column=23) - Token(typ='ID', value='price', line=3, column=25) - Token(typ='OP', value='*', line=3, column=31) - Token(typ='ID', value='quantity', line=3, column=33) - Token(typ='END', value=';', line=3, column=41) - Token(typ='ID', value='tax', line=4, column=8) - Token(typ='ASSIGN', value=':=', line=4, column=12) - Token(typ='ID', value='price', line=4, column=15) - Token(typ='OP', value='*', line=4, column=21) - Token(typ='NUMBER', value='0.05', line=4, column=23) - Token(typ='END', value=';', line=4, column=27) - Token(typ='ENDIF', value='ENDIF', line=5, column=4) - Token(typ='END', value=';', line=5, column=9) + Token(type='IF', value='IF', line=2, column=4) + Token(type='ID', value='quantity', line=2, column=7) + Token(type='THEN', value='THEN', line=2, column=16) + Token(type='ID', value='total', line=3, column=8) + Token(type='ASSIGN', value=':=', line=3, column=14) + Token(type='ID', value='total', line=3, column=17) + Token(type='OP', value='+', line=3, column=23) + Token(type='ID', value='price', line=3, column=25) + Token(type='OP', value='*', line=3, column=31) + Token(type='ID', value='quantity', line=3, column=33) + Token(type='END', value=';', line=3, column=41) + Token(type='ID', value='tax', line=4, column=8) + Token(type='ASSIGN', value=':=', line=4, column=12) + Token(type='ID', value='price', line=4, column=15) + Token(type='OP', value='*', line=4, column=21) + Token(type='NUMBER', value=0.05, line=4, column=23) + Token(type='END', value=';', line=4, column=27) + Token(type='ENDIF', value='ENDIF', line=5, column=4) + Token(type='END', value=';', line=5, column=9) .. [Frie09] Friedl, Jeffrey. Mastering Regular Expressions. 3rd ed., O'Reilly From webhook-mailer at python.org Fri Nov 9 04:27:00 2018 From: webhook-mailer at python.org (Raymond Hettinger) Date: Fri, 09 Nov 2018 09:27:00 -0000 Subject: [Python-checkins] Cleanup and improve the regex tokenizer example. (GH-10426) (#10427) Message-ID: https://github.com/python/cpython/commit/33fd60d4c3fd95ef1c8edf83bd4a3c203edc1cad commit: 33fd60d4c3fd95ef1c8edf83bd4a3c203edc1cad branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Raymond Hettinger date: 2018-11-09T01:26:55-08:00 summary: Cleanup and improve the regex tokenizer example. (GH-10426) (#10427) 1) Convert weird field name "typ" to the more standard "type". 2) For the NUMBER type, convert the value to an int() or float(). 3) Simplify ``group(kind)`` to the shorter and faster ``group()`` call. 4) Simplify logic go a single if-elif chain to make this easier to extend. 5) Reorder the tests to match the order the tokens are specified. This isn't necessary for correctness but does make the example easier to follow. 6) Move the "column" calculation before the if-elif chain so that users have the option of using this value in error messages. (cherry picked from commit b83942c755a78f6d917743b73ed87a8fd9f367de) Co-authored-by: Raymond Hettinger files: M Doc/library/re.rst diff --git a/Doc/library/re.rst b/Doc/library/re.rst index 6cd7ebc89734..e6455bb359df 100644 --- a/Doc/library/re.rst +++ b/Doc/library/re.rst @@ -1607,38 +1607,40 @@ successive matches:: import collections import re - Token = collections.namedtuple('Token', ['typ', 'value', 'line', 'column']) + Token = collections.namedtuple('Token', ['type', 'value', 'line', 'column']) def tokenize(code): keywords = {'IF', 'THEN', 'ENDIF', 'FOR', 'NEXT', 'GOSUB', 'RETURN'} token_specification = [ - ('NUMBER', r'\d+(\.\d*)?'), # Integer or decimal number - ('ASSIGN', r':='), # Assignment operator - ('END', r';'), # Statement terminator - ('ID', r'[A-Za-z]+'), # Identifiers - ('OP', r'[+\-*/]'), # Arithmetic operators - ('NEWLINE', r'\n'), # Line endings - ('SKIP', r'[ \t]+'), # Skip over spaces and tabs - ('MISMATCH',r'.'), # Any other character + ('NUMBER', r'\d+(\.\d*)?'), # Integer or decimal number + ('ASSIGN', r':='), # Assignment operator + ('END', r';'), # Statement terminator + ('ID', r'[A-Za-z]+'), # Identifiers + ('OP', r'[+\-*/]'), # Arithmetic operators + ('NEWLINE', r'\n'), # Line endings + ('SKIP', r'[ \t]+'), # Skip over spaces and tabs + ('MISMATCH', r'.'), # Any other character ] tok_regex = '|'.join('(?P<%s>%s)' % pair for pair in token_specification) line_num = 1 line_start = 0 for mo in re.finditer(tok_regex, code): kind = mo.lastgroup - value = mo.group(kind) - if kind == 'NEWLINE': + value = mo.group() + column = mo.start() - line_start + if kind == 'NUMBER': + value = float(value) if '.' in value else int(value) + elif kind == 'ID' and value in keywords: + kind = value + elif kind == 'NEWLINE': line_start = mo.end() line_num += 1 + continue elif kind == 'SKIP': - pass + continue elif kind == 'MISMATCH': raise RuntimeError(f'{value!r} unexpected on line {line_num}') - else: - if kind == 'ID' and value in keywords: - kind = value - column = mo.start() - line_start - yield Token(kind, value, line_num, column) + yield Token(kind, value, line_num, column) statements = ''' IF quantity THEN @@ -1652,25 +1654,25 @@ successive matches:: The tokenizer produces the following output:: - Token(typ='IF', value='IF', line=2, column=4) - Token(typ='ID', value='quantity', line=2, column=7) - Token(typ='THEN', value='THEN', line=2, column=16) - Token(typ='ID', value='total', line=3, column=8) - Token(typ='ASSIGN', value=':=', line=3, column=14) - Token(typ='ID', value='total', line=3, column=17) - Token(typ='OP', value='+', line=3, column=23) - Token(typ='ID', value='price', line=3, column=25) - Token(typ='OP', value='*', line=3, column=31) - Token(typ='ID', value='quantity', line=3, column=33) - Token(typ='END', value=';', line=3, column=41) - Token(typ='ID', value='tax', line=4, column=8) - Token(typ='ASSIGN', value=':=', line=4, column=12) - Token(typ='ID', value='price', line=4, column=15) - Token(typ='OP', value='*', line=4, column=21) - Token(typ='NUMBER', value='0.05', line=4, column=23) - Token(typ='END', value=';', line=4, column=27) - Token(typ='ENDIF', value='ENDIF', line=5, column=4) - Token(typ='END', value=';', line=5, column=9) + Token(type='IF', value='IF', line=2, column=4) + Token(type='ID', value='quantity', line=2, column=7) + Token(type='THEN', value='THEN', line=2, column=16) + Token(type='ID', value='total', line=3, column=8) + Token(type='ASSIGN', value=':=', line=3, column=14) + Token(type='ID', value='total', line=3, column=17) + Token(type='OP', value='+', line=3, column=23) + Token(type='ID', value='price', line=3, column=25) + Token(type='OP', value='*', line=3, column=31) + Token(type='ID', value='quantity', line=3, column=33) + Token(type='END', value=';', line=3, column=41) + Token(type='ID', value='tax', line=4, column=8) + Token(type='ASSIGN', value=':=', line=4, column=12) + Token(type='ID', value='price', line=4, column=15) + Token(type='OP', value='*', line=4, column=21) + Token(type='NUMBER', value=0.05, line=4, column=23) + Token(type='END', value=';', line=4, column=27) + Token(type='ENDIF', value='ENDIF', line=5, column=4) + Token(type='END', value=';', line=5, column=9) .. [Frie09] Friedl, Jeffrey. Mastering Regular Expressions. 3rd ed., O'Reilly From webhook-mailer at python.org Fri Nov 9 04:27:14 2018 From: webhook-mailer at python.org (Raymond Hettinger) Date: Fri, 09 Nov 2018 09:27:14 -0000 Subject: [Python-checkins] Cleanup and improve the regex tokenizer example. (GH-10426) (#10428) Message-ID: https://github.com/python/cpython/commit/bde5181bd3f424c3355cfa504a722f6b55d3b8de commit: bde5181bd3f424c3355cfa504a722f6b55d3b8de branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Raymond Hettinger date: 2018-11-09T01:27:10-08:00 summary: Cleanup and improve the regex tokenizer example. (GH-10426) (#10428) 1) Convert weird field name "typ" to the more standard "type". 2) For the NUMBER type, convert the value to an int() or float(). 3) Simplify ``group(kind)`` to the shorter and faster ``group()`` call. 4) Simplify logic go a single if-elif chain to make this easier to extend. 5) Reorder the tests to match the order the tokens are specified. This isn't necessary for correctness but does make the example easier to follow. 6) Move the "column" calculation before the if-elif chain so that users have the option of using this value in error messages. (cherry picked from commit b83942c755a78f6d917743b73ed87a8fd9f367de) Co-authored-by: Raymond Hettinger files: M Doc/library/re.rst diff --git a/Doc/library/re.rst b/Doc/library/re.rst index 97d83f5518cb..89d36a9fe4f6 100644 --- a/Doc/library/re.rst +++ b/Doc/library/re.rst @@ -1581,38 +1581,40 @@ successive matches:: import collections import re - Token = collections.namedtuple('Token', ['typ', 'value', 'line', 'column']) + Token = collections.namedtuple('Token', ['type', 'value', 'line', 'column']) def tokenize(code): keywords = {'IF', 'THEN', 'ENDIF', 'FOR', 'NEXT', 'GOSUB', 'RETURN'} token_specification = [ - ('NUMBER', r'\d+(\.\d*)?'), # Integer or decimal number - ('ASSIGN', r':='), # Assignment operator - ('END', r';'), # Statement terminator - ('ID', r'[A-Za-z]+'), # Identifiers - ('OP', r'[+\-*/]'), # Arithmetic operators - ('NEWLINE', r'\n'), # Line endings - ('SKIP', r'[ \t]+'), # Skip over spaces and tabs - ('MISMATCH',r'.'), # Any other character + ('NUMBER', r'\d+(\.\d*)?'), # Integer or decimal number + ('ASSIGN', r':='), # Assignment operator + ('END', r';'), # Statement terminator + ('ID', r'[A-Za-z]+'), # Identifiers + ('OP', r'[+\-*/]'), # Arithmetic operators + ('NEWLINE', r'\n'), # Line endings + ('SKIP', r'[ \t]+'), # Skip over spaces and tabs + ('MISMATCH', r'.'), # Any other character ] tok_regex = '|'.join('(?P<%s>%s)' % pair for pair in token_specification) line_num = 1 line_start = 0 for mo in re.finditer(tok_regex, code): kind = mo.lastgroup - value = mo.group(kind) - if kind == 'NEWLINE': + value = mo.group() + column = mo.start() - line_start + if kind == 'NUMBER': + value = float(value) if '.' in value else int(value) + elif kind == 'ID' and value in keywords: + kind = value + elif kind == 'NEWLINE': line_start = mo.end() line_num += 1 + continue elif kind == 'SKIP': - pass + continue elif kind == 'MISMATCH': raise RuntimeError(f'{value!r} unexpected on line {line_num}') - else: - if kind == 'ID' and value in keywords: - kind = value - column = mo.start() - line_start - yield Token(kind, value, line_num, column) + yield Token(kind, value, line_num, column) statements = ''' IF quantity THEN @@ -1626,25 +1628,25 @@ successive matches:: The tokenizer produces the following output:: - Token(typ='IF', value='IF', line=2, column=4) - Token(typ='ID', value='quantity', line=2, column=7) - Token(typ='THEN', value='THEN', line=2, column=16) - Token(typ='ID', value='total', line=3, column=8) - Token(typ='ASSIGN', value=':=', line=3, column=14) - Token(typ='ID', value='total', line=3, column=17) - Token(typ='OP', value='+', line=3, column=23) - Token(typ='ID', value='price', line=3, column=25) - Token(typ='OP', value='*', line=3, column=31) - Token(typ='ID', value='quantity', line=3, column=33) - Token(typ='END', value=';', line=3, column=41) - Token(typ='ID', value='tax', line=4, column=8) - Token(typ='ASSIGN', value=':=', line=4, column=12) - Token(typ='ID', value='price', line=4, column=15) - Token(typ='OP', value='*', line=4, column=21) - Token(typ='NUMBER', value='0.05', line=4, column=23) - Token(typ='END', value=';', line=4, column=27) - Token(typ='ENDIF', value='ENDIF', line=5, column=4) - Token(typ='END', value=';', line=5, column=9) + Token(type='IF', value='IF', line=2, column=4) + Token(type='ID', value='quantity', line=2, column=7) + Token(type='THEN', value='THEN', line=2, column=16) + Token(type='ID', value='total', line=3, column=8) + Token(type='ASSIGN', value=':=', line=3, column=14) + Token(type='ID', value='total', line=3, column=17) + Token(type='OP', value='+', line=3, column=23) + Token(type='ID', value='price', line=3, column=25) + Token(type='OP', value='*', line=3, column=31) + Token(type='ID', value='quantity', line=3, column=33) + Token(type='END', value=';', line=3, column=41) + Token(type='ID', value='tax', line=4, column=8) + Token(type='ASSIGN', value=':=', line=4, column=12) + Token(type='ID', value='price', line=4, column=15) + Token(type='OP', value='*', line=4, column=21) + Token(type='NUMBER', value=0.05, line=4, column=23) + Token(type='END', value=';', line=4, column=27) + Token(type='ENDIF', value='ENDIF', line=5, column=4) + Token(type='END', value=';', line=5, column=9) .. [Frie09] Friedl, Jeffrey. Mastering Regular Expressions. 3rd ed., O'Reilly From webhook-mailer at python.org Fri Nov 9 05:32:03 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 09 Nov 2018 10:32:03 -0000 Subject: [Python-checkins] Optimize set.pop() to advance a pointer instead of indexing. (GH-10429) Message-ID: https://github.com/python/cpython/commit/cf5863faabe011a61827b9b9982dba3d6a381f0f commit: cf5863faabe011a61827b9b9982dba3d6a381f0f branch: master author: Raymond Hettinger committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-11-09T02:31:56-08:00 summary: Optimize set.pop() to advance a pointer instead of indexing. (GH-10429) Gives approx 20% speed-up using clang depending on the number of elements in the set (the less dense the set, the more the speed-up). Uses the same entry++ logic used elsewhere in the setobject.c code. files: M Objects/setobject.c diff --git a/Objects/setobject.c b/Objects/setobject.c index 42fe80fc0503..ce5092195975 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -701,8 +701,7 @@ static PyObject * set_pop(PySetObject *so, PyObject *Py_UNUSED(ignored)) { /* Make sure the search finger is in bounds */ - Py_ssize_t i = so->finger & so->mask; - setentry *entry; + setentry *entry, *limit; PyObject *key; assert (PyAnySet_Check(so)); @@ -711,16 +710,18 @@ set_pop(PySetObject *so, PyObject *Py_UNUSED(ignored)) return NULL; } - while ((entry = &so->table[i])->key == NULL || entry->key==dummy) { - i++; - if (i > so->mask) - i = 0; + entry = so->table + (so->finger & so->mask); + limit = so->table + so->mask; + while (entry->key == NULL || entry->key==dummy) { + entry++; + if (entry > limit) + entry = so->table; } key = entry->key; entry->key = dummy; entry->hash = -1; so->used--; - so->finger = i + 1; /* next place to start */ + so->finger = entry - so->table + 1; /* next place to start */ return key; } From webhook-mailer at python.org Fri Nov 9 05:39:58 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 09 Nov 2018 10:39:58 -0000 Subject: [Python-checkins] Hoist the float conversion out of the inner loop. (GH-10430) Message-ID: https://github.com/python/cpython/commit/0a18e0510a145427d8ff1864a011c81ea02cdcd4 commit: 0a18e0510a145427d8ff1864a011c81ea02cdcd4 branch: master author: Raymond Hettinger committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-11-09T02:39:50-08:00 summary: Hoist the float conversion out of the inner loop. (GH-10430) Currently, the *n* and *total* variables get converted to floats each time they are multiplied by random(). This minor tweak does the conversion just once and gets a small speedup (approx 3%). files: M Lib/random.py diff --git a/Lib/random.py b/Lib/random.py index b2c0d6fcc3b8..4b51b6696bfc 100644 --- a/Lib/random.py +++ b/Lib/random.py @@ -375,6 +375,7 @@ def choices(self, population, weights=None, *, cum_weights=None, k=1): if cum_weights is None: if weights is None: _int = int + n += 0.0 # convert to float for a small speed improvement return [population[_int(random() * n)] for i in range(k)] cum_weights = list(_itertools.accumulate(weights)) elif weights is not None: @@ -382,7 +383,7 @@ def choices(self, population, weights=None, *, cum_weights=None, k=1): if len(cum_weights) != n: raise ValueError('The number of weights does not match the population') bisect = _bisect.bisect - total = cum_weights[-1] + total = cum_weights[-1] + 0.0 # convert to float hi = n - 1 return [population[bisect(cum_weights, random() * total, 0, hi)] for i in range(k)] From webhook-mailer at python.org Fri Nov 9 07:03:42 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 09 Nov 2018 12:03:42 -0000 Subject: [Python-checkins] bpo-35081: Internal headers require Py_BUILD_CORE (GH-10363) Message-ID: https://github.com/python/cpython/commit/130893debfd97c70e3a89d9ba49892f53e6b9d79 commit: 130893debfd97c70e3a89d9ba49892f53e6b9d79 branch: master author: Victor Stinner committer: GitHub date: 2018-11-09T13:03:37+01:00 summary: bpo-35081: Internal headers require Py_BUILD_CORE (GH-10363) * All internal header files now require Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN to be defined. * _json.c is now compiled with Py_BUILD_CORE_BUILTIN to access pycore_accu.h header. * Add an example to Modules/Setup to show how to build _json as a built-in module; it requires non trivial compiler options. files: M Include/internal/pycore_accu.h M Include/internal/pycore_atomic.h M Include/internal/pycore_ceval.h M Include/internal/pycore_condvar.h M Include/internal/pycore_context.h M Include/internal/pycore_getopt.h M Include/internal/pycore_gil.h M Include/internal/pycore_hamt.h M Include/internal/pycore_hash.h M Include/internal/pycore_lifecycle.h M Include/internal/pycore_mem.h M Include/internal/pycore_pathconfig.h M Include/internal/pycore_state.h M Include/internal/pycore_warnings.h M Modules/Setup M setup.py diff --git a/Include/internal/pycore_accu.h b/Include/internal/pycore_accu.h index ab1aad280346..4350db58a269 100644 --- a/Include/internal/pycore_accu.h +++ b/Include/internal/pycore_accu.h @@ -9,6 +9,10 @@ extern "C" { *** Its definition may be changed or removed at any moment. ***/ +#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN) +# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN define" +#endif + /* * A two-level accumulator of unicode objects that avoids both the overhead * of keeping a huge number of small separate objects, and the quadratic diff --git a/Include/internal/pycore_atomic.h b/Include/internal/pycore_atomic.h index 5f349cc3e9e9..f430a5c26ff8 100644 --- a/Include/internal/pycore_atomic.h +++ b/Include/internal/pycore_atomic.h @@ -4,8 +4,8 @@ extern "C" { #endif -#ifndef Py_BUILD_CORE -# error "Py_BUILD_CORE must be defined to include this header" +#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN) +# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN define" #endif #include "dynamic_annotations.h" diff --git a/Include/internal/pycore_ceval.h b/Include/internal/pycore_ceval.h index ddeeb5c4256f..c8c63b1c7fda 100644 --- a/Include/internal/pycore_ceval.h +++ b/Include/internal/pycore_ceval.h @@ -4,6 +4,10 @@ extern "C" { #endif +#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN) +# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN define" +#endif + #include "pycore_atomic.h" #include "pythread.h" diff --git a/Include/internal/pycore_condvar.h b/Include/internal/pycore_condvar.h index f9330890d3e6..a12b6994ad55 100644 --- a/Include/internal/pycore_condvar.h +++ b/Include/internal/pycore_condvar.h @@ -1,6 +1,10 @@ #ifndef Py_INTERNAL_CONDVAR_H #define Py_INTERNAL_CONDVAR_H +#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN) +# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN define" +#endif + #ifndef _POSIX_THREADS /* This means pthreads are not implemented in libc headers, hence the macro not present in unistd.h. But they still can be implemented as an external diff --git a/Include/internal/pycore_context.h b/Include/internal/pycore_context.h index 57a410c06f68..70701cdd11dc 100644 --- a/Include/internal/pycore_context.h +++ b/Include/internal/pycore_context.h @@ -1,10 +1,12 @@ #ifndef Py_INTERNAL_CONTEXT_H #define Py_INTERNAL_CONTEXT_H +#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN) +# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN define" +#endif #include "pycore_hamt.h" - struct _pycontextobject { PyObject_HEAD PyContext *ctx_prev; @@ -37,5 +39,4 @@ struct _pycontexttokenobject { int _PyContext_Init(void); void _PyContext_Fini(void); - #endif /* !Py_INTERNAL_CONTEXT_H */ diff --git a/Include/internal/pycore_getopt.h b/Include/internal/pycore_getopt.h index 8ef2ada72fee..e6f4654a666b 100644 --- a/Include/internal/pycore_getopt.h +++ b/Include/internal/pycore_getopt.h @@ -1,6 +1,10 @@ #ifndef Py_INTERNAL_PYGETOPT_H #define Py_INTERNAL_PYGETOPT_H +#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN) +# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN define" +#endif + extern int _PyOS_opterr; extern int _PyOS_optind; extern wchar_t *_PyOS_optarg; diff --git a/Include/internal/pycore_gil.h b/Include/internal/pycore_gil.h index 5059850d76f8..014e75fd182f 100644 --- a/Include/internal/pycore_gil.h +++ b/Include/internal/pycore_gil.h @@ -4,6 +4,10 @@ extern "C" { #endif +#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN) +# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN define" +#endif + #include "pycore_condvar.h" #include "pycore_atomic.h" diff --git a/Include/internal/pycore_hamt.h b/Include/internal/pycore_hamt.h index 29ad28b1d870..8b2ce1fc96c3 100644 --- a/Include/internal/pycore_hamt.h +++ b/Include/internal/pycore_hamt.h @@ -1,6 +1,9 @@ #ifndef Py_INTERNAL_HAMT_H #define Py_INTERNAL_HAMT_H +#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN) +# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN define" +#endif #define _Py_HAMT_MAX_TREE_DEPTH 7 diff --git a/Include/internal/pycore_hash.h b/Include/internal/pycore_hash.h index e14b80a7f27f..babbc95b879e 100644 --- a/Include/internal/pycore_hash.h +++ b/Include/internal/pycore_hash.h @@ -1,6 +1,10 @@ #ifndef Py_INTERNAL_HASH_H #define Py_INTERNAL_HASH_H +#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN) +# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN define" +#endif + uint64_t _Py_KeyedHash(uint64_t, const char *, Py_ssize_t); #endif diff --git a/Include/internal/pycore_lifecycle.h b/Include/internal/pycore_lifecycle.h index cf36440eabcf..e10431690cbd 100644 --- a/Include/internal/pycore_lifecycle.h +++ b/Include/internal/pycore_lifecycle.h @@ -4,8 +4,8 @@ extern "C" { #endif -#ifndef Py_BUILD_CORE -# error "Py_BUILD_CORE must be defined to include this header" +#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN) +# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN define" #endif PyAPI_FUNC(int) _Py_UnixMain(int argc, char **argv); diff --git a/Include/internal/pycore_mem.h b/Include/internal/pycore_mem.h index 4a41b77734ac..247426afe722 100644 --- a/Include/internal/pycore_mem.h +++ b/Include/internal/pycore_mem.h @@ -4,8 +4,8 @@ extern "C" { #endif -#ifndef Py_BUILD_CORE -# error "Py_BUILD_CORE must be defined to include this header" +#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN) +# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN defined" #endif #include "objimpl.h" diff --git a/Include/internal/pycore_pathconfig.h b/Include/internal/pycore_pathconfig.h index 00d7bbf23ea4..267e690976da 100644 --- a/Include/internal/pycore_pathconfig.h +++ b/Include/internal/pycore_pathconfig.h @@ -4,8 +4,8 @@ extern "C" { #endif -#ifndef Py_BUILD_CORE -# error "Py_BUILD_CORE must be defined to include this header" +#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN) +# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN define" #endif PyAPI_FUNC(void) _Py_wstrlist_clear( diff --git a/Include/internal/pycore_state.h b/Include/internal/pycore_state.h index 6285ecf5f5dc..01f214045c50 100644 --- a/Include/internal/pycore_state.h +++ b/Include/internal/pycore_state.h @@ -4,8 +4,8 @@ extern "C" { #endif -#ifndef Py_BUILD_CORE -# error "Py_BUILD_CORE must be defined to include this header" +#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN) +# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN define" #endif #include "pystate.h" diff --git a/Include/internal/pycore_warnings.h b/Include/internal/pycore_warnings.h index 2878a28a2ee8..91bf90232f5c 100644 --- a/Include/internal/pycore_warnings.h +++ b/Include/internal/pycore_warnings.h @@ -4,6 +4,10 @@ extern "C" { #endif +#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN) +# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN define" +#endif + #include "object.h" struct _warnings_runtime_state { diff --git a/Modules/Setup b/Modules/Setup index e2b5f86f38e0..e7b939d55182 100644 --- a/Modules/Setup +++ b/Modules/Setup @@ -180,6 +180,7 @@ _symtable symtablemodule.c #_bisect _bisectmodule.c # Bisection algorithms #_heapq _heapqmodule.c # Heap queue algorithm #_asyncio _asynciomodule.c # Fast asyncio Future +#_json -I$(srcdir)/Include/internal -DPy_BUILD_CORE_BUILTIN _json.c # _json speedups #unicodedata unicodedata.c # static Unicode character database diff --git a/setup.py b/setup.py index 37c5dd58a6d2..b87d05d2143f 100644 --- a/setup.py +++ b/setup.py @@ -678,7 +678,9 @@ def detect_modules(self): # atexit exts.append( Extension("atexit", ["atexitmodule.c"]) ) # _json speedups - exts.append( Extension("_json", ["_json.c"]) ) + exts.append( Extension("_json", ["_json.c"], + # pycore_accu.h requires Py_BUILD_CORE_BUILTIN + extra_compile_args=['-DPy_BUILD_CORE_BUILTIN']) ) # Python C API test module exts.append( Extension('_testcapi', ['_testcapimodule.c'], depends=['testcapi_long.h']) ) From webhook-mailer at python.org Fri Nov 9 10:56:53 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 09 Nov 2018 15:56:53 -0000 Subject: [Python-checkins] bpo-35199: Add an internal _PyTuple_ITEMS() macro (GH-10434) Message-ID: https://github.com/python/cpython/commit/d17a693fa08ce9f2d35acbb1f76e20bdae3e01da commit: d17a693fa08ce9f2d35acbb1f76e20bdae3e01da branch: master author: Victor Stinner committer: GitHub date: 2018-11-09T16:56:48+01:00 summary: bpo-35199: Add an internal _PyTuple_ITEMS() macro (GH-10434) * _PyTuple_ITEMS() gives access to the tuple->ob_item field and cast the first argument to PyTupleObject*. This internal macro is only usable if Py_BUILD_CORE is defined. * Replace &PyTuple_GET_ITEM(ob, 0) with _PyTuple_ITEMS(ob). * Replace PyTuple_GET_ITEM(op, 1) with &_PyTuple_ITEMS(ob)[1]. files: M Include/tupleobject.h M Modules/_functoolsmodule.c M Modules/_testcapimodule.c M Objects/call.c M Objects/codeobject.c M Objects/descrobject.c M Objects/funcobject.c M Python/ceval.c M Python/getargs.c diff --git a/Include/tupleobject.h b/Include/tupleobject.h index 72a7d8d5850d..257e05aeae8f 100644 --- a/Include/tupleobject.h +++ b/Include/tupleobject.h @@ -58,6 +58,10 @@ PyAPI_FUNC(void) _PyTuple_MaybeUntrack(PyObject *); #define PyTuple_GET_ITEM(op, i) (((PyTupleObject *)(op))->ob_item[i]) #define PyTuple_GET_SIZE(op) (assert(PyTuple_Check(op)),Py_SIZE(op)) +#ifdef Py_BUILD_CORE +# define _PyTuple_ITEMS(op) ((((PyTupleObject *)(op))->ob_item)) +#endif + /* Macro, *only* to be used to fill in brand new tuples */ #define PyTuple_SET_ITEM(op, i, v) (((PyTupleObject *)(op))->ob_item[i] = v) #endif diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c index 6c28b274e561..692c3b3563ad 100644 --- a/Modules/_functoolsmodule.c +++ b/Modules/_functoolsmodule.c @@ -142,7 +142,7 @@ partial_fastcall(partialobject *pto, PyObject **args, Py_ssize_t nargs, stack = args; } else if (nargs == 0) { - stack = &PyTuple_GET_ITEM(pto->args, 0); + stack = _PyTuple_ITEMS(pto->args); } else { if (nargs2 <= (Py_ssize_t)Py_ARRAY_LENGTH(small_stack)) { @@ -159,7 +159,7 @@ partial_fastcall(partialobject *pto, PyObject **args, Py_ssize_t nargs, /* use borrowed references */ memcpy(stack, - &PyTuple_GET_ITEM(pto->args, 0), + _PyTuple_ITEMS(pto->args), pto_nargs * sizeof(PyObject*)); memcpy(&stack[pto_nargs], args, @@ -222,7 +222,7 @@ partial_call(partialobject *pto, PyObject *args, PyObject *kwargs) if (pto->use_fastcall) { res = partial_fastcall(pto, - &PyTuple_GET_ITEM(args, 0), + _PyTuple_ITEMS(args), PyTuple_GET_SIZE(args), kwargs2); } diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index 3133d2b11f81..878e11a9d0ec 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -4361,7 +4361,7 @@ fastcall_args(PyObject *args, PyObject ***stack, Py_ssize_t *nargs) *nargs = 0; } else if (PyTuple_Check(args)) { - *stack = &PyTuple_GET_ITEM(args, 0); + *stack = ((PyTupleObject *)args)->ob_item; *nargs = PyTuple_GET_SIZE(args); } else { diff --git a/Objects/call.c b/Objects/call.c index 48e3aafe5fe5..707b49a67ee7 100644 --- a/Objects/call.c +++ b/Objects/call.c @@ -224,7 +224,7 @@ PyObject_Call(PyObject *callable, PyObject *args, PyObject *kwargs) if (PyFunction_Check(callable)) { return _PyFunction_FastCallDict(callable, - &PyTuple_GET_ITEM(args, 0), + _PyTuple_ITEMS(args), PyTuple_GET_SIZE(args), kwargs); } @@ -325,7 +325,7 @@ _PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs && co->co_argcount == PyTuple_GET_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ - args = &PyTuple_GET_ITEM(argdefs, 0); + args = _PyTuple_ITEMS(argdefs); return function_code_fastcall(co, args, PyTuple_GET_SIZE(argdefs), globals); } @@ -342,7 +342,7 @@ _PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs return NULL; } - k = &PyTuple_GET_ITEM(kwtuple, 0); + k = _PyTuple_ITEMS(kwtuple); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { /* We must hold strong references because keyword arguments can be @@ -365,7 +365,7 @@ _PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs qualname = ((PyFunctionObject *)func) -> func_qualname; if (argdefs != NULL) { - d = &PyTuple_GET_ITEM(argdefs, 0); + d = _PyTuple_ITEMS(argdefs); nd = PyTuple_GET_SIZE(argdefs); } else { @@ -411,7 +411,7 @@ _PyFunction_FastCallKeywords(PyObject *func, PyObject *const *stack, && co->co_argcount == PyTuple_GET_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ - stack = &PyTuple_GET_ITEM(argdefs, 0); + stack = _PyTuple_ITEMS(argdefs); return function_code_fastcall(co, stack, PyTuple_GET_SIZE(argdefs), globals); } @@ -423,7 +423,7 @@ _PyFunction_FastCallKeywords(PyObject *func, PyObject *const *stack, qualname = ((PyFunctionObject *)func) -> func_qualname; if (argdefs != NULL) { - d = &PyTuple_GET_ITEM(argdefs, 0); + d = _PyTuple_ITEMS(argdefs); nd = PyTuple_GET_SIZE(argdefs); } else { @@ -432,7 +432,7 @@ _PyFunction_FastCallKeywords(PyObject *func, PyObject *const *stack, } return _PyEval_EvalCodeWithName((PyObject*)co, globals, (PyObject *)NULL, stack, nargs, - nkwargs ? &PyTuple_GET_ITEM(kwnames, 0) : NULL, + nkwargs ? _PyTuple_ITEMS(kwnames) : NULL, stack + nargs, nkwargs, 1, d, (int)nd, kwdefs, @@ -785,7 +785,7 @@ PyCFunction_Call(PyObject *func, PyObject *args, PyObject *kwargs) } else { return _PyCFunction_FastCallDict(func, - &PyTuple_GET_ITEM(args, 0), + _PyTuple_ITEMS(args), PyTuple_GET_SIZE(args), kwargs); } @@ -898,8 +898,8 @@ _PyObject_Call_Prepend(PyObject *callable, /* use borrowed references */ stack[0] = obj; memcpy(&stack[1], - &PyTuple_GET_ITEM(args, 0), - argcount * sizeof(PyObject *)); + _PyTuple_ITEMS(args), + argcount * sizeof(PyObject *)); result = _PyObject_FastCallDict(callable, stack, argcount + 1, @@ -950,7 +950,7 @@ _PyObject_CallFunctionVa(PyObject *callable, const char *format, func(*(arg1, arg2, arg3)): func(arg1, arg2, arg3) */ PyObject *args = stack[0]; result = _PyObject_FastCall(callable, - &PyTuple_GET_ITEM(args, 0), + _PyTuple_ITEMS(args), PyTuple_GET_SIZE(args)); } else { diff --git a/Objects/codeobject.c b/Objects/codeobject.c index 6d8e9ac154ed..245021350425 100644 --- a/Objects/codeobject.c +++ b/Objects/codeobject.c @@ -39,7 +39,7 @@ intern_strings(PyObject *tuple) if (v == NULL || !PyUnicode_CheckExact(v)) { Py_FatalError("non-string found in code slot"); } - PyUnicode_InternInPlace(&PyTuple_GET_ITEM(tuple, i)); + PyUnicode_InternInPlace(&_PyTuple_ITEMS(tuple)[i]); } } diff --git a/Objects/descrobject.c b/Objects/descrobject.c index a23b97f396f9..17d0f5a005a2 100644 --- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -247,7 +247,7 @@ methoddescr_call(PyMethodDescrObject *descr, PyObject *args, PyObject *kwargs) } result = _PyMethodDef_RawFastCallDict(descr->d_method, self, - &PyTuple_GET_ITEM(args, 1), nargs - 1, + &_PyTuple_ITEMS(args)[1], nargs - 1, kwargs); result = _Py_CheckFunctionResult((PyObject *)descr, result, NULL); return result; @@ -331,7 +331,7 @@ classmethoddescr_call(PyMethodDescrObject *descr, PyObject *args, } result = _PyMethodDef_RawFastCallDict(descr->d_method, self, - &PyTuple_GET_ITEM(args, 1), argc - 1, + &_PyTuple_ITEMS(args)[1], argc - 1, kwds); result = _Py_CheckFunctionResult((PyObject *)descr, result, NULL); return result; diff --git a/Objects/funcobject.c b/Objects/funcobject.c index e5278f09af2b..86488217ec83 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c @@ -581,7 +581,7 @@ function_call(PyObject *func, PyObject *args, PyObject *kwargs) PyObject **stack; Py_ssize_t nargs; - stack = &PyTuple_GET_ITEM(args, 0); + stack = _PyTuple_ITEMS(args); nargs = PyTuple_GET_SIZE(args); return _PyFunction_FastCallDict(func, stack, nargs, kwargs); } diff --git a/Python/ceval.c b/Python/ceval.c index ac9db1533bf3..11be8efab9b9 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -4662,7 +4662,7 @@ do_call_core(PyObject *func, PyObject *callargs, PyObject *kwdict) } C_TRACE(result, _PyCFunction_FastCallDict(func, - &PyTuple_GET_ITEM(callargs, 1), + &_PyTuple_ITEMS(callargs)[1], nargs - 1, kwdict)); Py_DECREF(func); diff --git a/Python/getargs.c b/Python/getargs.c index 98823f22ed4e..89df29e31527 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -422,7 +422,7 @@ vgetargs1(PyObject *args, const char *format, va_list *p_va, int flags) return 0; } - stack = &PyTuple_GET_ITEM(args, 0); + stack = _PyTuple_ITEMS(args); nargs = PyTuple_GET_SIZE(args); } else { @@ -2254,7 +2254,7 @@ vgetargskeywordsfast(PyObject *args, PyObject *keywords, return 0; } - stack = &PyTuple_GET_ITEM(args, 0); + stack = _PyTuple_ITEMS(args); nargs = PyTuple_GET_SIZE(args); return vgetargskeywordsfast_impl(stack, nargs, keywords, NULL, parser, p_va, flags); @@ -2461,7 +2461,7 @@ PyArg_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t m "PyArg_UnpackTuple() argument list is not a tuple"); return 0; } - stack = &PyTuple_GET_ITEM(args, 0); + stack = _PyTuple_ITEMS(args); nargs = PyTuple_GET_SIZE(args); #ifdef HAVE_STDARG_PROTOTYPES From webhook-mailer at python.org Fri Nov 9 14:22:02 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 09 Nov 2018 19:22:02 -0000 Subject: [Python-checkins] [3.6] Doc: Make all versions sidebars the same for consistency. (GH-10288) (GH-10404) Message-ID: https://github.com/python/cpython/commit/384d5523c42fdabce98c0cac67fc7c8e2f8f4904 commit: 384d5523c42fdabce98c0cac67fc7c8e2f8f4904 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-09T11:21:59-08:00 summary: [3.6] Doc: Make all versions sidebars the same for consistency. (GH-10288) (GH-10404) (cherry picked from commit 556d50d03dd1d457c01ab552c8bc81f3431a0746) Co-authored-by: Julien Palard files: M Doc/tools/templates/indexsidebar.html diff --git a/Doc/tools/templates/indexsidebar.html b/Doc/tools/templates/indexsidebar.html index 3131050b036b..e69e9a305425 100644 --- a/Doc/tools/templates/indexsidebar.html +++ b/Doc/tools/templates/indexsidebar.html @@ -1,12 +1,13 @@

    {% trans %}Download{% endtrans %}

    {% trans %}Download these documents{% endtrans %}

    -

    {% trans %}Docs for other versions{% endtrans %}

    +

    {% trans %}Docs by version{% endtrans %}

    {% trans %}Other resources{% endtrans %}

    From webhook-mailer at python.org Fri Nov 9 14:34:57 2018 From: webhook-mailer at python.org (Ned Deily) Date: Fri, 09 Nov 2018 19:34:57 -0000 Subject: [Python-checkins] Correct a typo in the Unittest documentation (GH-10397) Message-ID: https://github.com/python/cpython/commit/009b2f02049eda3b29d4f4f743e51df106686375 commit: 009b2f02049eda3b29d4f4f743e51df106686375 branch: master author: G?ry Ogam committer: Ned Deily date: 2018-11-09T14:34:54-05:00 summary: Correct a typo in the Unittest documentation (GH-10397) Co-Authored-By: maggyero files: M Doc/library/unittest.rst diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index c4019088c79f..8afbee642620 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -607,7 +607,7 @@ Distinguishing test iterations using subtests .. versionadded:: 3.4 -When some of your tests differ only by a some very small differences, for +When there are very small differences among your tests, for instance some parameters, unittest allows you to distinguish them inside the body of a test method using the :meth:`~TestCase.subTest` context manager. From webhook-mailer at python.org Fri Nov 9 14:43:47 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 09 Nov 2018 19:43:47 -0000 Subject: [Python-checkins] Correct a typo in the Unittest documentation (GH-10397) Message-ID: https://github.com/python/cpython/commit/3da64a01411affb300a685d6307b6d984a503c11 commit: 3da64a01411affb300a685d6307b6d984a503c11 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-09T11:43:43-08:00 summary: Correct a typo in the Unittest documentation (GH-10397) Co-Authored-By: maggyero (cherry picked from commit 009b2f02049eda3b29d4f4f743e51df106686375) Co-authored-by: G?ry Ogam files: M Doc/library/unittest.rst diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index 1153459029ce..fb5bd2b7648e 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -607,7 +607,7 @@ Distinguishing test iterations using subtests .. versionadded:: 3.4 -When some of your tests differ only by a some very small differences, for +When there are very small differences among your tests, for instance some parameters, unittest allows you to distinguish them inside the body of a test method using the :meth:`~TestCase.subTest` context manager. From webhook-mailer at python.org Fri Nov 9 14:50:56 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 09 Nov 2018 19:50:56 -0000 Subject: [Python-checkins] Correct a typo in the Unittest documentation (GH-10397) Message-ID: https://github.com/python/cpython/commit/aa4f9a23932fbb298102e2ffa00021a8ddd2ea1c commit: aa4f9a23932fbb298102e2ffa00021a8ddd2ea1c branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-09T11:50:52-08:00 summary: Correct a typo in the Unittest documentation (GH-10397) Co-Authored-By: maggyero (cherry picked from commit 009b2f02049eda3b29d4f4f743e51df106686375) Co-authored-by: G?ry Ogam files: M Doc/library/unittest.rst diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index a43e9453239c..3a8af0c52a59 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -588,7 +588,7 @@ Distinguishing test iterations using subtests .. versionadded:: 3.4 -When some of your tests differ only by a some very small differences, for +When there are very small differences among your tests, for instance some parameters, unittest allows you to distinguish them inside the body of a test method using the :meth:`~TestCase.subTest` context manager. From webhook-mailer at python.org Fri Nov 9 22:45:44 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 10 Nov 2018 03:45:44 -0000 Subject: [Python-checkins] Doc: Simplify Copyright line in README (GH-10287) Message-ID: https://github.com/python/cpython/commit/9d43fa1bb228e6ebd2f1ebd0274f8f7d7e3635d4 commit: 9d43fa1bb228e6ebd2f1ebd0274f8f7d7e3635d4 branch: master author: David Kleuker committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-11-09T19:45:40-08:00 summary: Doc: Simplify Copyright line in README (GH-10287) This also makes it consistent with other places like: - https://docs.python.org/dev/copyright.html - https://www.python.org/ footer - https://github.com/python/cpython/blob/e42b705188271da108de42b55d9344642170aa2b/Python/getcopyright.c#L7 files: M README.rst diff --git a/README.rst b/README.rst index 970f62e69389..61281042e3bd 100644 --- a/README.rst +++ b/README.rst @@ -22,9 +22,7 @@ This is Python version 3.8.0 alpha 0 :target: https://python.zulipchat.com -Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, -2012, 2013, 2014, 2015, 2016, 2017, 2018 Python Software Foundation. All rights -reserved. +Copyright (c) 2001-2018 Python Software Foundation. All rights reserved. See the end of this file for further copyright and license information. @@ -251,9 +249,7 @@ See :pep:`569` for Python 3.8 release details. Copyright and License Information --------------------------------- -Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, -2012, 2013, 2014, 2015, 2016, 2017, 2018 Python Software Foundation. All rights -reserved. +Copyright (c) 2001-2018 Python Software Foundation. All rights reserved. Copyright (c) 2000 BeOpen.com. All rights reserved. From webhook-mailer at python.org Sat Nov 10 00:45:31 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sat, 10 Nov 2018 05:45:31 -0000 Subject: [Python-checkins] bpo-35202: Remove unused imports in Lib directory. (GH-10445) Message-ID: https://github.com/python/cpython/commit/2d1bc537fe8b15664bb3e648785ba3c12e93b232 commit: 2d1bc537fe8b15664bb3e648785ba3c12e93b232 branch: master author: Srinivas Thatiparthy (?????????? ?????????) committer: Serhiy Storchaka date: 2018-11-10T07:45:28+02:00 summary: bpo-35202: Remove unused imports in Lib directory. (GH-10445) files: M Lib/shutil.py M Lib/trace.py M Lib/typing.py diff --git a/Lib/shutil.py b/Lib/shutil.py index 40dd070ed11f..b7a7df3a51fa 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -10,7 +10,6 @@ import fnmatch import collections import errno -import io try: import zlib diff --git a/Lib/trace.py b/Lib/trace.py index 0ed7ba95b520..3049e4ec6839 100755 --- a/Lib/trace.py +++ b/Lib/trace.py @@ -51,7 +51,6 @@ import linecache import os -import re import sys import token import tokenize diff --git a/Lib/typing.py b/Lib/typing.py index cfcbb3b76328..4f9e04506fb5 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -18,7 +18,6 @@ * Wrapper submodules for re and io related types. """ -import abc from abc import abstractmethod, abstractproperty import collections import collections.abc From webhook-mailer at python.org Sat Nov 10 00:47:15 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sat, 10 Nov 2018 05:47:15 -0000 Subject: [Python-checkins] [2.7] bpo-35194: Fix a wrong constant in cp932 codec. (GH-10420) (GH-10433) Message-ID: https://github.com/python/cpython/commit/0d165262d949440e5aea6533b10e19e4cd5cf12d commit: 0d165262d949440e5aea6533b10e19e4cd5cf12d branch: 2.7 author: Alexey Izbyshev committer: Serhiy Storchaka date: 2018-11-10T07:47:12+02:00 summary: [2.7] bpo-35194: Fix a wrong constant in cp932 codec. (GH-10420) (GH-10433) This typo doesn't affect the result because wrong bits are discarded on implicit conversion to unsigned char, but it trips UBSan with -fsanitize=implicit-integer-truncation. (cherry picked from commit 7a69cf47a9bbc95f95fd67c982bff121b2a903cb) Co-authored-by: Alexey Izbyshev files: M Modules/cjkcodecs/_codecs_jp.c diff --git a/Modules/cjkcodecs/_codecs_jp.c b/Modules/cjkcodecs/_codecs_jp.c index a05e01b32e5a..3acd19e6258e 100644 --- a/Modules/cjkcodecs/_codecs_jp.c +++ b/Modules/cjkcodecs/_codecs_jp.c @@ -40,7 +40,7 @@ ENCODER(cp932) if (c == 0xf8f0) OUT1(0xa0) else - OUT1(c - 0xfef1 + 0xfd) + OUT1(c - 0xf8f1 + 0xfd) NEXT(1, 1) continue; } From webhook-mailer at python.org Sat Nov 10 01:45:36 2018 From: webhook-mailer at python.org (Terry Jan Reedy) Date: Sat, 10 Nov 2018 06:45:36 -0000 Subject: [Python-checkins] bpo-35202: Remove unused imports in idlelib (GH-10438) Message-ID: https://github.com/python/cpython/commit/43a74abb3a87092a7fd6c71042eafb977d70d8e0 commit: 43a74abb3a87092a7fd6c71042eafb977d70d8e0 branch: master author: Srinivas Thatiparthy (?????????? ?????????) committer: Terry Jan Reedy date: 2018-11-10T01:45:31-05:00 summary: bpo-35202: Remove unused imports in idlelib (GH-10438) files: A Misc/NEWS.d/next/IDLE/2018-11-10-09-10-54.bpo-35202.TeJJrt.rst M Lib/idlelib/codecontext.py M Lib/idlelib/filelist.py M Lib/idlelib/idle_test/test_config.py M Lib/idlelib/idle_test/test_config_key.py M Lib/idlelib/idle_test/test_rpc.py M Lib/idlelib/pyparse.py diff --git a/Lib/idlelib/codecontext.py b/Lib/idlelib/codecontext.py index 7c88a4d015e3..ef8852852d1f 100644 --- a/Lib/idlelib/codecontext.py +++ b/Lib/idlelib/codecontext.py @@ -13,7 +13,7 @@ from sys import maxsize as INFINITY import tkinter -from tkinter.constants import TOP, LEFT, X, W, SUNKEN +from tkinter.constants import TOP, X, SUNKEN from idlelib.config import idleConf diff --git a/Lib/idlelib/filelist.py b/Lib/idlelib/filelist.py index 52628392e617..0d200854ef00 100644 --- a/Lib/idlelib/filelist.py +++ b/Lib/idlelib/filelist.py @@ -115,7 +115,6 @@ def _test(): # TODO check and convert to htest from tkinter import Tk from idlelib.editor import fixwordbreaks from idlelib.run import fix_scaling - import sys root = Tk() fix_scaling(root) fixwordbreaks(root) diff --git a/Lib/idlelib/idle_test/test_config.py b/Lib/idlelib/idle_test/test_config.py index 8c9197284e07..169d054efd08 100644 --- a/Lib/idlelib/idle_test/test_config.py +++ b/Lib/idlelib/idle_test/test_config.py @@ -4,7 +4,6 @@ Much of IdleConf is also exercised by ConfigDialog and test_configdialog. """ from idlelib import config -import copy import sys import os import tempfile diff --git a/Lib/idlelib/idle_test/test_config_key.py b/Lib/idlelib/idle_test/test_config_key.py index 08471666a452..5031daadee0a 100644 --- a/Lib/idlelib/idle_test/test_config_key.py +++ b/Lib/idlelib/idle_test/test_config_key.py @@ -2,7 +2,6 @@ from idlelib import config_key from test.support import requires -import sys import unittest from tkinter import Tk from idlelib.idle_test.mock_idle import Func diff --git a/Lib/idlelib/idle_test/test_rpc.py b/Lib/idlelib/idle_test/test_rpc.py index 48be65ba10b9..81eff398c72f 100644 --- a/Lib/idlelib/idle_test/test_rpc.py +++ b/Lib/idlelib/idle_test/test_rpc.py @@ -3,7 +3,6 @@ from idlelib import rpc import unittest -import marshal class CodePicklerTest(unittest.TestCase): diff --git a/Lib/idlelib/pyparse.py b/Lib/idlelib/pyparse.py index 1eeb9154d906..81e7f539803c 100644 --- a/Lib/idlelib/pyparse.py +++ b/Lib/idlelib/pyparse.py @@ -11,7 +11,6 @@ _chew_ordinaryre - non-special characters. """ import re -import sys # Reason last statement is continued (or C_NONE if it's not). (C_NONE, C_BACKSLASH, C_STRING_FIRST_LINE, diff --git a/Misc/NEWS.d/next/IDLE/2018-11-10-09-10-54.bpo-35202.TeJJrt.rst b/Misc/NEWS.d/next/IDLE/2018-11-10-09-10-54.bpo-35202.TeJJrt.rst new file mode 100644 index 000000000000..1824536f3db1 --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2018-11-10-09-10-54.bpo-35202.TeJJrt.rst @@ -0,0 +1 @@ +Remove unused imports from lib/idlelib From webhook-mailer at python.org Sat Nov 10 02:06:27 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 10 Nov 2018 07:06:27 -0000 Subject: [Python-checkins] bpo-35202: Remove unused imports in idlelib (GH-10438) Message-ID: https://github.com/python/cpython/commit/2847ccae4687cb43334d87d86fb6c11cb14218f5 commit: 2847ccae4687cb43334d87d86fb6c11cb14218f5 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-09T23:06:22-08:00 summary: bpo-35202: Remove unused imports in idlelib (GH-10438) (cherry picked from commit 43a74abb3a87092a7fd6c71042eafb977d70d8e0) Co-authored-by: Srinivas Thatiparthy (?????????? ?????????) files: A Misc/NEWS.d/next/IDLE/2018-11-10-09-10-54.bpo-35202.TeJJrt.rst M Lib/idlelib/codecontext.py M Lib/idlelib/filelist.py M Lib/idlelib/idle_test/test_config.py M Lib/idlelib/idle_test/test_config_key.py M Lib/idlelib/idle_test/test_rpc.py M Lib/idlelib/pyparse.py diff --git a/Lib/idlelib/codecontext.py b/Lib/idlelib/codecontext.py index 7c88a4d015e3..ef8852852d1f 100644 --- a/Lib/idlelib/codecontext.py +++ b/Lib/idlelib/codecontext.py @@ -13,7 +13,7 @@ from sys import maxsize as INFINITY import tkinter -from tkinter.constants import TOP, LEFT, X, W, SUNKEN +from tkinter.constants import TOP, X, SUNKEN from idlelib.config import idleConf diff --git a/Lib/idlelib/filelist.py b/Lib/idlelib/filelist.py index 52628392e617..0d200854ef00 100644 --- a/Lib/idlelib/filelist.py +++ b/Lib/idlelib/filelist.py @@ -115,7 +115,6 @@ def _test(): # TODO check and convert to htest from tkinter import Tk from idlelib.editor import fixwordbreaks from idlelib.run import fix_scaling - import sys root = Tk() fix_scaling(root) fixwordbreaks(root) diff --git a/Lib/idlelib/idle_test/test_config.py b/Lib/idlelib/idle_test/test_config.py index 8c9197284e07..169d054efd08 100644 --- a/Lib/idlelib/idle_test/test_config.py +++ b/Lib/idlelib/idle_test/test_config.py @@ -4,7 +4,6 @@ Much of IdleConf is also exercised by ConfigDialog and test_configdialog. """ from idlelib import config -import copy import sys import os import tempfile diff --git a/Lib/idlelib/idle_test/test_config_key.py b/Lib/idlelib/idle_test/test_config_key.py index 08471666a452..5031daadee0a 100644 --- a/Lib/idlelib/idle_test/test_config_key.py +++ b/Lib/idlelib/idle_test/test_config_key.py @@ -2,7 +2,6 @@ from idlelib import config_key from test.support import requires -import sys import unittest from tkinter import Tk from idlelib.idle_test.mock_idle import Func diff --git a/Lib/idlelib/idle_test/test_rpc.py b/Lib/idlelib/idle_test/test_rpc.py index 48be65ba10b9..81eff398c72f 100644 --- a/Lib/idlelib/idle_test/test_rpc.py +++ b/Lib/idlelib/idle_test/test_rpc.py @@ -3,7 +3,6 @@ from idlelib import rpc import unittest -import marshal class CodePicklerTest(unittest.TestCase): diff --git a/Lib/idlelib/pyparse.py b/Lib/idlelib/pyparse.py index 1eeb9154d906..81e7f539803c 100644 --- a/Lib/idlelib/pyparse.py +++ b/Lib/idlelib/pyparse.py @@ -11,7 +11,6 @@ _chew_ordinaryre - non-special characters. """ import re -import sys # Reason last statement is continued (or C_NONE if it's not). (C_NONE, C_BACKSLASH, C_STRING_FIRST_LINE, diff --git a/Misc/NEWS.d/next/IDLE/2018-11-10-09-10-54.bpo-35202.TeJJrt.rst b/Misc/NEWS.d/next/IDLE/2018-11-10-09-10-54.bpo-35202.TeJJrt.rst new file mode 100644 index 000000000000..1824536f3db1 --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2018-11-10-09-10-54.bpo-35202.TeJJrt.rst @@ -0,0 +1 @@ +Remove unused imports from lib/idlelib From webhook-mailer at python.org Sat Nov 10 02:08:08 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 10 Nov 2018 07:08:08 -0000 Subject: [Python-checkins] bpo-35202: Remove unused imports in idlelib (GH-10438) Message-ID: https://github.com/python/cpython/commit/2903b0fd38a65e16ddafae7754ed5d605fea68ff commit: 2903b0fd38a65e16ddafae7754ed5d605fea68ff branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-09T23:08:05-08:00 summary: bpo-35202: Remove unused imports in idlelib (GH-10438) (cherry picked from commit 43a74abb3a87092a7fd6c71042eafb977d70d8e0) Co-authored-by: Srinivas Thatiparthy (?????????? ?????????) files: A Misc/NEWS.d/next/IDLE/2018-11-10-09-10-54.bpo-35202.TeJJrt.rst M Lib/idlelib/codecontext.py M Lib/idlelib/filelist.py M Lib/idlelib/idle_test/test_config.py M Lib/idlelib/idle_test/test_config_key.py M Lib/idlelib/idle_test/test_rpc.py M Lib/idlelib/pyparse.py diff --git a/Lib/idlelib/codecontext.py b/Lib/idlelib/codecontext.py index 7c88a4d015e3..ef8852852d1f 100644 --- a/Lib/idlelib/codecontext.py +++ b/Lib/idlelib/codecontext.py @@ -13,7 +13,7 @@ from sys import maxsize as INFINITY import tkinter -from tkinter.constants import TOP, LEFT, X, W, SUNKEN +from tkinter.constants import TOP, X, SUNKEN from idlelib.config import idleConf diff --git a/Lib/idlelib/filelist.py b/Lib/idlelib/filelist.py index 52628392e617..0d200854ef00 100644 --- a/Lib/idlelib/filelist.py +++ b/Lib/idlelib/filelist.py @@ -115,7 +115,6 @@ def _test(): # TODO check and convert to htest from tkinter import Tk from idlelib.editor import fixwordbreaks from idlelib.run import fix_scaling - import sys root = Tk() fix_scaling(root) fixwordbreaks(root) diff --git a/Lib/idlelib/idle_test/test_config.py b/Lib/idlelib/idle_test/test_config.py index 8c9197284e07..169d054efd08 100644 --- a/Lib/idlelib/idle_test/test_config.py +++ b/Lib/idlelib/idle_test/test_config.py @@ -4,7 +4,6 @@ Much of IdleConf is also exercised by ConfigDialog and test_configdialog. """ from idlelib import config -import copy import sys import os import tempfile diff --git a/Lib/idlelib/idle_test/test_config_key.py b/Lib/idlelib/idle_test/test_config_key.py index 08471666a452..5031daadee0a 100644 --- a/Lib/idlelib/idle_test/test_config_key.py +++ b/Lib/idlelib/idle_test/test_config_key.py @@ -2,7 +2,6 @@ from idlelib import config_key from test.support import requires -import sys import unittest from tkinter import Tk from idlelib.idle_test.mock_idle import Func diff --git a/Lib/idlelib/idle_test/test_rpc.py b/Lib/idlelib/idle_test/test_rpc.py index 48be65ba10b9..81eff398c72f 100644 --- a/Lib/idlelib/idle_test/test_rpc.py +++ b/Lib/idlelib/idle_test/test_rpc.py @@ -3,7 +3,6 @@ from idlelib import rpc import unittest -import marshal class CodePicklerTest(unittest.TestCase): diff --git a/Lib/idlelib/pyparse.py b/Lib/idlelib/pyparse.py index 1eeb9154d906..81e7f539803c 100644 --- a/Lib/idlelib/pyparse.py +++ b/Lib/idlelib/pyparse.py @@ -11,7 +11,6 @@ _chew_ordinaryre - non-special characters. """ import re -import sys # Reason last statement is continued (or C_NONE if it's not). (C_NONE, C_BACKSLASH, C_STRING_FIRST_LINE, diff --git a/Misc/NEWS.d/next/IDLE/2018-11-10-09-10-54.bpo-35202.TeJJrt.rst b/Misc/NEWS.d/next/IDLE/2018-11-10-09-10-54.bpo-35202.TeJJrt.rst new file mode 100644 index 000000000000..1824536f3db1 --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2018-11-10-09-10-54.bpo-35202.TeJJrt.rst @@ -0,0 +1 @@ +Remove unused imports from lib/idlelib From webhook-mailer at python.org Sat Nov 10 02:22:05 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sat, 10 Nov 2018 07:22:05 -0000 Subject: [Python-checkins] bpo-35202: Remove unused imports in Lib directory. (GH-10446) Message-ID: https://github.com/python/cpython/commit/b9498e2367f21205ed2b9c172665ea6f0a218d27 commit: b9498e2367f21205ed2b9c172665ea6f0a218d27 branch: master author: Srinivas Thatiparthy (?????????? ?????????) committer: Serhiy Storchaka date: 2018-11-10T09:22:02+02:00 summary: bpo-35202: Remove unused imports in Lib directory. (GH-10446) files: M Lib/lib2to3/pgen2/driver.py M Lib/lib2to3/pgen2/grammar.py M Lib/multiprocessing/popen_fork.py M Lib/test/test_collections.py M Lib/test/test_queue.py M Lib/test/test_sys.py M Lib/test/test_thread.py diff --git a/Lib/lib2to3/pgen2/driver.py b/Lib/lib2to3/pgen2/driver.py index cbc58e759d53..6471635a3192 100644 --- a/Lib/lib2to3/pgen2/driver.py +++ b/Lib/lib2to3/pgen2/driver.py @@ -16,7 +16,6 @@ __all__ = ["Driver", "load_grammar"] # Python imports -import codecs import io import os import logging diff --git a/Lib/lib2to3/pgen2/grammar.py b/Lib/lib2to3/pgen2/grammar.py index c00cb2248d56..a1da546eee20 100644 --- a/Lib/lib2to3/pgen2/grammar.py +++ b/Lib/lib2to3/pgen2/grammar.py @@ -13,7 +13,6 @@ """ # Python imports -import collections import pickle # Local imports diff --git a/Lib/multiprocessing/popen_fork.py b/Lib/multiprocessing/popen_fork.py index 008b97b36628..685e8daf77ca 100644 --- a/Lib/multiprocessing/popen_fork.py +++ b/Lib/multiprocessing/popen_fork.py @@ -1,5 +1,4 @@ import os -import sys import signal from . import util diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py index 200e0273c33e..e2ffaaafd454 100644 --- a/Lib/test/test_collections.py +++ b/Lib/test/test_collections.py @@ -3,11 +3,9 @@ import collections import copy import doctest -import keyword import operator import pickle from random import choice, randrange -import re import string import sys from test import support diff --git a/Lib/test/test_queue.py b/Lib/test/test_queue.py index 1a8d5f8856c5..c8528f97741d 100644 --- a/Lib/test/test_queue.py +++ b/Lib/test/test_queue.py @@ -1,10 +1,8 @@ # Some simple queue module tests, plus some failure conditions # to ensure the Queue locks remain stable. -import collections import itertools import queue import random -import sys import threading import time import unittest diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index b90366d81445..92aefd8d7af4 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -10,7 +10,6 @@ import gc import sysconfig import locale -import threading # count the number of test runs, used to create unique # strings to intern in test_intern() diff --git a/Lib/test/test_thread.py b/Lib/test/test_thread.py index 64ffe4605298..f4eb830cf6d7 100644 --- a/Lib/test/test_thread.py +++ b/Lib/test/test_thread.py @@ -4,7 +4,6 @@ from test import support import _thread as thread import time -import sys import weakref from test import lock_tests From solipsis at pitrou.net Sat Nov 10 04:09:57 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Sat, 10 Nov 2018 09:09:57 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=3 Message-ID: <20181110090957.1.D038CEB247B5DD7A@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_asyncio leaked [0, 0, 3] memory blocks, sum=3 test_collections leaked [-7, 1, 0] memory blocks, sum=-6 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_fork leaked [1, -1, 2] memory blocks, sum=2 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogjoPZ5b', '--timeout', '7200'] From webhook-mailer at python.org Sat Nov 10 23:26:36 2018 From: webhook-mailer at python.org (Terry Jan Reedy) Date: Sun, 11 Nov 2018 04:26:36 -0000 Subject: [Python-checkins] bpo-34864: Document two IDLE on MacOS issues. (GH-10456) Message-ID: https://github.com/python/cpython/commit/50ff02b43145f33f8e28ffbfcc6a9d15c4749a64 commit: 50ff02b43145f33f8e28ffbfcc6a9d15c4749a64 branch: master author: Terry Jan Reedy committer: GitHub date: 2018-11-10T23:26:31-05:00 summary: bpo-34864: Document two IDLE on MacOS issues. (GH-10456) The System Preferences Dock "prefer tabs always" setting disables some IDLE features. Menus are a bit different than as described for Windows and Linux. files: A Misc/NEWS.d/next/IDLE/2018-11-10-21-27-25.bpo-34864.Ci-G2q.rst M Doc/library/idle.rst M Lib/idlelib/help.html diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst index f353fbc86127..d019bf42cd32 100644 --- a/Doc/library/idle.rst +++ b/Doc/library/idle.rst @@ -40,13 +40,17 @@ Menus ----- IDLE has two main window types, the Shell window and the Editor window. It is -possible to have multiple editor windows simultaneously. Output windows, such -as used for Edit / Find in Files, are a subtype of edit window. They currently -have the same top menu as Editor windows but a different default title and -context menu. +possible to have multiple editor windows simultaneously. On Windows and +Linux, each has its own top menu. Each menu documented below indicates +which window type it is associated with. -IDLE's menus dynamically change based on which window is currently selected. -Each menu documented below indicates which window type it is associated with. +Output windows, such as used for Edit => Find in Files, are a subtype of editor +window. They currently have the same top menu but a different +default title and context menu. + +On MacOS, there is one application menu. It dynamically changes according +to the window currently selected. It has an IDLE menu, and some entries +described below are moved around to conform to Apple guidlines. File menu (Shell and Editor) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -792,6 +796,13 @@ changed via Configure IDLE on the Option menu. Keys can be user defined; IDLE ships with four built-in key sets. In addition, a user can create a custom key set in the Configure IDLE dialog under the keys tab. +IDLE on MacOS +^^^^^^^^^^^^^ + +Under System Preferences: Dock, one can set "Prefer tabs when opening +documents" to "Always". This setting is not compatible with the tk/tkinter +GUI framework used by IDLE, and it breaks a few IDLE features. + Extensions ^^^^^^^^^^ diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html index f0b42151f359..a8afc75c316c 100644 --- a/Lib/idlelib/help.html +++ b/Lib/idlelib/help.html @@ -122,12 +122,15 @@

    Navigation

    IDLE has the following features:

    • coded in 100% pure Python, using the tkinter GUI toolkit
    • -
    • cross-platform: works mostly the same on Windows, Unix, and Mac OS X
    • +
    • cross-platform: works mostly the same on Windows, Unix, and macOS
    • Python shell window (interactive interpreter) with colorizing of code input, output, and error messages
    • multi-window text editor with multiple undo, Python colorizing, @@ -128,7 +128,7 @@

      Menus

      Output windows, such as used for Edit => Find in Files, are a subtype of editor window. They currently have the same top menu but a different default title and context menu.

      -

      On MacOS, there is one application menu. It dynamically changes according +

      On macOS, there is one application menu. It dynamically changes according to the window currently selected. It has an IDLE menu, and some entries described below are moved around to conform to Apple guidlines.

    • @@ -757,7 +757,7 @@

      Setting preferences -

      IDLE on MacOS?

      +

      IDLE on macOS?

      Under System Preferences: Dock, one can set ?Prefer tabs when opening documents? to ?Always?. This setting is not compatible with the tk/tkinter GUI framework used by IDLE, and it breaks a few IDLE features.

      @@ -817,7 +817,7 @@

      Table of Contents

    • Help and preferences
    • @@ -899,7 +899,7 @@

      Navigation



      - Last updated on Nov 10, 2018. + Last updated on Nov 12, 2018. Found a bug?
      diff --git a/Lib/idlelib/iomenu.py b/Lib/idlelib/iomenu.py index fcd8dcc1393d..f5bced597aa8 100644 --- a/Lib/idlelib/iomenu.py +++ b/Lib/idlelib/iomenu.py @@ -41,7 +41,7 @@ # these problems, falling back to ASCII locale_encoding = locale.nl_langinfo(locale.CODESET) if locale_encoding is None or locale_encoding == '': - # situation occurs on Mac OS X + # situation occurs on macOS locale_encoding = 'ascii' codecs.lookup(locale_encoding) except (NameError, AttributeError, LookupError): @@ -51,7 +51,7 @@ try: locale_encoding = locale.getdefaultlocale()[1] if locale_encoding is None or locale_encoding == '': - # situation occurs on Mac OS X + # situation occurs on macOS locale_encoding = 'ascii' codecs.lookup(locale_encoding) except (ValueError, LookupError): diff --git a/Lib/idlelib/macosx.py b/Lib/idlelib/macosx.py index d3ae224100cf..8f8484a37015 100644 --- a/Lib/idlelib/macosx.py +++ b/Lib/idlelib/macosx.py @@ -1,5 +1,5 @@ """ -A number of functions that enhance IDLE on Mac OSX. +A number of functions that enhance IDLE on macOS. """ from sys import platform # Used in _init_tk_type, changed by test. @@ -192,7 +192,7 @@ def help_dialog(event=None): root.bind('<>', flist.close_all_callback) # The binding above doesn't reliably work on all versions of Tk - # on MacOSX. Adding command definition below does seem to do the + # on macOS. Adding command definition below does seem to do the # right thing for now. root.createcommand('exit', flist.close_all_callback) diff --git a/Misc/NEWS.d/next/IDLE/2018-11-12-00-20-01.bpo-35213.cqNgzT.rst b/Misc/NEWS.d/next/IDLE/2018-11-12-00-20-01.bpo-35213.cqNgzT.rst new file mode 100644 index 000000000000..9d0e4e1220bb --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2018-11-12-00-20-01.bpo-35213.cqNgzT.rst @@ -0,0 +1 @@ +Where appropriate, use 'macOS' in idlelib. From webhook-mailer at python.org Thu Nov 15 14:31:40 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 15 Nov 2018 19:31:40 -0000 Subject: [Python-checkins] bpo-35213: Where appropriate, use 'macOS' in idlelib. (GH-10478) Message-ID: https://github.com/python/cpython/commit/579c4175648f667d59954d48ada757621ff6d433 commit: 579c4175648f667d59954d48ada757621ff6d433 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-15T11:31:31-08:00 summary: bpo-35213: Where appropriate, use 'macOS' in idlelib. (GH-10478) (cherry picked from commit b65413b497a07f521d835b799be7dd0afcedbd65) Co-authored-by: Terry Jan Reedy files: A Misc/NEWS.d/next/IDLE/2018-11-12-00-20-01.bpo-35213.cqNgzT.rst M Doc/library/idle.rst M Lib/idlelib/config.py M Lib/idlelib/help.html M Lib/idlelib/iomenu.py M Lib/idlelib/macosx.py diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst index d019bf42cd32..384d2bf57dc5 100644 --- a/Doc/library/idle.rst +++ b/Doc/library/idle.rst @@ -20,7 +20,7 @@ IDLE has the following features: * coded in 100% pure Python, using the :mod:`tkinter` GUI toolkit -* cross-platform: works mostly the same on Windows, Unix, and Mac OS X +* cross-platform: works mostly the same on Windows, Unix, and macOS * Python shell window (interactive interpreter) with colorizing of code input, output, and error messages @@ -48,7 +48,7 @@ Output windows, such as used for Edit => Find in Files, are a subtype of editor window. They currently have the same top menu but a different default title and context menu. -On MacOS, there is one application menu. It dynamically changes according +On macOS, there is one application menu. It dynamically changes according to the window currently selected. It has an IDLE menu, and some entries described below are moved around to conform to Apple guidlines. @@ -267,7 +267,7 @@ Options menu (Shell and Editor) Configure IDLE Open a configuration dialog and change preferences for the following: fonts, indentation, keybindings, text color themes, startup windows and - size, additional help sources, and extensions (see below). On OS X, + size, additional help sources, and extensions (see below). On macOS, open the configuration dialog by selecting Preferences in the application menu. To use a new built-in color theme (IDLE Dark) with older IDLEs, save it as a new custom theme. @@ -324,7 +324,7 @@ on Help menu choices. Context Menus ^^^^^^^^^^^^^^^^^^^^^^^^^^ -Open a context menu by right-clicking in a window (Control-click on OS X). +Open a context menu by right-clicking in a window (Control-click on macOS). Context menus have the standard clipboard functions also on the Edit menu. Cut @@ -381,7 +381,7 @@ Key bindings ^^^^^^^^^^^^ In this section, 'C' refers to the :kbd:`Control` key on Windows and Unix and -the :kbd:`Command` key on Mac OSX. +the :kbd:`Command` key on macOS. * :kbd:`Backspace` deletes to the left; :kbd:`Del` deletes to the right @@ -526,9 +526,9 @@ code interactively. IDLE's Shell window also responds to the following keys. Command history * :kbd:`Alt-p` retrieves previous command matching what you have typed. On - OS X use :kbd:`C-p`. + macOS use :kbd:`C-p`. - * :kbd:`Alt-n` retrieves next. On OS X use :kbd:`C-n`. + * :kbd:`Alt-n` retrieves next. On macOS use :kbd:`C-n`. * :kbd:`Return` while on any previous command retrieves that command @@ -796,7 +796,7 @@ changed via Configure IDLE on the Option menu. Keys can be user defined; IDLE ships with four built-in key sets. In addition, a user can create a custom key set in the Configure IDLE dialog under the keys tab. -IDLE on MacOS +IDLE on macOS ^^^^^^^^^^^^^ Under System Preferences: Dock, one can set "Prefer tabs when opening diff --git a/Lib/idlelib/config.py b/Lib/idlelib/config.py index 0eb90fc8dc5f..79d988f9a186 100644 --- a/Lib/idlelib/config.py +++ b/Lib/idlelib/config.py @@ -562,12 +562,11 @@ def GetCurrentKeySet(self): result = self.GetKeySet(self.CurrentKeys()) if sys.platform == "darwin": - # OS X Tk variants do not support the "Alt" keyboard modifier. - # So replace all keybingings that use "Alt" with ones that - # use the "Option" keyboard modifier. - # TODO (Ned?): the "Option" modifier does not work properly for - # Cocoa Tk and XQuartz Tk so we should not use it - # in default OS X KeySets. + # macOS (OS X) Tk variants do not support the "Alt" + # keyboard modifier. Replace it with "Option". + # TODO (Ned?): the "Option" modifier does not work properly + # for Cocoa Tk and XQuartz Tk so we should not use it + # in the default 'OSX' keyset. for k, v in result.items(): v2 = [ x.replace('Navigation

      IDLE has the following features:

      • coded in 100% pure Python, using the tkinter GUI toolkit
      • -
      • cross-platform: works mostly the same on Windows, Unix, and Mac OS X
      • +
      • cross-platform: works mostly the same on Windows, Unix, and macOS
      • Python shell window (interactive interpreter) with colorizing of code input, output, and error messages
      • multi-window text editor with multiple undo, Python colorizing, @@ -128,7 +128,7 @@

        Menus

        Output windows, such as used for Edit => Find in Files, are a subtype of editor window. They currently have the same top menu but a different default title and context menu.

        -

        On MacOS, there is one application menu. It dynamically changes according +

        On macOS, there is one application menu. It dynamically changes according to the window currently selected. It has an IDLE menu, and some entries described below are moved around to conform to Apple guidlines.

      • @@ -757,7 +757,7 @@

        Setting preferences -

        IDLE on MacOS?

        +

        IDLE on macOS?

        Under System Preferences: Dock, one can set ?Prefer tabs when opening documents? to ?Always?. This setting is not compatible with the tk/tkinter GUI framework used by IDLE, and it breaks a few IDLE features.

        @@ -817,7 +817,7 @@

        Table of Contents

      • Help and preferences
      • @@ -899,7 +899,7 @@

        Navigation



        - Last updated on Nov 10, 2018. + Last updated on Nov 12, 2018. Found a bug?
        diff --git a/Lib/idlelib/iomenu.py b/Lib/idlelib/iomenu.py index fcd8dcc1393d..f5bced597aa8 100644 --- a/Lib/idlelib/iomenu.py +++ b/Lib/idlelib/iomenu.py @@ -41,7 +41,7 @@ # these problems, falling back to ASCII locale_encoding = locale.nl_langinfo(locale.CODESET) if locale_encoding is None or locale_encoding == '': - # situation occurs on Mac OS X + # situation occurs on macOS locale_encoding = 'ascii' codecs.lookup(locale_encoding) except (NameError, AttributeError, LookupError): @@ -51,7 +51,7 @@ try: locale_encoding = locale.getdefaultlocale()[1] if locale_encoding is None or locale_encoding == '': - # situation occurs on Mac OS X + # situation occurs on macOS locale_encoding = 'ascii' codecs.lookup(locale_encoding) except (ValueError, LookupError): diff --git a/Lib/idlelib/macosx.py b/Lib/idlelib/macosx.py index d3ae224100cf..8f8484a37015 100644 --- a/Lib/idlelib/macosx.py +++ b/Lib/idlelib/macosx.py @@ -1,5 +1,5 @@ """ -A number of functions that enhance IDLE on Mac OSX. +A number of functions that enhance IDLE on macOS. """ from sys import platform # Used in _init_tk_type, changed by test. @@ -192,7 +192,7 @@ def help_dialog(event=None): root.bind('<>', flist.close_all_callback) # The binding above doesn't reliably work on all versions of Tk - # on MacOSX. Adding command definition below does seem to do the + # on macOS. Adding command definition below does seem to do the # right thing for now. root.createcommand('exit', flist.close_all_callback) diff --git a/Misc/NEWS.d/next/IDLE/2018-11-12-00-20-01.bpo-35213.cqNgzT.rst b/Misc/NEWS.d/next/IDLE/2018-11-12-00-20-01.bpo-35213.cqNgzT.rst new file mode 100644 index 000000000000..9d0e4e1220bb --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2018-11-12-00-20-01.bpo-35213.cqNgzT.rst @@ -0,0 +1 @@ +Where appropriate, use 'macOS' in idlelib. From webhook-mailer at python.org Thu Nov 15 14:31:56 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 15 Nov 2018 19:31:56 -0000 Subject: [Python-checkins] bpo-35213: Where appropriate, use 'macOS' in idlelib. (GH-10478) Message-ID: https://github.com/python/cpython/commit/be657c1fac3ce436976541cf2680a977217be813 commit: be657c1fac3ce436976541cf2680a977217be813 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-15T11:31:52-08:00 summary: bpo-35213: Where appropriate, use 'macOS' in idlelib. (GH-10478) (cherry picked from commit b65413b497a07f521d835b799be7dd0afcedbd65) Co-authored-by: Terry Jan Reedy files: A Misc/NEWS.d/next/IDLE/2018-11-12-00-20-01.bpo-35213.cqNgzT.rst M Doc/library/idle.rst M Lib/idlelib/config.py M Lib/idlelib/help.html M Lib/idlelib/iomenu.py M Lib/idlelib/macosx.py diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst index b91a3402f691..964d492e9093 100644 --- a/Doc/library/idle.rst +++ b/Doc/library/idle.rst @@ -20,7 +20,7 @@ IDLE has the following features: * coded in 100% pure Python, using the :mod:`tkinter` GUI toolkit -* cross-platform: works mostly the same on Windows, Unix, and Mac OS X +* cross-platform: works mostly the same on Windows, Unix, and macOS * Python shell window (interactive interpreter) with colorizing of code input, output, and error messages @@ -48,7 +48,7 @@ Output windows, such as used for Edit => Find in Files, are a subtype of editor window. They currently have the same top menu but a different default title and context menu. -On MacOS, there is one application menu. It dynamically changes according +On macOS, there is one application menu. It dynamically changes according to the window currently selected. It has an IDLE menu, and some entries described below are moved around to conform to Apple guidlines. @@ -267,7 +267,7 @@ Options menu (Shell and Editor) Configure IDLE Open a configuration dialog and change preferences for the following: fonts, indentation, keybindings, text color themes, startup windows and - size, additional help sources, and extensions (see below). On OS X, + size, additional help sources, and extensions (see below). On macOS, open the configuration dialog by selecting Preferences in the application menu. To use a new built-in color theme (IDLE Dark) with older IDLEs, save it as a new custom theme. @@ -324,7 +324,7 @@ on Help menu choices. Context Menus ^^^^^^^^^^^^^^^^^^^^^^^^^^ -Open a context menu by right-clicking in a window (Control-click on OS X). +Open a context menu by right-clicking in a window (Control-click on macOS). Context menus have the standard clipboard functions also on the Edit menu. Cut @@ -381,7 +381,7 @@ Key bindings ^^^^^^^^^^^^ In this section, 'C' refers to the :kbd:`Control` key on Windows and Unix and -the :kbd:`Command` key on Mac OSX. +the :kbd:`Command` key on macOS. * :kbd:`Backspace` deletes to the left; :kbd:`Del` deletes to the right @@ -526,9 +526,9 @@ code interactively. IDLE's Shell window also responds to the following keys. Command history * :kbd:`Alt-p` retrieves previous command matching what you have typed. On - OS X use :kbd:`C-p`. + macOS use :kbd:`C-p`. - * :kbd:`Alt-n` retrieves next. On OS X use :kbd:`C-n`. + * :kbd:`Alt-n` retrieves next. On macOS use :kbd:`C-n`. * :kbd:`Return` while on any previous command retrieves that command @@ -796,7 +796,7 @@ changed via Configure IDLE on the Option menu. Keys can be user defined; IDLE ships with four built-in key sets. In addition, a user can create a custom key set in the Configure IDLE dialog under the keys tab. -IDLE on MacOS +IDLE on macOS ^^^^^^^^^^^^^ Under System Preferences: Dock, one can set "Prefer tabs when opening diff --git a/Lib/idlelib/config.py b/Lib/idlelib/config.py index 0eb90fc8dc5f..79d988f9a186 100644 --- a/Lib/idlelib/config.py +++ b/Lib/idlelib/config.py @@ -562,12 +562,11 @@ def GetCurrentKeySet(self): result = self.GetKeySet(self.CurrentKeys()) if sys.platform == "darwin": - # OS X Tk variants do not support the "Alt" keyboard modifier. - # So replace all keybingings that use "Alt" with ones that - # use the "Option" keyboard modifier. - # TODO (Ned?): the "Option" modifier does not work properly for - # Cocoa Tk and XQuartz Tk so we should not use it - # in default OS X KeySets. + # macOS (OS X) Tk variants do not support the "Alt" + # keyboard modifier. Replace it with "Option". + # TODO (Ned?): the "Option" modifier does not work properly + # for Cocoa Tk and XQuartz Tk so we should not use it + # in the default 'OSX' keyset. for k, v in result.items(): v2 = [ x.replace('Navigation

        IDLE has the following features:

        • coded in 100% pure Python, using the tkinter GUI toolkit
        • -
        • cross-platform: works mostly the same on Windows, Unix, and Mac OS X
        • +
        • cross-platform: works mostly the same on Windows, Unix, and macOS
        • Python shell window (interactive interpreter) with colorizing of code input, output, and error messages
        • multi-window text editor with multiple undo, Python colorizing, @@ -128,7 +128,7 @@

          Menus

          Output windows, such as used for Edit => Find in Files, are a subtype of editor window. They currently have the same top menu but a different default title and context menu.

          -

          On MacOS, there is one application menu. It dynamically changes according +

          On macOS, there is one application menu. It dynamically changes according to the window currently selected. It has an IDLE menu, and some entries described below are moved around to conform to Apple guidlines.

        • @@ -757,7 +757,7 @@

          Setting preferences -

          IDLE on MacOS?

          +

          IDLE on macOS?

          Under System Preferences: Dock, one can set ?Prefer tabs when opening documents? to ?Always?. This setting is not compatible with the tk/tkinter GUI framework used by IDLE, and it breaks a few IDLE features.

          @@ -817,7 +817,7 @@

          Table of Contents

        • Help and preferences
        • @@ -899,7 +899,7 @@

          Navigation



          - Last updated on Nov 10, 2018. + Last updated on Nov 12, 2018. Found a bug?
          diff --git a/Lib/idlelib/iomenu.py b/Lib/idlelib/iomenu.py index fcd8dcc1393d..f5bced597aa8 100644 --- a/Lib/idlelib/iomenu.py +++ b/Lib/idlelib/iomenu.py @@ -41,7 +41,7 @@ # these problems, falling back to ASCII locale_encoding = locale.nl_langinfo(locale.CODESET) if locale_encoding is None or locale_encoding == '': - # situation occurs on Mac OS X + # situation occurs on macOS locale_encoding = 'ascii' codecs.lookup(locale_encoding) except (NameError, AttributeError, LookupError): @@ -51,7 +51,7 @@ try: locale_encoding = locale.getdefaultlocale()[1] if locale_encoding is None or locale_encoding == '': - # situation occurs on Mac OS X + # situation occurs on macOS locale_encoding = 'ascii' codecs.lookup(locale_encoding) except (ValueError, LookupError): diff --git a/Lib/idlelib/macosx.py b/Lib/idlelib/macosx.py index d3ae224100cf..8f8484a37015 100644 --- a/Lib/idlelib/macosx.py +++ b/Lib/idlelib/macosx.py @@ -1,5 +1,5 @@ """ -A number of functions that enhance IDLE on Mac OSX. +A number of functions that enhance IDLE on macOS. """ from sys import platform # Used in _init_tk_type, changed by test. @@ -192,7 +192,7 @@ def help_dialog(event=None): root.bind('<>', flist.close_all_callback) # The binding above doesn't reliably work on all versions of Tk - # on MacOSX. Adding command definition below does seem to do the + # on macOS. Adding command definition below does seem to do the # right thing for now. root.createcommand('exit', flist.close_all_callback) diff --git a/Misc/NEWS.d/next/IDLE/2018-11-12-00-20-01.bpo-35213.cqNgzT.rst b/Misc/NEWS.d/next/IDLE/2018-11-12-00-20-01.bpo-35213.cqNgzT.rst new file mode 100644 index 000000000000..9d0e4e1220bb --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2018-11-12-00-20-01.bpo-35213.cqNgzT.rst @@ -0,0 +1 @@ +Where appropriate, use 'macOS' in idlelib. From solipsis at pitrou.net Fri Nov 16 04:07:10 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Fri, 16 Nov 2018 09:07:10 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=5 Message-ID: <20181116090710.1.1E929CD6C03600F4@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [0, 7, -7] memory blocks, sum=0 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_forkserver leaked [1, -2, 2] memory blocks, sum=1 test_multiprocessing_spawn leaked [1, -2, 1] memory blocks, sum=0 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogtLsXd4', '--timeout', '7200'] From webhook-mailer at python.org Fri Nov 16 05:55:39 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 16 Nov 2018 10:55:39 -0000 Subject: [Python-checkins] bpo-35239: _PySys_EndInit() copies module_search_path (GH-10532) Message-ID: https://github.com/python/cpython/commit/37cd982df02795905886ab36a2378ed557cb6f60 commit: 37cd982df02795905886ab36a2378ed557cb6f60 branch: master author: Victor Stinner committer: GitHub date: 2018-11-16T11:55:35+01:00 summary: bpo-35239: _PySys_EndInit() copies module_search_path (GH-10532) * The _PySys_EndInit() function now copies the config->module_search_path list, so config is longer modified when sys.path is updated. * config->warnoptions list and config->xoptions dict are also copied * test_embed: InitConfigTests now also tests main_config['module_search_path'] * Fix _Py_InitializeMainInterpreter(): don't use config->warnoptions but sys.warnoptions to decide if the warnings module should be imported at startup. files: M Lib/test/test_embed.py M Python/pylifecycle.c M Python/sysmodule.c diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py index 75e31c211122..3f383d7fd50c 100644 --- a/Lib/test/test_embed.py +++ b/Lib/test/test_embed.py @@ -331,10 +331,6 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): }) # main config - UNTESTED_MAIN_CONFIG = ( - # FIXME: untested main configuration variables - 'module_search_path', - ) COPY_MAIN_CONFIG = ( # Copy core config to main config for expected values 'argv', @@ -346,7 +342,8 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): 'prefix', 'pycache_prefix', 'warnoptions', - # xoptions is created from core_config in check_main_config() + # xoptions is created from core_config in check_main_config(). + # 'module_search_paths' is copied to 'module_search_path'. ) # global config @@ -426,12 +423,10 @@ def check_main_config(self, config): main_config = config['main_config'] # main config - for key in self.UNTESTED_MAIN_CONFIG: - del main_config[key] - expected_main = {} for key in self.COPY_MAIN_CONFIG: expected_main[key] = core_config[key] + expected_main['module_search_path'] = core_config['module_search_paths'] expected_main['xoptions'] = self.main_xoptions(core_config['xoptions']) self.assertEqual(main_config, expected_main) diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 4ccea2ece207..58e16473100e 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -836,8 +836,8 @@ _Py_InitializeMainInterpreter(PyInterpreterState *interp, } /* Initialize warnings. */ - if (interp->config.warnoptions != NULL && - PyList_Size(interp->config.warnoptions) > 0) + PyObject *warnoptions = PySys_GetObject("warnoptions"); + if (warnoptions != NULL && PyList_Size(warnoptions) > 0) { PyObject *warnings_module = PyImport_ImportModule("warnings"); if (warnings_module == NULL) { diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 99cab2b4d9e3..2284e88d4c11 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -2488,7 +2488,20 @@ _PySys_EndInit(PyObject *sysdict, PyInterpreterState *interp) assert(config->exec_prefix != NULL); assert(config->base_exec_prefix != NULL); - SET_SYS_FROM_STRING_BORROW("path", config->module_search_path); +#define COPY_LIST(KEY, ATTR) \ + do { \ + assert(PyList_Check(config->ATTR)); \ + PyObject *list = PyList_GetSlice(config->ATTR, \ + 0, PyList_GET_SIZE(config->ATTR)); \ + if (list == NULL) { \ + return -1; \ + } \ + SET_SYS_FROM_STRING_BORROW(KEY, list); \ + Py_DECREF(list); \ + } while (0) + + COPY_LIST("path", module_search_path); + SET_SYS_FROM_STRING_BORROW("executable", config->executable); SET_SYS_FROM_STRING_BORROW("prefix", config->prefix); SET_SYS_FROM_STRING_BORROW("base_prefix", config->base_prefix); @@ -2505,12 +2518,19 @@ _PySys_EndInit(PyObject *sysdict, PyInterpreterState *interp) SET_SYS_FROM_STRING_BORROW("argv", config->argv); } if (config->warnoptions != NULL) { - SET_SYS_FROM_STRING_BORROW("warnoptions", config->warnoptions); + COPY_LIST("warnoptions", warnoptions); } if (config->xoptions != NULL) { - SET_SYS_FROM_STRING_BORROW("_xoptions", config->xoptions); + PyObject *dict = PyDict_Copy(config->xoptions); + if (dict == NULL) { + return -1; + } + SET_SYS_FROM_STRING_BORROW("_xoptions", dict); + Py_DECREF(dict); } +#undef COPY_LIST + /* Set flags to their final values */ SET_SYS_FROM_STRING_INT_RESULT("flags", make_flags()); /* prevent user from creating new instances */ From webhook-mailer at python.org Fri Nov 16 06:34:38 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 16 Nov 2018 11:34:38 -0000 Subject: [Python-checkins] bpo-35239: _PySys_EndInit() copies module_search_path (GH-10532) Message-ID: https://github.com/python/cpython/commit/d2be9a5c13221fb84c2221bbfd93efac6111e697 commit: d2be9a5c13221fb84c2221bbfd93efac6111e697 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-16T03:34:35-08:00 summary: bpo-35239: _PySys_EndInit() copies module_search_path (GH-10532) * The _PySys_EndInit() function now copies the config->module_search_path list, so config is longer modified when sys.path is updated. * config->warnoptions list and config->xoptions dict are also copied * test_embed: InitConfigTests now also tests main_config['module_search_path'] * Fix _Py_InitializeMainInterpreter(): don't use config->warnoptions but sys.warnoptions to decide if the warnings module should be imported at startup. (cherry picked from commit 37cd982df02795905886ab36a2378ed557cb6f60) Co-authored-by: Victor Stinner files: M Lib/test/test_embed.py M Python/pylifecycle.c M Python/sysmodule.c diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py index 81f64f5048ac..e6c8c8070b86 100644 --- a/Lib/test/test_embed.py +++ b/Lib/test/test_embed.py @@ -301,10 +301,6 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): } # main config - UNTESTED_MAIN_CONFIG = ( - # FIXME: untested main configuration variables - 'module_search_path', - ) COPY_MAIN_CONFIG = ( # Copy core config to main config for expected values 'argv', @@ -315,7 +311,8 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): 'install_signal_handlers', 'prefix', 'warnoptions', - # xoptions is created from core_config in check_main_config() + # xoptions is created from core_config in check_main_config(). + # 'module_search_paths' is copied to 'module_search_path'. ) # global config @@ -389,12 +386,10 @@ def check_main_config(self, config): main_config = config['main_config'] # main config - for key in self.UNTESTED_MAIN_CONFIG: - del main_config[key] - expected_main = {} for key in self.COPY_MAIN_CONFIG: expected_main[key] = core_config[key] + expected_main['module_search_path'] = core_config['module_search_paths'] expected_main['xoptions'] = self.main_xoptions(core_config['xoptions']) self.assertEqual(main_config, expected_main) diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 86f95de8336f..7eaf376d1a6a 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -967,8 +967,8 @@ _Py_InitializeMainInterpreter(PyInterpreterState *interp, } /* Initialize warnings. */ - if (interp->config.warnoptions != NULL && - PyList_Size(interp->config.warnoptions) > 0) + PyObject *warnoptions = PySys_GetObject("warnoptions"); + if (warnoptions != NULL && PyList_Size(warnoptions) > 0) { PyObject *warnings_module = PyImport_ImportModule("warnings"); if (warnings_module == NULL) { diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 498fa91fcc3d..48d8fa4c6e04 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -2464,7 +2464,20 @@ _PySys_EndInit(PyObject *sysdict, _PyMainInterpreterConfig *config) assert(config->exec_prefix != NULL); assert(config->base_exec_prefix != NULL); - SET_SYS_FROM_STRING_BORROW("path", config->module_search_path); +#define COPY_LIST(KEY, ATTR) \ + do { \ + assert(PyList_Check(config->ATTR)); \ + PyObject *list = PyList_GetSlice(config->ATTR, \ + 0, PyList_GET_SIZE(config->ATTR)); \ + if (list == NULL) { \ + return -1; \ + } \ + SET_SYS_FROM_STRING_BORROW(KEY, list); \ + Py_DECREF(list); \ + } while (0) + + COPY_LIST("path", module_search_path); + SET_SYS_FROM_STRING_BORROW("executable", config->executable); SET_SYS_FROM_STRING_BORROW("prefix", config->prefix); SET_SYS_FROM_STRING_BORROW("base_prefix", config->base_prefix); @@ -2475,12 +2488,19 @@ _PySys_EndInit(PyObject *sysdict, _PyMainInterpreterConfig *config) SET_SYS_FROM_STRING_BORROW("argv", config->argv); } if (config->warnoptions != NULL) { - SET_SYS_FROM_STRING_BORROW("warnoptions", config->warnoptions); + COPY_LIST("warnoptions", warnoptions); } if (config->xoptions != NULL) { - SET_SYS_FROM_STRING_BORROW("_xoptions", config->xoptions); + PyObject *dict = PyDict_Copy(config->xoptions); + if (dict == NULL) { + return -1; + } + SET_SYS_FROM_STRING_BORROW("_xoptions", dict); + Py_DECREF(dict); } +#undef COPY_LIST + /* Set flags to their final values */ SET_SYS_FROM_STRING_INT_RESULT("flags", make_flags()); /* prevent user from creating new instances */ From webhook-mailer at python.org Fri Nov 16 06:42:04 2018 From: webhook-mailer at python.org (INADA Naoki) Date: Fri, 16 Nov 2018 11:42:04 -0000 Subject: [Python-checkins] bpo-33816: Remove outdated metaclass example (GH-7566) Message-ID: https://github.com/python/cpython/commit/c2ccac7b9f9a1132ca36255b0ddfeecef4371aa3 commit: c2ccac7b9f9a1132ca36255b0ddfeecef4371aa3 branch: master author: Andr?s Delfino committer: INADA Naoki date: 2018-11-16T20:41:55+09:00 summary: bpo-33816: Remove outdated metaclass example (GH-7566) files: M Doc/reference/datamodel.rst diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 24c647d1a8d2..79fde4bdc792 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -1998,46 +1998,14 @@ becomes the :attr:`~object.__dict__` attribute of the class object. Describes the implicit ``__class__`` closure reference -Metaclass example -^^^^^^^^^^^^^^^^^ +Uses for metaclasses +^^^^^^^^^^^^^^^^^^^^ The potential uses for metaclasses are boundless. Some ideas that have been explored include enum, logging, interface checking, automatic delegation, automatic property creation, proxies, frameworks, and automatic resource locking/synchronization. -Here is an example of a metaclass that uses an :class:`collections.OrderedDict` -to remember the order that class variables are defined:: - - class OrderedClass(type): - - @classmethod - def __prepare__(metacls, name, bases, **kwds): - return collections.OrderedDict() - - def __new__(cls, name, bases, namespace, **kwds): - result = type.__new__(cls, name, bases, dict(namespace)) - result.members = tuple(namespace) - return result - - class A(metaclass=OrderedClass): - def one(self): pass - def two(self): pass - def three(self): pass - def four(self): pass - - >>> A.members - ('__module__', 'one', 'two', 'three', 'four') - -When the class definition for *A* gets executed, the process begins with -calling the metaclass's :meth:`__prepare__` method which returns an empty -:class:`collections.OrderedDict`. That mapping records the methods and -attributes of *A* as they are defined within the body of the class statement. -Once those definitions are executed, the ordered dictionary is fully populated -and the metaclass's :meth:`__new__` method gets invoked. That method builds -the new type and it saves the ordered dictionary keys in an attribute -called ``members``. - Customizing instance and subclass checks ---------------------------------------- From webhook-mailer at python.org Fri Nov 16 06:51:23 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 16 Nov 2018 11:51:23 -0000 Subject: [Python-checkins] bpo-33816: Remove outdated metaclass example (GH-7566) Message-ID: https://github.com/python/cpython/commit/1b80a373d104480c51cacb8b07ec3b61e21d5fa0 commit: 1b80a373d104480c51cacb8b07ec3b61e21d5fa0 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-16T03:51:20-08:00 summary: bpo-33816: Remove outdated metaclass example (GH-7566) (cherry picked from commit c2ccac7b9f9a1132ca36255b0ddfeecef4371aa3) Co-authored-by: Andr?s Delfino files: M Doc/reference/datamodel.rst diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index be9b3ad1af69..96e35744c8ae 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -1999,46 +1999,14 @@ becomes the :attr:`~object.__dict__` attribute of the class object. Describes the implicit ``__class__`` closure reference -Metaclass example -^^^^^^^^^^^^^^^^^ +Uses for metaclasses +^^^^^^^^^^^^^^^^^^^^ The potential uses for metaclasses are boundless. Some ideas that have been explored include enum, logging, interface checking, automatic delegation, automatic property creation, proxies, frameworks, and automatic resource locking/synchronization. -Here is an example of a metaclass that uses an :class:`collections.OrderedDict` -to remember the order that class variables are defined:: - - class OrderedClass(type): - - @classmethod - def __prepare__(metacls, name, bases, **kwds): - return collections.OrderedDict() - - def __new__(cls, name, bases, namespace, **kwds): - result = type.__new__(cls, name, bases, dict(namespace)) - result.members = tuple(namespace) - return result - - class A(metaclass=OrderedClass): - def one(self): pass - def two(self): pass - def three(self): pass - def four(self): pass - - >>> A.members - ('__module__', 'one', 'two', 'three', 'four') - -When the class definition for *A* gets executed, the process begins with -calling the metaclass's :meth:`__prepare__` method which returns an empty -:class:`collections.OrderedDict`. That mapping records the methods and -attributes of *A* as they are defined within the body of the class statement. -Once those definitions are executed, the ordered dictionary is fully populated -and the metaclass's :meth:`__new__` method gets invoked. That method builds -the new type and it saves the ordered dictionary keys in an attribute -called ``members``. - Customizing instance and subclass checks ---------------------------------------- From webhook-mailer at python.org Fri Nov 16 06:58:12 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 16 Nov 2018 11:58:12 -0000 Subject: [Python-checkins] bpo-33816: Remove outdated metaclass example (GH-7566) Message-ID: https://github.com/python/cpython/commit/46fa7a60e08fc7486ecab726af93fa2cfe225305 commit: 46fa7a60e08fc7486ecab726af93fa2cfe225305 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-16T03:58:09-08:00 summary: bpo-33816: Remove outdated metaclass example (GH-7566) (cherry picked from commit c2ccac7b9f9a1132ca36255b0ddfeecef4371aa3) Co-authored-by: Andr?s Delfino files: M Doc/reference/datamodel.rst diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 18067c2d09ea..abf06357e7f9 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -1918,46 +1918,14 @@ becomes the :attr:`~object.__dict__` attribute of the class object. Describes the implicit ``__class__`` closure reference -Metaclass example -^^^^^^^^^^^^^^^^^ +Uses for metaclasses +^^^^^^^^^^^^^^^^^^^^ The potential uses for metaclasses are boundless. Some ideas that have been explored include enum, logging, interface checking, automatic delegation, automatic property creation, proxies, frameworks, and automatic resource locking/synchronization. -Here is an example of a metaclass that uses an :class:`collections.OrderedDict` -to remember the order that class variables are defined:: - - class OrderedClass(type): - - @classmethod - def __prepare__(metacls, name, bases, **kwds): - return collections.OrderedDict() - - def __new__(cls, name, bases, namespace, **kwds): - result = type.__new__(cls, name, bases, dict(namespace)) - result.members = tuple(namespace) - return result - - class A(metaclass=OrderedClass): - def one(self): pass - def two(self): pass - def three(self): pass - def four(self): pass - - >>> A.members - ('__module__', 'one', 'two', 'three', 'four') - -When the class definition for *A* gets executed, the process begins with -calling the metaclass's :meth:`__prepare__` method which returns an empty -:class:`collections.OrderedDict`. That mapping records the methods and -attributes of *A* as they are defined within the body of the class statement. -Once those definitions are executed, the ordered dictionary is fully populated -and the metaclass's :meth:`__new__` method gets invoked. That method builds -the new type and it saves the ordered dictionary keys in an attribute -called ``members``. - Customizing instance and subclass checks ---------------------------------------- From webhook-mailer at python.org Fri Nov 16 06:58:22 2018 From: webhook-mailer at python.org (INADA Naoki) Date: Fri, 16 Nov 2018 11:58:22 -0000 Subject: [Python-checkins] Fix outdated info in datamodel about dicts (GH-9807) Message-ID: https://github.com/python/cpython/commit/a48e0eb9673ec96d1decb8a230331533cfb6138b commit: a48e0eb9673ec96d1decb8a230331533cfb6138b branch: master author: wim glenn committer: INADA Naoki date: 2018-11-16T20:58:19+09:00 summary: Fix outdated info in datamodel about dicts (GH-9807) files: M Doc/reference/datamodel.rst diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 79fde4bdc792..7e2d2e66cac8 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -1452,8 +1452,8 @@ Basic customization dict insertion, O(n^2) complexity. See http://www.ocert.org/advisories/ocert-2011-003.html for details. - Changing hash values affects the iteration order of dicts, sets and - other mappings. Python has never made guarantees about this ordering + Changing hash values affects the iteration order of sets. + Python has never made guarantees about this ordering (and it typically varies between 32-bit and 64-bit builds). See also :envvar:`PYTHONHASHSEED`. From webhook-mailer at python.org Fri Nov 16 07:20:06 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 16 Nov 2018 12:20:06 -0000 Subject: [Python-checkins] Fix outdated info in datamodel about dicts (GH-9807) Message-ID: https://github.com/python/cpython/commit/be34cb26b92e6249a1e485479bf5ff60979e5a6d commit: be34cb26b92e6249a1e485479bf5ff60979e5a6d branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-16T04:20:03-08:00 summary: Fix outdated info in datamodel about dicts (GH-9807) (cherry picked from commit a48e0eb9673ec96d1decb8a230331533cfb6138b) Co-authored-by: wim glenn files: M Doc/reference/datamodel.rst diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 96e35744c8ae..02319509ca37 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -1452,8 +1452,8 @@ Basic customization dict insertion, O(n^2) complexity. See http://www.ocert.org/advisories/ocert-2011-003.html for details. - Changing hash values affects the iteration order of dicts, sets and - other mappings. Python has never made guarantees about this ordering + Changing hash values affects the iteration order of sets. + Python has never made guarantees about this ordering (and it typically varies between 32-bit and 64-bit builds). See also :envvar:`PYTHONHASHSEED`. From webhook-mailer at python.org Fri Nov 16 08:28:54 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Fri, 16 Nov 2018 13:28:54 -0000 Subject: [Python-checkins] bpo-35250: Correct argument name "num" -> "btn" in turtle docs. (GH-10565) Message-ID: https://github.com/python/cpython/commit/4edeaeac4c194ba5d09187640b5cfca5e03be617 commit: 4edeaeac4c194ba5d09187640b5cfca5e03be617 branch: master author: Srinivas Thatiparthy (?????????? ?????????) committer: Serhiy Storchaka date: 2018-11-16T15:28:51+02:00 summary: bpo-35250: Correct argument name "num" -> "btn" in turtle docs. (GH-10565) files: M Doc/library/turtle.rst M Lib/turtle.py diff --git a/Doc/library/turtle.rst b/Doc/library/turtle.rst index 83903648b427..3d90d3cbd974 100644 --- a/Doc/library/turtle.rst +++ b/Doc/library/turtle.rst @@ -1360,7 +1360,7 @@ Using events :param fun: a function with two arguments which will be called with the coordinates of the clicked point on the canvas - :param num: number of the mouse-button, defaults to 1 (left mouse button) + :param btn: number of the mouse-button, defaults to 1 (left mouse button) :param add: ``True`` or ``False`` -- if ``True``, a new binding will be added, otherwise it will replace a former binding @@ -1382,7 +1382,7 @@ Using events :param fun: a function with two arguments which will be called with the coordinates of the clicked point on the canvas - :param num: number of the mouse-button, defaults to 1 (left mouse button) + :param btn: number of the mouse-button, defaults to 1 (left mouse button) :param add: ``True`` or ``False`` -- if ``True``, a new binding will be added, otherwise it will replace a former binding @@ -1407,7 +1407,7 @@ Using events :param fun: a function with two arguments which will be called with the coordinates of the clicked point on the canvas - :param num: number of the mouse-button, defaults to 1 (left mouse button) + :param btn: number of the mouse-button, defaults to 1 (left mouse button) :param add: ``True`` or ``False`` -- if ``True``, a new binding will be added, otherwise it will replace a former binding @@ -1805,7 +1805,7 @@ Using screen events :param fun: a function with two arguments which will be called with the coordinates of the clicked point on the canvas - :param num: number of the mouse-button, defaults to 1 (left mouse button) + :param btn: number of the mouse-button, defaults to 1 (left mouse button) :param add: ``True`` or ``False`` -- if ``True``, a new binding will be added, otherwise it will replace a former binding diff --git a/Lib/turtle.py b/Lib/turtle.py index 9db564b7eb8b..47a94f2a4702 100644 --- a/Lib/turtle.py +++ b/Lib/turtle.py @@ -1352,7 +1352,7 @@ def onclick(self, fun, btn=1, add=None): Arguments: fun -- a function with two arguments, the coordinates of the clicked point on the canvas. - num -- the number of the mouse-button, defaults to 1 + btn -- the number of the mouse-button, defaults to 1 Example (for a TurtleScreen instance named screen) @@ -3526,7 +3526,7 @@ def onclick(self, fun, btn=1, add=None): Arguments: fun -- a function with two arguments, to which will be assigned the coordinates of the clicked point on the canvas. - num -- number of the mouse-button defaults to 1 (left mouse button). + btn -- number of the mouse-button defaults to 1 (left mouse button). add -- True or False. If True, new binding will be added, otherwise it will replace a former binding. @@ -3547,7 +3547,7 @@ def onrelease(self, fun, btn=1, add=None): Arguments: fun -- a function with two arguments, to which will be assigned the coordinates of the clicked point on the canvas. - num -- number of the mouse-button defaults to 1 (left mouse button). + btn -- number of the mouse-button defaults to 1 (left mouse button). Example (for a MyTurtle instance named joe): >>> class MyTurtle(Turtle): @@ -3572,7 +3572,7 @@ def ondrag(self, fun, btn=1, add=None): Arguments: fun -- a function with two arguments, to which will be assigned the coordinates of the clicked point on the canvas. - num -- number of the mouse-button defaults to 1 (left mouse button). + btn -- number of the mouse-button defaults to 1 (left mouse button). Every sequence of mouse-move-events on a turtle is preceded by a mouse-click event on that turtle. From webhook-mailer at python.org Fri Nov 16 08:55:17 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 16 Nov 2018 13:55:17 -0000 Subject: [Python-checkins] bpo-35250: Correct argument name "num" -> "btn" in turtle docs. (GH-10565) Message-ID: https://github.com/python/cpython/commit/0461c3b635d53e8e75145695803a2fca288a1689 commit: 0461c3b635d53e8e75145695803a2fca288a1689 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-16T05:55:14-08:00 summary: bpo-35250: Correct argument name "num" -> "btn" in turtle docs. (GH-10565) (cherry picked from commit 4edeaeac4c194ba5d09187640b5cfca5e03be617) Co-authored-by: Srinivas Thatiparthy (?????????? ?????????) files: M Doc/library/turtle.rst M Lib/turtle.py diff --git a/Doc/library/turtle.rst b/Doc/library/turtle.rst index 595a244342c4..175010b89906 100644 --- a/Doc/library/turtle.rst +++ b/Doc/library/turtle.rst @@ -1309,7 +1309,7 @@ Using events :param fun: a function with two arguments which will be called with the coordinates of the clicked point on the canvas - :param num: number of the mouse-button, defaults to 1 (left mouse button) + :param btn: number of the mouse-button, defaults to 1 (left mouse button) :param add: ``True`` or ``False`` -- if ``True``, a new binding will be added, otherwise it will replace a former binding @@ -1330,7 +1330,7 @@ Using events :param fun: a function with two arguments which will be called with the coordinates of the clicked point on the canvas - :param num: number of the mouse-button, defaults to 1 (left mouse button) + :param btn: number of the mouse-button, defaults to 1 (left mouse button) :param add: ``True`` or ``False`` -- if ``True``, a new binding will be added, otherwise it will replace a former binding @@ -1354,7 +1354,7 @@ Using events :param fun: a function with two arguments which will be called with the coordinates of the clicked point on the canvas - :param num: number of the mouse-button, defaults to 1 (left mouse button) + :param btn: number of the mouse-button, defaults to 1 (left mouse button) :param add: ``True`` or ``False`` -- if ``True``, a new binding will be added, otherwise it will replace a former binding @@ -1735,7 +1735,7 @@ Using screen events :param fun: a function with two arguments which will be called with the coordinates of the clicked point on the canvas - :param num: number of the mouse-button, defaults to 1 (left mouse button) + :param btn: number of the mouse-button, defaults to 1 (left mouse button) :param add: ``True`` or ``False`` -- if ``True``, a new binding will be added, otherwise it will replace a former binding diff --git a/Lib/turtle.py b/Lib/turtle.py index 9db564b7eb8b..47a94f2a4702 100644 --- a/Lib/turtle.py +++ b/Lib/turtle.py @@ -1352,7 +1352,7 @@ def onclick(self, fun, btn=1, add=None): Arguments: fun -- a function with two arguments, the coordinates of the clicked point on the canvas. - num -- the number of the mouse-button, defaults to 1 + btn -- the number of the mouse-button, defaults to 1 Example (for a TurtleScreen instance named screen) @@ -3526,7 +3526,7 @@ def onclick(self, fun, btn=1, add=None): Arguments: fun -- a function with two arguments, to which will be assigned the coordinates of the clicked point on the canvas. - num -- number of the mouse-button defaults to 1 (left mouse button). + btn -- number of the mouse-button defaults to 1 (left mouse button). add -- True or False. If True, new binding will be added, otherwise it will replace a former binding. @@ -3547,7 +3547,7 @@ def onrelease(self, fun, btn=1, add=None): Arguments: fun -- a function with two arguments, to which will be assigned the coordinates of the clicked point on the canvas. - num -- number of the mouse-button defaults to 1 (left mouse button). + btn -- number of the mouse-button defaults to 1 (left mouse button). Example (for a MyTurtle instance named joe): >>> class MyTurtle(Turtle): @@ -3572,7 +3572,7 @@ def ondrag(self, fun, btn=1, add=None): Arguments: fun -- a function with two arguments, to which will be assigned the coordinates of the clicked point on the canvas. - num -- number of the mouse-button defaults to 1 (left mouse button). + btn -- number of the mouse-button defaults to 1 (left mouse button). Every sequence of mouse-move-events on a turtle is preceded by a mouse-click event on that turtle. From webhook-mailer at python.org Fri Nov 16 08:56:37 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 16 Nov 2018 13:56:37 -0000 Subject: [Python-checkins] bpo-35250: Correct argument name "num" -> "btn" in turtle docs. (GH-10565) Message-ID: https://github.com/python/cpython/commit/8856246c41b0663bfe8d3af7d52a7c337e25572d commit: 8856246c41b0663bfe8d3af7d52a7c337e25572d branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-16T05:56:33-08:00 summary: bpo-35250: Correct argument name "num" -> "btn" in turtle docs. (GH-10565) (cherry picked from commit 4edeaeac4c194ba5d09187640b5cfca5e03be617) Co-authored-by: Srinivas Thatiparthy (?????????? ?????????) files: M Doc/library/turtle.rst M Lib/turtle.py diff --git a/Doc/library/turtle.rst b/Doc/library/turtle.rst index 2b5d3e567d6c..8135c9330e1e 100644 --- a/Doc/library/turtle.rst +++ b/Doc/library/turtle.rst @@ -1310,7 +1310,7 @@ Using events :param fun: a function with two arguments which will be called with the coordinates of the clicked point on the canvas - :param num: number of the mouse-button, defaults to 1 (left mouse button) + :param btn: number of the mouse-button, defaults to 1 (left mouse button) :param add: ``True`` or ``False`` -- if ``True``, a new binding will be added, otherwise it will replace a former binding @@ -1331,7 +1331,7 @@ Using events :param fun: a function with two arguments which will be called with the coordinates of the clicked point on the canvas - :param num: number of the mouse-button, defaults to 1 (left mouse button) + :param btn: number of the mouse-button, defaults to 1 (left mouse button) :param add: ``True`` or ``False`` -- if ``True``, a new binding will be added, otherwise it will replace a former binding @@ -1355,7 +1355,7 @@ Using events :param fun: a function with two arguments which will be called with the coordinates of the clicked point on the canvas - :param num: number of the mouse-button, defaults to 1 (left mouse button) + :param btn: number of the mouse-button, defaults to 1 (left mouse button) :param add: ``True`` or ``False`` -- if ``True``, a new binding will be added, otherwise it will replace a former binding @@ -1736,7 +1736,7 @@ Using screen events :param fun: a function with two arguments which will be called with the coordinates of the clicked point on the canvas - :param num: number of the mouse-button, defaults to 1 (left mouse button) + :param btn: number of the mouse-button, defaults to 1 (left mouse button) :param add: ``True`` or ``False`` -- if ``True``, a new binding will be added, otherwise it will replace a former binding diff --git a/Lib/turtle.py b/Lib/turtle.py index 8036b7faaa82..f3b92e31cabb 100644 --- a/Lib/turtle.py +++ b/Lib/turtle.py @@ -1352,7 +1352,7 @@ def onclick(self, fun, btn=1, add=None): Arguments: fun -- a function with two arguments, the coordinates of the clicked point on the canvas. - num -- the number of the mouse-button, defaults to 1 + btn -- the number of the mouse-button, defaults to 1 Example (for a TurtleScreen instance named screen) @@ -3526,7 +3526,7 @@ def onclick(self, fun, btn=1, add=None): Arguments: fun -- a function with two arguments, to which will be assigned the coordinates of the clicked point on the canvas. - num -- number of the mouse-button defaults to 1 (left mouse button). + btn -- number of the mouse-button defaults to 1 (left mouse button). add -- True or False. If True, new binding will be added, otherwise it will replace a former binding. @@ -3547,7 +3547,7 @@ def onrelease(self, fun, btn=1, add=None): Arguments: fun -- a function with two arguments, to which will be assigned the coordinates of the clicked point on the canvas. - num -- number of the mouse-button defaults to 1 (left mouse button). + btn -- number of the mouse-button defaults to 1 (left mouse button). Example (for a MyTurtle instance named joe): >>> class MyTurtle(Turtle): @@ -3572,7 +3572,7 @@ def ondrag(self, fun, btn=1, add=None): Arguments: fun -- a function with two arguments, to which will be assigned the coordinates of the clicked point on the canvas. - num -- number of the mouse-button defaults to 1 (left mouse button). + btn -- number of the mouse-button defaults to 1 (left mouse button). Every sequence of mouse-move-events on a turtle is preceded by a mouse-click event on that turtle. From webhook-mailer at python.org Fri Nov 16 10:33:01 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Fri, 16 Nov 2018 15:33:01 -0000 Subject: [Python-checkins] bpo-35202: Remove unused imports in tests. (GH-10561) Message-ID: https://github.com/python/cpython/commit/90d0cfb22269261333e82a7c8a17b66d6695f7b6 commit: 90d0cfb22269261333e82a7c8a17b66d6695f7b6 branch: master author: Srinivas Thatiparthy (?????????? ?????????) committer: Serhiy Storchaka date: 2018-11-16T17:32:58+02:00 summary: bpo-35202: Remove unused imports in tests. (GH-10561) files: M Lib/test/test_aifc.py M Lib/test/test_asyncio/test_selector_events.py M Lib/test/test_coroutines.py M Lib/test/test_frozen.py M Lib/test/test_future.py M Lib/test/test_gdb.py M Lib/test/test_importlib/test_locks.py M Lib/test/test_minidom.py M Lib/test/test_netrc.py M Lib/test/test_platform.py M Lib/test/test_resource.py M Lib/test/test_sax.py M Lib/test/test_ssl.py M Lib/test/test_time.py M Lib/test/test_traceback.py M Lib/test/test_urlparse.py M Lib/test/test_utf8_mode.py diff --git a/Lib/test/test_aifc.py b/Lib/test/test_aifc.py index ff52f5b6feb8..c74758413d6c 100644 --- a/Lib/test/test_aifc.py +++ b/Lib/test/test_aifc.py @@ -7,8 +7,6 @@ import sys import struct import aifc -import warnings - class AifcTest(audiotests.AudioWriteTests, audiotests.AudioTestsWithSourceFile): diff --git a/Lib/test/test_asyncio/test_selector_events.py b/Lib/test/test_asyncio/test_selector_events.py index 236ed38b5577..b99e8e696070 100644 --- a/Lib/test/test_asyncio/test_selector_events.py +++ b/Lib/test/test_asyncio/test_selector_events.py @@ -1,6 +1,5 @@ """Tests for selector_events.py""" -import errno import selectors import socket import unittest diff --git a/Lib/test/test_coroutines.py b/Lib/test/test_coroutines.py index 091b6626dcc8..8443e658a620 100644 --- a/Lib/test/test_coroutines.py +++ b/Lib/test/test_coroutines.py @@ -2,7 +2,6 @@ import copy import inspect import pickle -import re import sys import types import unittest diff --git a/Lib/test/test_frozen.py b/Lib/test/test_frozen.py index a7c748422b1d..142f17d518e7 100644 --- a/Lib/test/test_frozen.py +++ b/Lib/test/test_frozen.py @@ -13,7 +13,6 @@ import sys import unittest from test.support import captured_stdout -from importlib import util class TestFrozen(unittest.TestCase): diff --git a/Lib/test/test_future.py b/Lib/test/test_future.py index 4f2f9d272e7f..c60a016f01f4 100644 --- a/Lib/test/test_future.py +++ b/Lib/test/test_future.py @@ -1,6 +1,5 @@ # Test various flavors of legal and illegal future statements -from functools import partial import unittest from test import support from textwrap import dedent diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py index 711fb69ebdff..4d1ce4ed96c0 100644 --- a/Lib/test/test_gdb.py +++ b/Lib/test/test_gdb.py @@ -3,7 +3,6 @@ # The code for testing gdb was adapted from similar work in Unladen Swallow's # Lib/test/test_jit_gdb.py -import locale import os import platform import re diff --git a/Lib/test/test_importlib/test_locks.py b/Lib/test/test_importlib/test_locks.py index d86172ab5837..21794d911ef6 100644 --- a/Lib/test/test_importlib/test_locks.py +++ b/Lib/test/test_importlib/test_locks.py @@ -4,7 +4,6 @@ import sys import threading -import unittest import weakref from test import support diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py index ad5be2f0f0e2..e626e14a5622 100644 --- a/Lib/test/test_minidom.py +++ b/Lib/test/test_minidom.py @@ -3,7 +3,6 @@ import copy import pickle import io -import contextlib from test.support import findfile import unittest diff --git a/Lib/test/test_netrc.py b/Lib/test/test_netrc.py index f59e5371acad..ae53988c45a6 100644 --- a/Lib/test/test_netrc.py +++ b/Lib/test/test_netrc.py @@ -1,5 +1,4 @@ import netrc, os, unittest, sys, tempfile, textwrap -from unittest import mock from test import support diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py index c26e193e6536..c92da904fc5b 100644 --- a/Lib/test/test_platform.py +++ b/Lib/test/test_platform.py @@ -1,4 +1,3 @@ -from unittest import mock import os import platform import subprocess diff --git a/Lib/test/test_resource.py b/Lib/test/test_resource.py index b07eb73b2aeb..62c7963fe699 100644 --- a/Lib/test/test_resource.py +++ b/Lib/test/test_resource.py @@ -1,6 +1,5 @@ import contextlib import sys -import os import unittest from test import support import time diff --git a/Lib/test/test_sax.py b/Lib/test/test_sax.py index 894d86ac71f0..9addc06f20dd 100644 --- a/Lib/test/test_sax.py +++ b/Lib/test/test_sax.py @@ -17,7 +17,6 @@ from xml.sax.xmlreader import InputSource, AttributesImpl, AttributesNSImpl from io import BytesIO, StringIO import codecs -import gc import os.path import shutil from urllib.error import URLError diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 6fd2002e5eec..74a91f6c2396 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -17,7 +17,6 @@ import asyncore import weakref import platform -import functools import sysconfig try: import ctypes diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py index 62abd891aafa..16b48a92f327 100644 --- a/Lib/test/test_time.py +++ b/Lib/test/test_time.py @@ -9,7 +9,6 @@ import time import threading import unittest -import warnings try: import _testcapi except ImportError: diff --git a/Lib/test/test_traceback.py b/Lib/test/test_traceback.py index a8240b41c084..96d85e2cb8a1 100644 --- a/Lib/test/test_traceback.py +++ b/Lib/test/test_traceback.py @@ -110,7 +110,7 @@ def test_encoded_file(self): # Test that tracebacks are correctly printed for encoded source files: # - correct line number (Issue2384) # - respect file encoding (Issue3975) - import tempfile, sys, subprocess, os + import sys, subprocess # The spawned subprocess has its stdout redirected to a PIPE, and its # encoding may be different from the current interpreter, on Windows diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py index 6738863f8def..9c71be53afd4 100644 --- a/Lib/test/test_urlparse.py +++ b/Lib/test/test_urlparse.py @@ -1,6 +1,5 @@ import unittest import urllib.parse -import warnings RFC1808_BASE = "http://a/b/c/d;p?q#f" RFC2396_BASE = "http://a/b/c/d;p?q" diff --git a/Lib/test/test_utf8_mode.py b/Lib/test/test_utf8_mode.py index 7280ce77ef82..220ff34a1189 100644 --- a/Lib/test/test_utf8_mode.py +++ b/Lib/test/test_utf8_mode.py @@ -3,7 +3,6 @@ """ import locale -import os import sys import textwrap import unittest From webhook-mailer at python.org Fri Nov 16 11:31:55 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 16 Nov 2018 16:31:55 -0000 Subject: [Python-checkins] Add a missed PyErr_NoMemory() in symtable_new(). (GH-10576) Message-ID: https://github.com/python/cpython/commit/0ee5409aea7eefd6a0deff697247657c75437c4e commit: 0ee5409aea7eefd6a0deff697247657c75437c4e branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-16T08:31:47-08:00 summary: Add a missed PyErr_NoMemory() in symtable_new(). (GH-10576) This missed PyErr_NoMemory() could cause a SystemError when calling _symtable.symtable(). (cherry picked from commit ad65f15581173542f1d2a9968a63bee272510ce3) Co-authored-by: Zackery Spytz files: M Python/symtable.c diff --git a/Python/symtable.c b/Python/symtable.c index 81eea95f4907..177bb6d436c6 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -215,8 +215,10 @@ symtable_new(void) struct symtable *st; st = (struct symtable *)PyMem_Malloc(sizeof(struct symtable)); - if (st == NULL) + if (st == NULL) { + PyErr_NoMemory(); return NULL; + } st->st_filename = NULL; st->st_blocks = NULL; From webhook-mailer at python.org Fri Nov 16 11:32:00 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 16 Nov 2018 16:32:00 -0000 Subject: [Python-checkins] Add a missed PyErr_NoMemory() in symtable_new(). (GH-10576) Message-ID: https://github.com/python/cpython/commit/0124040aef793b66c33e518c6e9c17129bee0de4 commit: 0124040aef793b66c33e518c6e9c17129bee0de4 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-16T08:31:57-08:00 summary: Add a missed PyErr_NoMemory() in symtable_new(). (GH-10576) This missed PyErr_NoMemory() could cause a SystemError when calling _symtable.symtable(). (cherry picked from commit ad65f15581173542f1d2a9968a63bee272510ce3) Co-authored-by: Zackery Spytz files: M Python/symtable.c diff --git a/Python/symtable.c b/Python/symtable.c index 90b07efa0334..aef845b59698 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -206,8 +206,10 @@ symtable_new(void) struct symtable *st; st = (struct symtable *)PyMem_Malloc(sizeof(struct symtable)); - if (st == NULL) + if (st == NULL) { + PyErr_NoMemory(); return NULL; + } st->st_filename = NULL; st->st_blocks = NULL; From webhook-mailer at python.org Fri Nov 16 11:32:10 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 16 Nov 2018 16:32:10 -0000 Subject: [Python-checkins] Add a missed PyErr_NoMemory() in symtable_new(). (GH-10576) Message-ID: https://github.com/python/cpython/commit/e45fa7393b3e9eb3f1879305ad851f1db2809996 commit: e45fa7393b3e9eb3f1879305ad851f1db2809996 branch: 2.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-16T08:32:07-08:00 summary: Add a missed PyErr_NoMemory() in symtable_new(). (GH-10576) This missed PyErr_NoMemory() could cause a SystemError when calling _symtable.symtable(). (cherry picked from commit ad65f15581173542f1d2a9968a63bee272510ce3) Co-authored-by: Zackery Spytz files: M Python/symtable.c diff --git a/Python/symtable.c b/Python/symtable.c index 21790b1cd187..23aeaaa76f61 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -199,8 +199,10 @@ symtable_new(void) struct symtable *st; st = (struct symtable *)PyMem_Malloc(sizeof(struct symtable)); - if (st == NULL) + if (st == NULL) { + PyErr_NoMemory(); return NULL; + } st->st_filename = NULL; st->st_symbols = NULL; From webhook-mailer at python.org Fri Nov 16 18:52:58 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 16 Nov 2018 23:52:58 -0000 Subject: [Python-checkins] bpo-28401: prevent Py_DEBUG builds from trying to import limited ABI modules (GH-1766) Message-ID: https://github.com/python/cpython/commit/338d54f0a59dc5e5b6c9e7397340169f3a3f8ea4 commit: 338d54f0a59dc5e5b6c9e7397340169f3a3f8ea4 branch: master author: Stefano Rivera committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-11-16T15:52:52-08:00 summary: bpo-28401: prevent Py_DEBUG builds from trying to import limited ABI modules (GH-1766) [Issue 28401](https://bugs.python.org/issue28401): Don't attempt to import the stable API extensions, they are not supported in PyDEBUG builds (which don't implement that ABI). https://bugs.python.org/issue28401 files: A Misc/NEWS.d/next/Core and Builtins/2018-11-03-10-37-29.bpo-28401.RprDIg.rst M Python/dynload_shlib.c diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-11-03-10-37-29.bpo-28401.RprDIg.rst b/Misc/NEWS.d/next/Core and Builtins/2018-11-03-10-37-29.bpo-28401.RprDIg.rst new file mode 100644 index 000000000000..8fbba7826df9 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-11-03-10-37-29.bpo-28401.RprDIg.rst @@ -0,0 +1,3 @@ +Debug builds will no longer to attempt to import extension modules built +for the ABI as they were never compatible to begin with. +Patch by Stefano Rivera. diff --git a/Python/dynload_shlib.c b/Python/dynload_shlib.c index feebd8976d0a..e5bddaab6caa 100644 --- a/Python/dynload_shlib.c +++ b/Python/dynload_shlib.c @@ -38,7 +38,9 @@ const char *_PyImport_DynLoadFiletab[] = { ".dll", #else /* !__CYGWIN__ */ "." SOABI ".so", +#ifndef Py_DEBUG ".abi" PYTHON_ABI_STRING ".so", +#endif /* ! Py_DEBUG */ ".so", #endif /* __CYGWIN__ */ NULL, From webhook-mailer at python.org Sat Nov 17 01:38:05 2018 From: webhook-mailer at python.org (Terry Jan Reedy) Date: Sat, 17 Nov 2018 06:38:05 -0000 Subject: [Python-checkins] bpo-35202: Remove more unused imports in idlelib (GH-10573) Message-ID: https://github.com/python/cpython/commit/5a087d5401e6956cf4c6d95f15fedabf39a4f5af commit: 5a087d5401e6956cf4c6d95f15fedabf39a4f5af branch: master author: Srinivas Reddy Thatiparthy (?????????? ?????? ?????????) committer: Terry Jan Reedy date: 2018-11-17T01:38:01-05:00 summary: bpo-35202: Remove more unused imports in idlelib (GH-10573) files: M Lib/idlelib/idle_test/test_browser.py M Lib/idlelib/idle_test/test_config_key.py M Lib/idlelib/idle_test/test_configdialog.py M Lib/idlelib/idle_test/test_zoomheight.py diff --git a/Lib/idlelib/idle_test/test_browser.py b/Lib/idlelib/idle_test/test_browser.py index 905dc1f47e34..dfbab6dd6b5e 100644 --- a/Lib/idlelib/idle_test/test_browser.py +++ b/Lib/idlelib/idle_test/test_browser.py @@ -11,7 +11,6 @@ import pyclbr from tkinter import Tk -from idlelib import filelist from idlelib.tree import TreeNode diff --git a/Lib/idlelib/idle_test/test_config_key.py b/Lib/idlelib/idle_test/test_config_key.py index 5031daadee0a..abe574912c55 100644 --- a/Lib/idlelib/idle_test/test_config_key.py +++ b/Lib/idlelib/idle_test/test_config_key.py @@ -5,7 +5,7 @@ import unittest from tkinter import Tk from idlelib.idle_test.mock_idle import Func -from idlelib.idle_test.mock_tk import Var, Mbox_func +from idlelib.idle_test.mock_tk import Mbox_func class ValidationTest(unittest.TestCase): diff --git a/Lib/idlelib/idle_test/test_configdialog.py b/Lib/idlelib/idle_test/test_configdialog.py index dbfcd01c63ea..5472a04c187c 100644 --- a/Lib/idlelib/idle_test/test_configdialog.py +++ b/Lib/idlelib/idle_test/test_configdialog.py @@ -8,7 +8,7 @@ import unittest from unittest import mock from idlelib.idle_test.mock_idle import Func -from tkinter import Tk, Frame, StringVar, IntVar, BooleanVar, DISABLED, NORMAL +from tkinter import Tk, StringVar, IntVar, BooleanVar, DISABLED, NORMAL from idlelib import config from idlelib.configdialog import idleConf, changes, tracers diff --git a/Lib/idlelib/idle_test/test_zoomheight.py b/Lib/idlelib/idle_test/test_zoomheight.py index bac86ac249f6..aa5bdfb4fbd4 100644 --- a/Lib/idlelib/idle_test/test_zoomheight.py +++ b/Lib/idlelib/idle_test/test_zoomheight.py @@ -4,7 +4,7 @@ from idlelib import zoomheight import unittest from test.support import requires -from tkinter import Tk, Text +from tkinter import Tk from idlelib.editor import EditorWindow From webhook-mailer at python.org Sat Nov 17 01:48:45 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 17 Nov 2018 06:48:45 -0000 Subject: [Python-checkins] bpo-35202: Remove more unused imports in idlelib (GH-10573) Message-ID: https://github.com/python/cpython/commit/3a600d224c1e1106756cc71639232ae1acae45bd commit: 3a600d224c1e1106756cc71639232ae1acae45bd branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-16T22:48:40-08:00 summary: bpo-35202: Remove more unused imports in idlelib (GH-10573) (cherry picked from commit 5a087d5401e6956cf4c6d95f15fedabf39a4f5af) Co-authored-by: Srinivas Reddy Thatiparthy (?????????? ?????? ?????????) files: M Lib/idlelib/idle_test/test_browser.py M Lib/idlelib/idle_test/test_config_key.py M Lib/idlelib/idle_test/test_configdialog.py M Lib/idlelib/idle_test/test_zoomheight.py diff --git a/Lib/idlelib/idle_test/test_browser.py b/Lib/idlelib/idle_test/test_browser.py index 905dc1f47e34..dfbab6dd6b5e 100644 --- a/Lib/idlelib/idle_test/test_browser.py +++ b/Lib/idlelib/idle_test/test_browser.py @@ -11,7 +11,6 @@ import pyclbr from tkinter import Tk -from idlelib import filelist from idlelib.tree import TreeNode diff --git a/Lib/idlelib/idle_test/test_config_key.py b/Lib/idlelib/idle_test/test_config_key.py index 5031daadee0a..abe574912c55 100644 --- a/Lib/idlelib/idle_test/test_config_key.py +++ b/Lib/idlelib/idle_test/test_config_key.py @@ -5,7 +5,7 @@ import unittest from tkinter import Tk from idlelib.idle_test.mock_idle import Func -from idlelib.idle_test.mock_tk import Var, Mbox_func +from idlelib.idle_test.mock_tk import Mbox_func class ValidationTest(unittest.TestCase): diff --git a/Lib/idlelib/idle_test/test_configdialog.py b/Lib/idlelib/idle_test/test_configdialog.py index dbfcd01c63ea..5472a04c187c 100644 --- a/Lib/idlelib/idle_test/test_configdialog.py +++ b/Lib/idlelib/idle_test/test_configdialog.py @@ -8,7 +8,7 @@ import unittest from unittest import mock from idlelib.idle_test.mock_idle import Func -from tkinter import Tk, Frame, StringVar, IntVar, BooleanVar, DISABLED, NORMAL +from tkinter import Tk, StringVar, IntVar, BooleanVar, DISABLED, NORMAL from idlelib import config from idlelib.configdialog import idleConf, changes, tracers diff --git a/Lib/idlelib/idle_test/test_zoomheight.py b/Lib/idlelib/idle_test/test_zoomheight.py index bac86ac249f6..aa5bdfb4fbd4 100644 --- a/Lib/idlelib/idle_test/test_zoomheight.py +++ b/Lib/idlelib/idle_test/test_zoomheight.py @@ -4,7 +4,7 @@ from idlelib import zoomheight import unittest from test.support import requires -from tkinter import Tk, Text +from tkinter import Tk from idlelib.editor import EditorWindow From webhook-mailer at python.org Sat Nov 17 02:00:35 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 17 Nov 2018 07:00:35 -0000 Subject: [Python-checkins] bpo-35202: Remove more unused imports in idlelib (GH-10573) Message-ID: https://github.com/python/cpython/commit/8d816f74d7673c836b16e4423fed0ec6ee510290 commit: 8d816f74d7673c836b16e4423fed0ec6ee510290 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-16T23:00:32-08:00 summary: bpo-35202: Remove more unused imports in idlelib (GH-10573) (cherry picked from commit 5a087d5401e6956cf4c6d95f15fedabf39a4f5af) Co-authored-by: Srinivas Reddy Thatiparthy (?????????? ?????? ?????????) files: M Lib/idlelib/idle_test/test_browser.py M Lib/idlelib/idle_test/test_config_key.py M Lib/idlelib/idle_test/test_configdialog.py M Lib/idlelib/idle_test/test_zoomheight.py diff --git a/Lib/idlelib/idle_test/test_browser.py b/Lib/idlelib/idle_test/test_browser.py index 35cc34690194..70345f8e741f 100644 --- a/Lib/idlelib/idle_test/test_browser.py +++ b/Lib/idlelib/idle_test/test_browser.py @@ -11,7 +11,6 @@ from idlelib import _pyclbr as pyclbr from tkinter import Tk -from idlelib import filelist from idlelib.tree import TreeNode diff --git a/Lib/idlelib/idle_test/test_config_key.py b/Lib/idlelib/idle_test/test_config_key.py index 5031daadee0a..abe574912c55 100644 --- a/Lib/idlelib/idle_test/test_config_key.py +++ b/Lib/idlelib/idle_test/test_config_key.py @@ -5,7 +5,7 @@ import unittest from tkinter import Tk from idlelib.idle_test.mock_idle import Func -from idlelib.idle_test.mock_tk import Var, Mbox_func +from idlelib.idle_test.mock_tk import Mbox_func class ValidationTest(unittest.TestCase): diff --git a/Lib/idlelib/idle_test/test_configdialog.py b/Lib/idlelib/idle_test/test_configdialog.py index dbfcd01c63ea..5472a04c187c 100644 --- a/Lib/idlelib/idle_test/test_configdialog.py +++ b/Lib/idlelib/idle_test/test_configdialog.py @@ -8,7 +8,7 @@ import unittest from unittest import mock from idlelib.idle_test.mock_idle import Func -from tkinter import Tk, Frame, StringVar, IntVar, BooleanVar, DISABLED, NORMAL +from tkinter import Tk, StringVar, IntVar, BooleanVar, DISABLED, NORMAL from idlelib import config from idlelib.configdialog import idleConf, changes, tracers diff --git a/Lib/idlelib/idle_test/test_zoomheight.py b/Lib/idlelib/idle_test/test_zoomheight.py index bac86ac249f6..aa5bdfb4fbd4 100644 --- a/Lib/idlelib/idle_test/test_zoomheight.py +++ b/Lib/idlelib/idle_test/test_zoomheight.py @@ -4,7 +4,7 @@ from idlelib import zoomheight import unittest from test.support import requires -from tkinter import Tk, Text +from tkinter import Tk from idlelib.editor import EditorWindow From solipsis at pitrou.net Sat Nov 17 04:06:10 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Sat, 17 Nov 2018 09:06:10 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=23 Message-ID: <20181117090610.1.042F248D423717C5@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [-7, 1, 0] memory blocks, sum=-6 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_logging leaked [0, 0, 26] memory blocks, sum=26 test_multiprocessing_forkserver leaked [-1, 2, -2] memory blocks, sum=-1 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogZbPlPQ', '--timeout', '7200'] From webhook-mailer at python.org Sat Nov 17 07:14:48 2018 From: webhook-mailer at python.org (Steve Dower) Date: Sat, 17 Nov 2018 12:14:48 -0000 Subject: [Python-checkins] Add --tempdir option for test run (GH-10322) Message-ID: https://github.com/python/cpython/commit/38df97a03c5102e717a110ab69bff8e5c9ebfd08 commit: 38df97a03c5102e717a110ab69bff8e5c9ebfd08 branch: master author: Steve Dower committer: GitHub date: 2018-11-17T04:14:36-08:00 summary: Add --tempdir option for test run (GH-10322) files: M .azure-pipelines/windows-steps.yml M Lib/test/libregrtest/cmdline.py M Lib/test/libregrtest/main.py diff --git a/.azure-pipelines/windows-steps.yml b/.azure-pipelines/windows-steps.yml index d8d5f1753a07..c3175841a9b8 100644 --- a/.azure-pipelines/windows-steps.yml +++ b/.azure-pipelines/windows-steps.yml @@ -17,7 +17,7 @@ steps: - script: python.bat -m test.pythoninfo displayName: 'Display build info' -- script: PCbuild\rt.bat -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0 --junit-xml="$(Build.BinariesDirectory)\test-results.xml" +- script: PCbuild\rt.bat -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0 --junit-xml="$(Build.BinariesDirectory)\test-results.xml" --tempdir="$(Build.BinariesDirectory)\test" displayName: 'Tests' env: PREFIX: $(Py_OutDir)\$(arch) diff --git a/Lib/test/libregrtest/cmdline.py b/Lib/test/libregrtest/cmdline.py index 538ff05489ea..09270323611f 100644 --- a/Lib/test/libregrtest/cmdline.py +++ b/Lib/test/libregrtest/cmdline.py @@ -271,7 +271,8 @@ def _create_parser(): group.add_argument('--junit-xml', dest='xmlpath', metavar='FILENAME', help='writes JUnit-style XML results to the specified ' 'file') - + group.add_argument('--tempdir', dest='tempdir', metavar='PATH', + help='override the working directory for the test run') return parser @@ -383,8 +384,7 @@ def _parse_args(args, **kwargs): if ns.match_filename: if ns.match_tests is None: ns.match_tests = [] - filename = os.path.join(support.SAVEDCWD, ns.match_filename) - with open(filename) as fp: + with open(ns.match_filename) as fp: for line in fp: ns.match_tests.append(line.strip()) diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py index 1fd41320d111..a8d27ae5f332 100644 --- a/Lib/test/libregrtest/main.py +++ b/Lib/test/libregrtest/main.py @@ -550,12 +550,12 @@ def save_xml_result(self): def main(self, tests=None, **kwargs): global TEMPDIR + self.ns = self.parse_args(kwargs) - if sysconfig.is_python_build(): - try: - os.mkdir(TEMPDIR) - except FileExistsError: - pass + if self.ns.tempdir: + TEMPDIR = self.ns.tempdir + + os.makedirs(TEMPDIR, exist_ok=True) # Define a writable temp dir that will be used as cwd while running # the tests. The name of the dir includes the pid to allow parallel @@ -571,8 +571,6 @@ def main(self, tests=None, **kwargs): self._main(tests, kwargs) def _main(self, tests, kwargs): - self.ns = self.parse_args(kwargs) - if self.ns.huntrleaks: warmup, repetitions, _ = self.ns.huntrleaks if warmup < 1 or repetitions < 1: From webhook-mailer at python.org Sat Nov 17 07:31:52 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 17 Nov 2018 12:31:52 -0000 Subject: [Python-checkins] Add --tempdir option for test run (GH-10322) Message-ID: https://github.com/python/cpython/commit/f415aa1eef091db099a661a187646b1a76878487 commit: f415aa1eef091db099a661a187646b1a76878487 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-17T04:31:47-08:00 summary: Add --tempdir option for test run (GH-10322) (cherry picked from commit 38df97a03c5102e717a110ab69bff8e5c9ebfd08) Co-authored-by: Steve Dower files: M .azure-pipelines/windows-steps.yml M Lib/test/libregrtest/cmdline.py M Lib/test/libregrtest/main.py diff --git a/.azure-pipelines/windows-steps.yml b/.azure-pipelines/windows-steps.yml index d8d5f1753a07..c3175841a9b8 100644 --- a/.azure-pipelines/windows-steps.yml +++ b/.azure-pipelines/windows-steps.yml @@ -17,7 +17,7 @@ steps: - script: python.bat -m test.pythoninfo displayName: 'Display build info' -- script: PCbuild\rt.bat -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0 --junit-xml="$(Build.BinariesDirectory)\test-results.xml" +- script: PCbuild\rt.bat -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0 --junit-xml="$(Build.BinariesDirectory)\test-results.xml" --tempdir="$(Build.BinariesDirectory)\test" displayName: 'Tests' env: PREFIX: $(Py_OutDir)\$(arch) diff --git a/Lib/test/libregrtest/cmdline.py b/Lib/test/libregrtest/cmdline.py index 2af839a182db..c08491fc0462 100644 --- a/Lib/test/libregrtest/cmdline.py +++ b/Lib/test/libregrtest/cmdline.py @@ -271,7 +271,8 @@ def _create_parser(): group.add_argument('--junit-xml', dest='xmlpath', metavar='FILENAME', help='writes JUnit-style XML results to the specified ' 'file') - + group.add_argument('--tempdir', dest='tempdir', metavar='PATH', + help='override the working directory for the test run') return parser @@ -383,8 +384,7 @@ def _parse_args(args, **kwargs): if ns.match_filename: if ns.match_tests is None: ns.match_tests = [] - filename = os.path.join(support.SAVEDCWD, ns.match_filename) - with open(filename) as fp: + with open(ns.match_filename) as fp: for line in fp: ns.match_tests.append(line.strip()) diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py index b491a08c2424..1438966d4a50 100644 --- a/Lib/test/libregrtest/main.py +++ b/Lib/test/libregrtest/main.py @@ -550,12 +550,12 @@ def save_xml_result(self): def main(self, tests=None, **kwargs): global TEMPDIR + self.ns = self.parse_args(kwargs) - if sysconfig.is_python_build(): - try: - os.mkdir(TEMPDIR) - except FileExistsError: - pass + if self.ns.tempdir: + TEMPDIR = self.ns.tempdir + + os.makedirs(TEMPDIR, exist_ok=True) # Define a writable temp dir that will be used as cwd while running # the tests. The name of the dir includes the pid to allow parallel @@ -571,8 +571,6 @@ def main(self, tests=None, **kwargs): self._main(tests, kwargs) def _main(self, tests, kwargs): - self.ns = self.parse_args(kwargs) - if self.ns.huntrleaks: warmup, repetitions, _ = self.ns.huntrleaks if warmup < 1 or repetitions < 1: From webhook-mailer at python.org Sat Nov 17 14:16:54 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 17 Nov 2018 19:16:54 -0000 Subject: [Python-checkins] bpo-25438: document what codec PyMemberDef T_STRING decodes the char * as (GH-10580) Message-ID: https://github.com/python/cpython/commit/689d555ec135d4115574addd063c358ac4897cc4 commit: 689d555ec135d4115574addd063c358ac4897cc4 branch: master author: Windson yang committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-11-17T11:16:51-08:00 summary: bpo-25438: document what codec PyMemberDef T_STRING decodes the char * as (GH-10580) Source of T_STRING: https://github.com/python/cpython/blob/e42b705188271da108de42b55d9344642170aa2b/Python/structmember.c#L51 Source of PyUnicode_FromString https://github.com/python/cpython/blob/master/Include/unicodeobject.h#L702 https://bugs.python.org/issue25438 files: M Doc/c-api/structures.rst diff --git a/Doc/c-api/structures.rst b/Doc/c-api/structures.rst index 797b9045fa8e..da45da1d3c70 100644 --- a/Doc/c-api/structures.rst +++ b/Doc/c-api/structures.rst @@ -292,7 +292,8 @@ definition with the same method name. :attr:`flags` can be ``0`` for write and read access or :c:macro:`READONLY` for read-only access. Using :c:macro:`T_STRING` for :attr:`type` implies - :c:macro:`READONLY`. Only :c:macro:`T_OBJECT` and :c:macro:`T_OBJECT_EX` + :c:macro:`READONLY`. :c:macro:`T_STRING` data is interpreted as UTF-8. + Only :c:macro:`T_OBJECT` and :c:macro:`T_OBJECT_EX` members can be deleted. (They are set to *NULL*). From webhook-mailer at python.org Sat Nov 17 14:50:02 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 17 Nov 2018 19:50:02 -0000 Subject: [Python-checkins] [3.7] bpo-25438: document what codec PyMemberDef T_STRING decodes the char * as (GH-10580) (GH-10586) Message-ID: https://github.com/python/cpython/commit/d1a97b36595726074a83452e5c476806936becba commit: d1a97b36595726074a83452e5c476806936becba branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-17T11:49:58-08:00 summary: [3.7] bpo-25438: document what codec PyMemberDef T_STRING decodes the char * as (GH-10580) (GH-10586) Source of T_STRING: https://github.com/python/cpython/blob/e42b705188271da108de42b55d9344642170aa2b/Python/structmember.cGH-L51 Source of PyUnicode_FromString https://github.com/python/cpython/blob/master/Include/unicodeobject.hGH-L702 https://bugs.python.org/issue25438 (cherry picked from commit 689d555ec135d4115574addd063c358ac4897cc4) Co-authored-by: Windson yang https://bugs.python.org/issue25438 files: M Doc/c-api/structures.rst diff --git a/Doc/c-api/structures.rst b/Doc/c-api/structures.rst index 797b9045fa8e..da45da1d3c70 100644 --- a/Doc/c-api/structures.rst +++ b/Doc/c-api/structures.rst @@ -292,7 +292,8 @@ definition with the same method name. :attr:`flags` can be ``0`` for write and read access or :c:macro:`READONLY` for read-only access. Using :c:macro:`T_STRING` for :attr:`type` implies - :c:macro:`READONLY`. Only :c:macro:`T_OBJECT` and :c:macro:`T_OBJECT_EX` + :c:macro:`READONLY`. :c:macro:`T_STRING` data is interpreted as UTF-8. + Only :c:macro:`T_OBJECT` and :c:macro:`T_OBJECT_EX` members can be deleted. (They are set to *NULL*). From webhook-mailer at python.org Sat Nov 17 14:50:28 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 17 Nov 2018 19:50:28 -0000 Subject: [Python-checkins] [3.6] bpo-25438: document what codec PyMemberDef T_STRING decodes the char * as (GH-10580) (GH-10587) Message-ID: https://github.com/python/cpython/commit/8945017be4cc9527767bb66673e73e28e4b0b4d3 commit: 8945017be4cc9527767bb66673e73e28e4b0b4d3 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-17T11:50:25-08:00 summary: [3.6] bpo-25438: document what codec PyMemberDef T_STRING decodes the char * as (GH-10580) (GH-10587) Source of T_STRING: https://github.com/python/cpython/blob/e42b705188271da108de42b55d9344642170aa2b/Python/structmember.cGH-L51 Source of PyUnicode_FromString https://github.com/python/cpython/blob/master/Include/unicodeobject.hGH-L702 https://bugs.python.org/issue25438 (cherry picked from commit 689d555ec135d4115574addd063c358ac4897cc4) Co-authored-by: Windson yang https://bugs.python.org/issue25438 files: M Doc/c-api/structures.rst diff --git a/Doc/c-api/structures.rst b/Doc/c-api/structures.rst index 675f6f26921c..c493f6469d68 100644 --- a/Doc/c-api/structures.rst +++ b/Doc/c-api/structures.rst @@ -292,7 +292,8 @@ definition with the same method name. :attr:`flags` can be ``0`` for write and read access or :c:macro:`READONLY` for read-only access. Using :c:macro:`T_STRING` for :attr:`type` implies - :c:macro:`READONLY`. Only :c:macro:`T_OBJECT` and :c:macro:`T_OBJECT_EX` + :c:macro:`READONLY`. :c:macro:`T_STRING` data is interpreted as UTF-8. + Only :c:macro:`T_OBJECT` and :c:macro:`T_OBJECT_EX` members can be deleted. (They are set to *NULL*). From webhook-mailer at python.org Sat Nov 17 23:42:01 2018 From: webhook-mailer at python.org (Steve Dower) Date: Sun, 18 Nov 2018 04:42:01 -0000 Subject: [Python-checkins] bpo-34725: Adds _Py_SetProgramFullPath so embedders may override sys.executable (GH-9860) Message-ID: https://github.com/python/cpython/commit/177a41a07b7d13c70d068ea0962f07e625ae171e commit: 177a41a07b7d13c70d068ea0962f07e625ae171e branch: master author: Steve Dower committer: GitHub date: 2018-11-17T20:41:48-08:00 summary: bpo-34725: Adds _Py_SetProgramFullPath so embedders may override sys.executable (GH-9860) files: A Misc/NEWS.d/next/C API/2018-10-13-16-30-54.bpo-34725.j52rIS.rst M Include/internal/pycore_pathconfig.h M Include/pylifecycle.h M PC/getpathp.c M Python/coreconfig.c M Python/pathconfig.c diff --git a/Include/internal/pycore_pathconfig.h b/Include/internal/pycore_pathconfig.h index 267e690976da..c0731525ca10 100644 --- a/Include/internal/pycore_pathconfig.h +++ b/Include/internal/pycore_pathconfig.h @@ -26,10 +26,9 @@ typedef struct _PyPathConfig { /* Full path to the Python program */ wchar_t *program_full_path; wchar_t *prefix; + wchar_t *exec_prefix; #ifdef MS_WINDOWS wchar_t *dll_path; -#else - wchar_t *exec_prefix; #endif /* Set by Py_SetPath(), or computed by _PyPathConfig_Init() */ wchar_t *module_search_path; diff --git a/Include/pylifecycle.h b/Include/pylifecycle.h index 7d383aa0899a..93fb26b43fe8 100644 --- a/Include/pylifecycle.h +++ b/Include/pylifecycle.h @@ -7,12 +7,6 @@ extern "C" { #endif -PyAPI_FUNC(void) Py_SetProgramName(const wchar_t *); -PyAPI_FUNC(wchar_t *) Py_GetProgramName(void); - -PyAPI_FUNC(void) Py_SetPythonHome(const wchar_t *); -PyAPI_FUNC(wchar_t *) Py_GetPythonHome(void); - #ifndef Py_LIMITED_API /* Only used by applications that embed the interpreter and need to * override the standard encoding determination mechanism @@ -83,8 +77,18 @@ PyAPI_FUNC(int) Py_FdIsInteractive(FILE *, const char *); /* Bootstrap __main__ (defined in Modules/main.c) */ PyAPI_FUNC(int) Py_Main(int argc, wchar_t **argv); -/* In getpath.c */ +/* In pathconfig.c */ +PyAPI_FUNC(void) Py_SetProgramName(const wchar_t *); +PyAPI_FUNC(wchar_t *) Py_GetProgramName(void); + +PyAPI_FUNC(void) Py_SetPythonHome(const wchar_t *); +PyAPI_FUNC(wchar_t *) Py_GetPythonHome(void); + +#ifndef Py_LIMITED_API +PyAPI_FUNC(void) _Py_SetProgramFullPath(const wchar_t *); +#endif PyAPI_FUNC(wchar_t *) Py_GetProgramFullPath(void); + PyAPI_FUNC(wchar_t *) Py_GetPrefix(void); PyAPI_FUNC(wchar_t *) Py_GetExecPrefix(void); PyAPI_FUNC(wchar_t *) Py_GetPath(void); diff --git a/Misc/NEWS.d/next/C API/2018-10-13-16-30-54.bpo-34725.j52rIS.rst b/Misc/NEWS.d/next/C API/2018-10-13-16-30-54.bpo-34725.j52rIS.rst new file mode 100644 index 000000000000..b5bc1bf0c723 --- /dev/null +++ b/Misc/NEWS.d/next/C API/2018-10-13-16-30-54.bpo-34725.j52rIS.rst @@ -0,0 +1 @@ +Adds _Py_SetProgramFullPath so embedders may override sys.executable diff --git a/PC/getpathp.c b/PC/getpathp.c index ee9d3d258f68..25f371fc9f9d 100644 --- a/PC/getpathp.c +++ b/PC/getpathp.c @@ -982,6 +982,10 @@ calculate_path_impl(const _PyCoreConfig *core_config, if (config->prefix == NULL) { return _Py_INIT_NO_MEMORY(); } + config->exec_prefix = _PyMem_RawWcsdup(prefix); + if (config->exec_prefix == NULL) { + return _Py_INIT_NO_MEMORY(); + } return _Py_INIT_OK(); } diff --git a/Python/coreconfig.c b/Python/coreconfig.c index a040a865ae1d..ad22300e56e4 100644 --- a/Python/coreconfig.c +++ b/Python/coreconfig.c @@ -662,6 +662,23 @@ config_init_program_name(_PyCoreConfig *config) return _Py_INIT_OK(); } +static _PyInitError +config_init_executable(_PyCoreConfig *config) +{ + assert(config->executable == NULL); + + /* If Py_SetProgramFullPath() was called, use its value */ + const wchar_t *program_full_path = _Py_path_config.program_full_path; + if (program_full_path != NULL) { + config->executable = _PyMem_RawWcsdup(program_full_path); + if (config->executable == NULL) { + return _Py_INIT_NO_MEMORY(); + } + return _Py_INIT_OK(); + } + + return _Py_INIT_OK(); +} static const wchar_t* config_get_xoption(const _PyCoreConfig *config, wchar_t *name) @@ -1370,6 +1387,13 @@ _PyCoreConfig_Read(_PyCoreConfig *config) } } + if (config->executable == NULL) { + err = config_init_executable(config); + if (_Py_INIT_FAILED(err)) { + return err; + } + } + if (config->utf8_mode < 0 || config->coerce_c_locale < 0) { config_init_locale(config); } diff --git a/Python/pathconfig.c b/Python/pathconfig.c index 6a8688059825..342a9448f795 100644 --- a/Python/pathconfig.c +++ b/Python/pathconfig.c @@ -49,10 +49,9 @@ _PyPathConfig_Clear(_PyPathConfig *config) CLEAR(config->prefix); CLEAR(config->program_full_path); + CLEAR(config->exec_prefix); #ifdef MS_WINDOWS CLEAR(config->dll_path); -#else - CLEAR(config->exec_prefix); #endif CLEAR(config->module_search_path); CLEAR(config->home); @@ -74,8 +73,8 @@ _PyPathConfig_Calculate(_PyPathConfig *path_config, PyMemAllocatorEx old_alloc; _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, &old_alloc); - /* Calculate program_full_path, prefix, exec_prefix (Unix) - or dll_path (Windows), and module_search_path */ + /* Calculate program_full_path, prefix, exec_prefix, + dll_path (Windows), and module_search_path */ err = _PyPathConfig_Calculate_impl(&new_config, core_config); if (_Py_INIT_FAILED(err)) { goto err; @@ -126,10 +125,9 @@ _PyPathConfig_SetGlobal(const _PyPathConfig *config) COPY_ATTR(program_full_path); COPY_ATTR(prefix); + COPY_ATTR(exec_prefix); #ifdef MS_WINDOWS COPY_ATTR(dll_path); -#else - COPY_ATTR(exec_prefix); #endif COPY_ATTR(module_search_path); COPY_ATTR(program_name); @@ -208,12 +206,11 @@ _PyCoreConfig_SetPathConfig(const _PyCoreConfig *core_config) if (copy_wstr(&path_config.prefix, core_config->prefix) < 0) { goto no_memory; } -#ifdef MS_WINDOWS - if (copy_wstr(&path_config.dll_path, core_config->dll_path) < 0) { + if (copy_wstr(&path_config.exec_prefix, core_config->exec_prefix) < 0) { goto no_memory; } -#else - if (copy_wstr(&path_config.exec_prefix, core_config->exec_prefix) < 0) { +#ifdef MS_WINDOWS + if (copy_wstr(&path_config.dll_path, core_config->dll_path) < 0) { goto no_memory; } #endif @@ -317,12 +314,8 @@ _PyCoreConfig_CalculatePathConfig(_PyCoreConfig *config) } if (config->exec_prefix == NULL) { -#ifdef MS_WINDOWS - wchar_t *exec_prefix = path_config.prefix; -#else - wchar_t *exec_prefix = path_config.exec_prefix; -#endif - if (copy_wstr(&config->exec_prefix, exec_prefix) < 0) { + if (copy_wstr(&config->exec_prefix, + path_config.exec_prefix) < 0) { goto no_memory; } } @@ -379,7 +372,8 @@ _PyCoreConfig_InitPathConfig(_PyCoreConfig *config) } if (config->base_exec_prefix == NULL) { - if (copy_wstr(&config->base_exec_prefix, config->exec_prefix) < 0) { + if (copy_wstr(&config->base_exec_prefix, + config->exec_prefix) < 0) { return _Py_INIT_NO_MEMORY(); } } @@ -435,12 +429,11 @@ Py_SetPath(const wchar_t *path) int alloc_error = (new_config.program_full_path == NULL); new_config.prefix = _PyMem_RawWcsdup(L""); alloc_error |= (new_config.prefix == NULL); + new_config.exec_prefix = _PyMem_RawWcsdup(L""); + alloc_error |= (new_config.exec_prefix == NULL); #ifdef MS_WINDOWS new_config.dll_path = _PyMem_RawWcsdup(L""); alloc_error |= (new_config.dll_path == NULL); -#else - new_config.exec_prefix = _PyMem_RawWcsdup(L""); - alloc_error |= (new_config.exec_prefix == NULL); #endif new_config.module_search_path = _PyMem_RawWcsdup(path); alloc_error |= (new_config.module_search_path == NULL); @@ -503,6 +496,26 @@ Py_SetProgramName(const wchar_t *program_name) } } +void +_Py_SetProgramFullPath(const wchar_t *program_full_path) +{ + if (program_full_path == NULL || program_full_path[0] == L'\0') { + return; + } + + PyMemAllocatorEx old_alloc; + _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, &old_alloc); + + PyMem_RawFree(_Py_path_config.program_full_path); + _Py_path_config.program_full_path = _PyMem_RawWcsdup(program_full_path); + + PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); + + if (_Py_path_config.program_full_path == NULL) { + Py_FatalError("_Py_SetProgramFullPath() failed: out of memory"); + } +} + wchar_t * Py_GetPath(void) @@ -523,12 +536,8 @@ Py_GetPrefix(void) wchar_t * Py_GetExecPrefix(void) { -#ifdef MS_WINDOWS - return Py_GetPrefix(); -#else pathconfig_global_init(); return _Py_path_config.exec_prefix; -#endif } From webhook-mailer at python.org Sat Nov 17 23:42:12 2018 From: webhook-mailer at python.org (Steve Dower) Date: Sun, 18 Nov 2018 04:42:12 -0000 Subject: [Python-checkins] bpo-34725: Adds _Py_SetProgramFullPath so embedders may override sys.executable (GH-9861) Message-ID: https://github.com/python/cpython/commit/e851049e0e045b5e0f9d5c6b8a64d7f6b8ecc9c7 commit: e851049e0e045b5e0f9d5c6b8a64d7f6b8ecc9c7 branch: 3.7 author: Steve Dower committer: GitHub date: 2018-11-17T20:42:08-08:00 summary: bpo-34725: Adds _Py_SetProgramFullPath so embedders may override sys.executable (GH-9861) files: A Misc/NEWS.d/next/C API/2018-10-13-16-30-54.bpo-34725.j52rIS.rst M Include/pylifecycle.h M Modules/main.c M Python/pathconfig.c diff --git a/Include/pylifecycle.h b/Include/pylifecycle.h index 68a882750041..8e531cf68baf 100644 --- a/Include/pylifecycle.h +++ b/Include/pylifecycle.h @@ -44,6 +44,8 @@ PyAPI_FUNC(void) Py_SetPythonHome(const wchar_t *); PyAPI_FUNC(wchar_t *) Py_GetPythonHome(void); #ifndef Py_LIMITED_API +PyAPI_FUNC(void) _Py_SetProgramFullPath(const wchar_t *); + /* Only used by applications that embed the interpreter and need to * override the standard encoding determination mechanism */ diff --git a/Misc/NEWS.d/next/C API/2018-10-13-16-30-54.bpo-34725.j52rIS.rst b/Misc/NEWS.d/next/C API/2018-10-13-16-30-54.bpo-34725.j52rIS.rst new file mode 100644 index 000000000000..b5bc1bf0c723 --- /dev/null +++ b/Misc/NEWS.d/next/C API/2018-10-13-16-30-54.bpo-34725.j52rIS.rst @@ -0,0 +1 @@ +Adds _Py_SetProgramFullPath so embedders may override sys.executable diff --git a/Modules/main.c b/Modules/main.c index f0f7fe55a41c..6dbe6a30786b 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -1206,6 +1206,25 @@ config_init_program_name(_PyCoreConfig *config) } +static _PyInitError +config_init_executable(_PyCoreConfig *config) +{ + assert(config->executable == NULL); + + /* If Py_SetProgramFullPath() was called, use its value */ + const wchar_t *program_full_path = _Py_path_config.program_full_path; + if (program_full_path != NULL) { + config->executable = _PyMem_RawWcsdup(program_full_path); + if (config->executable == NULL) { + return _Py_INIT_NO_MEMORY(); + } + return _Py_INIT_OK(); + } + + return _Py_INIT_OK(); +} + + static void pymain_header(_PyMain *pymain) { @@ -2350,6 +2369,13 @@ _PyCoreConfig_Read(_PyCoreConfig *config) } } + if (config->executable == NULL) { + err = config_init_executable(config); + if (_Py_INIT_FAILED(err)) { + return err; + } + } + if (config->utf8_mode < 0 || config->coerce_c_locale < 0) { config_init_locale(config); } diff --git a/Python/pathconfig.c b/Python/pathconfig.c index 07aa01c0304f..aacc5f5a5f02 100644 --- a/Python/pathconfig.c +++ b/Python/pathconfig.c @@ -205,6 +205,27 @@ Py_SetProgramName(const wchar_t *program_name) } +void +_Py_SetProgramFullPath(const wchar_t *program_full_path) +{ + if (program_full_path == NULL || program_full_path[0] == L'\0') { + return; + } + + PyMemAllocatorEx old_alloc; + _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, &old_alloc); + + PyMem_RawFree(_Py_path_config.program_full_path); + _Py_path_config.program_full_path = _PyMem_RawWcsdup(program_full_path); + + PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); + + if (_Py_path_config.program_full_path == NULL) { + Py_FatalError("Py_SetProgramFullPath() failed: out of memory"); + } +} + + wchar_t * Py_GetPath(void) { From solipsis at pitrou.net Sun Nov 18 04:08:23 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Sun, 18 Nov 2018 09:08:23 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=3 Message-ID: <20181118090823.1.0B2B9D3A22E7C958@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [0, 7, -7] memory blocks, sum=0 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_spawn leaked [0, -2, 1] memory blocks, sum=-1 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflognrjQJh', '--timeout', '7200'] From webhook-mailer at python.org Sun Nov 18 11:46:02 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sun, 18 Nov 2018 16:46:02 -0000 Subject: [Python-checkins] bpo-35269: Fix a possible segfault involving a newly-created coroutine (GH-10585) Message-ID: https://github.com/python/cpython/commit/062a57bf4b768ef726975bcc1d34398387520147 commit: 062a57bf4b768ef726975bcc1d34398387520147 branch: master author: Zackery Spytz committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-11-18T08:45:57-08:00 summary: bpo-35269: Fix a possible segfault involving a newly-created coroutine (GH-10585) coro->cr_origin wasn't initialized if compute_cr_origin() failed in PyCoro_New(), which would cause a crash during the coroutine's deallocation. https://bugs.python.org/issue35269 files: A Misc/NEWS.d/next/Core and Builtins/2018-11-17-10-18-29.bpo-35269.gjm1LO.rst M Objects/genobject.c diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-11-17-10-18-29.bpo-35269.gjm1LO.rst b/Misc/NEWS.d/next/Core and Builtins/2018-11-17-10-18-29.bpo-35269.gjm1LO.rst new file mode 100644 index 000000000000..0076346f4b6c --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-11-17-10-18-29.bpo-35269.gjm1LO.rst @@ -0,0 +1,2 @@ +Fix a possible segfault involving a newly-created coroutine. Patch by +Zackery Spytz. diff --git a/Objects/genobject.c b/Objects/genobject.c index 98c939446e8f..716bd6d067bd 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -1164,11 +1164,11 @@ PyCoro_New(PyFrameObject *f, PyObject *name, PyObject *qualname) ((PyCoroObject *)coro)->cr_origin = NULL; } else { PyObject *cr_origin = compute_cr_origin(origin_depth); + ((PyCoroObject *)coro)->cr_origin = cr_origin; if (!cr_origin) { Py_DECREF(coro); return NULL; } - ((PyCoroObject *)coro)->cr_origin = cr_origin; } return coro; From webhook-mailer at python.org Sun Nov 18 11:58:23 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sun, 18 Nov 2018 16:58:23 -0000 Subject: [Python-checkins] bpo-35269: Fix a possible segfault involving a newly-created coroutine (GH-10585) Message-ID: https://github.com/python/cpython/commit/ae02a929ddd748b67b3e6f6c6665267f031142e7 commit: ae02a929ddd748b67b3e6f6c6665267f031142e7 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-18T08:58:20-08:00 summary: bpo-35269: Fix a possible segfault involving a newly-created coroutine (GH-10585) coro->cr_origin wasn't initialized if compute_cr_origin() failed in PyCoro_New(), which would cause a crash during the coroutine's deallocation. https://bugs.python.org/issue35269 (cherry picked from commit 062a57bf4b768ef726975bcc1d34398387520147) Co-authored-by: Zackery Spytz files: A Misc/NEWS.d/next/Core and Builtins/2018-11-17-10-18-29.bpo-35269.gjm1LO.rst M Objects/genobject.c diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-11-17-10-18-29.bpo-35269.gjm1LO.rst b/Misc/NEWS.d/next/Core and Builtins/2018-11-17-10-18-29.bpo-35269.gjm1LO.rst new file mode 100644 index 000000000000..0076346f4b6c --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-11-17-10-18-29.bpo-35269.gjm1LO.rst @@ -0,0 +1,2 @@ +Fix a possible segfault involving a newly-created coroutine. Patch by +Zackery Spytz. diff --git a/Objects/genobject.c b/Objects/genobject.c index e91d11114d3e..793a809b8428 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -1166,11 +1166,11 @@ PyCoro_New(PyFrameObject *f, PyObject *name, PyObject *qualname) ((PyCoroObject *)coro)->cr_origin = NULL; } else { PyObject *cr_origin = compute_cr_origin(origin_depth); + ((PyCoroObject *)coro)->cr_origin = cr_origin; if (!cr_origin) { Py_DECREF(coro); return NULL; } - ((PyCoroObject *)coro)->cr_origin = cr_origin; } return coro; From webhook-mailer at python.org Mon Nov 19 04:06:03 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 19 Nov 2018 09:06:03 -0000 Subject: [Python-checkins] bpo-35233: test_embed: fix filesystem encoding (GH-10597) Message-ID: https://github.com/python/cpython/commit/0e1312c959dcfd0193ed0c7ab3fd45d440da6d78 commit: 0e1312c959dcfd0193ed0c7ab3fd45d440da6d78 branch: 3.7 author: Victor Stinner committer: GitHub date: 2018-11-19T10:05:55+01:00 summary: bpo-35233: test_embed: fix filesystem encoding (GH-10597) Fix InitConfigTests: if utf8_mode is enabled, the expected filesystem encoding is UTF-8. files: M Lib/test/test_embed.py diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py index e6c8c8070b86..89797d25c844 100644 --- a/Lib/test/test_embed.py +++ b/Lib/test/test_embed.py @@ -492,6 +492,8 @@ def test_init_from_config(self): 'faulthandler': 1, } global_config = { + 'Py_FileSystemDefaultEncodeErrors': self.UTF8_MODE_ERRORS, + 'Py_FileSystemDefaultEncoding': 'utf-8', 'Py_NoUserSiteDirectory': 0, } self.check_config("init_from_config", core_config, global_config) @@ -510,13 +512,13 @@ def test_init_env(self): } global_config = { 'Py_DontWriteBytecodeFlag': 1, + 'Py_FileSystemDefaultEncodeErrors': self.UTF8_MODE_ERRORS, + 'Py_FileSystemDefaultEncoding': 'utf-8', 'Py_InspectFlag': 1, 'Py_NoUserSiteDirectory': 1, 'Py_OptimizeFlag': 2, 'Py_UnbufferedStdioFlag': 1, 'Py_VerboseFlag': 1, - 'Py_FileSystemDefaultEncoding': 'utf-8', - 'Py_FileSystemDefaultEncodeErrors': self.UTF8_MODE_ERRORS, } self.check_config("init_env", core_config, global_config) From solipsis at pitrou.net Mon Nov 19 04:06:35 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Mon, 19 Nov 2018 09:06:35 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=7 Message-ID: <20181119090635.1.9C41E33A18CF7C23@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_asyncio leaked [3, 0, 0] memory blocks, sum=3 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_fork leaked [1, 2, -1] memory blocks, sum=2 test_multiprocessing_spawn leaked [-2, 1, -1] memory blocks, sum=-2 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogBnJEy5', '--timeout', '7200'] From webhook-mailer at python.org Mon Nov 19 07:41:55 2018 From: webhook-mailer at python.org (Donald Stufft) Date: Mon, 19 Nov 2018 12:41:55 -0000 Subject: [Python-checkins] Upgrade pip to 18.1 and setuptools to 40.6.2 (#10598) Message-ID: https://github.com/python/cpython/commit/8b9c33ea9ce902f902c9d9900121010801950547 commit: 8b9c33ea9ce902f902c9d9900121010801950547 branch: master author: Donald Stufft committer: GitHub date: 2018-11-19T07:41:52-05:00 summary: Upgrade pip to 18.1 and setuptools to 40.6.2 (#10598) files: A Lib/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl A Lib/ensurepip/_bundled/setuptools-40.6.2-py2.py3-none-any.whl A Misc/NEWS.d/next/Library/2018-11-19-07-22-04.bpo-35277.dsD-2E.rst D Lib/ensurepip/_bundled/pip-10.0.1-py2.py3-none-any.whl D Lib/ensurepip/_bundled/setuptools-39.0.1-py2.py3-none-any.whl M Lib/ensurepip/__init__.py diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py index 4748ba4efc4d..09c572db71cb 100644 --- a/Lib/ensurepip/__init__.py +++ b/Lib/ensurepip/__init__.py @@ -8,9 +8,9 @@ __all__ = ["version", "bootstrap"] -_SETUPTOOLS_VERSION = "39.0.1" +_SETUPTOOLS_VERSION = "40.6.2" -_PIP_VERSION = "10.0.1" +_PIP_VERSION = "18.1" _PROJECTS = [ ("setuptools", _SETUPTOOLS_VERSION), diff --git a/Lib/ensurepip/_bundled/pip-10.0.1-py2.py3-none-any.whl b/Lib/ensurepip/_bundled/pip-10.0.1-py2.py3-none-any.whl deleted file mode 100644 index 9837092c07bb..000000000000 Binary files a/Lib/ensurepip/_bundled/pip-10.0.1-py2.py3-none-any.whl and /dev/null differ diff --git a/Lib/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl b/Lib/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl new file mode 100644 index 000000000000..c3c146f6da27 Binary files /dev/null and b/Lib/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl differ diff --git a/Lib/ensurepip/_bundled/setuptools-39.0.1-py2.py3-none-any.whl b/Lib/ensurepip/_bundled/setuptools-40.6.2-py2.py3-none-any.whl similarity index 54% rename from Lib/ensurepip/_bundled/setuptools-39.0.1-py2.py3-none-any.whl rename to Lib/ensurepip/_bundled/setuptools-40.6.2-py2.py3-none-any.whl index edc3ca2d8ec3..4c8a619571d1 100644 Binary files a/Lib/ensurepip/_bundled/setuptools-39.0.1-py2.py3-none-any.whl and b/Lib/ensurepip/_bundled/setuptools-40.6.2-py2.py3-none-any.whl differ diff --git a/Misc/NEWS.d/next/Library/2018-11-19-07-22-04.bpo-35277.dsD-2E.rst b/Misc/NEWS.d/next/Library/2018-11-19-07-22-04.bpo-35277.dsD-2E.rst new file mode 100644 index 000000000000..ff76988e33e7 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-11-19-07-22-04.bpo-35277.dsD-2E.rst @@ -0,0 +1 @@ +Update ensurepip to install pip 18.1 and setuptools 40.6.2. From webhook-mailer at python.org Mon Nov 19 08:07:21 2018 From: webhook-mailer at python.org (Donald Stufft) Date: Mon, 19 Nov 2018 13:07:21 -0000 Subject: [Python-checkins] Upgrade pip to 18.1 and setuptools to 40.6.2 (GH-10598) Message-ID: https://github.com/python/cpython/commit/f4b26f7b0440eec7d2498aea9c3603b9247dee0a commit: f4b26f7b0440eec7d2498aea9c3603b9247dee0a branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Donald Stufft date: 2018-11-19T08:07:16-05:00 summary: Upgrade pip to 18.1 and setuptools to 40.6.2 (GH-10598) (cherry picked from commit 8b9c33ea9ce902f902c9d9900121010801950547) Co-authored-by: Donald Stufft files: A Lib/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl A Lib/ensurepip/_bundled/setuptools-40.6.2-py2.py3-none-any.whl A Misc/NEWS.d/next/Library/2018-11-19-07-22-04.bpo-35277.dsD-2E.rst D Lib/ensurepip/_bundled/pip-10.0.1-py2.py3-none-any.whl D Lib/ensurepip/_bundled/setuptools-39.0.1-py2.py3-none-any.whl M Lib/ensurepip/__init__.py diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py index 4748ba4efc4d..09c572db71cb 100644 --- a/Lib/ensurepip/__init__.py +++ b/Lib/ensurepip/__init__.py @@ -8,9 +8,9 @@ __all__ = ["version", "bootstrap"] -_SETUPTOOLS_VERSION = "39.0.1" +_SETUPTOOLS_VERSION = "40.6.2" -_PIP_VERSION = "10.0.1" +_PIP_VERSION = "18.1" _PROJECTS = [ ("setuptools", _SETUPTOOLS_VERSION), diff --git a/Lib/ensurepip/_bundled/pip-10.0.1-py2.py3-none-any.whl b/Lib/ensurepip/_bundled/pip-10.0.1-py2.py3-none-any.whl deleted file mode 100644 index 9837092c07bb..000000000000 Binary files a/Lib/ensurepip/_bundled/pip-10.0.1-py2.py3-none-any.whl and /dev/null differ diff --git a/Lib/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl b/Lib/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl new file mode 100644 index 000000000000..c3c146f6da27 Binary files /dev/null and b/Lib/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl differ diff --git a/Lib/ensurepip/_bundled/setuptools-39.0.1-py2.py3-none-any.whl b/Lib/ensurepip/_bundled/setuptools-40.6.2-py2.py3-none-any.whl similarity index 54% rename from Lib/ensurepip/_bundled/setuptools-39.0.1-py2.py3-none-any.whl rename to Lib/ensurepip/_bundled/setuptools-40.6.2-py2.py3-none-any.whl index edc3ca2d8ec3..4c8a619571d1 100644 Binary files a/Lib/ensurepip/_bundled/setuptools-39.0.1-py2.py3-none-any.whl and b/Lib/ensurepip/_bundled/setuptools-40.6.2-py2.py3-none-any.whl differ diff --git a/Misc/NEWS.d/next/Library/2018-11-19-07-22-04.bpo-35277.dsD-2E.rst b/Misc/NEWS.d/next/Library/2018-11-19-07-22-04.bpo-35277.dsD-2E.rst new file mode 100644 index 000000000000..ff76988e33e7 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-11-19-07-22-04.bpo-35277.dsD-2E.rst @@ -0,0 +1 @@ +Update ensurepip to install pip 18.1 and setuptools 40.6.2. From webhook-mailer at python.org Mon Nov 19 08:07:37 2018 From: webhook-mailer at python.org (Donald Stufft) Date: Mon, 19 Nov 2018 13:07:37 -0000 Subject: [Python-checkins] Upgrade pip to 18.1 and setuptools to 40.6.2 (GH-10598) Message-ID: https://github.com/python/cpython/commit/c743a6ac360cfa1d9de7e6fad98b68fca39367d5 commit: c743a6ac360cfa1d9de7e6fad98b68fca39367d5 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Donald Stufft date: 2018-11-19T08:07:34-05:00 summary: Upgrade pip to 18.1 and setuptools to 40.6.2 (GH-10598) (cherry picked from commit 8b9c33ea9ce902f902c9d9900121010801950547) Co-authored-by: Donald Stufft files: A Lib/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl A Lib/ensurepip/_bundled/setuptools-40.6.2-py2.py3-none-any.whl A Misc/NEWS.d/next/Library/2018-11-19-07-22-04.bpo-35277.dsD-2E.rst D Lib/ensurepip/_bundled/pip-10.0.1-py2.py3-none-any.whl D Lib/ensurepip/_bundled/setuptools-39.0.1-py2.py3-none-any.whl M Lib/ensurepip/__init__.py diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py index 4748ba4efc4d..09c572db71cb 100644 --- a/Lib/ensurepip/__init__.py +++ b/Lib/ensurepip/__init__.py @@ -8,9 +8,9 @@ __all__ = ["version", "bootstrap"] -_SETUPTOOLS_VERSION = "39.0.1" +_SETUPTOOLS_VERSION = "40.6.2" -_PIP_VERSION = "10.0.1" +_PIP_VERSION = "18.1" _PROJECTS = [ ("setuptools", _SETUPTOOLS_VERSION), diff --git a/Lib/ensurepip/_bundled/pip-10.0.1-py2.py3-none-any.whl b/Lib/ensurepip/_bundled/pip-10.0.1-py2.py3-none-any.whl deleted file mode 100644 index 9837092c07bb..000000000000 Binary files a/Lib/ensurepip/_bundled/pip-10.0.1-py2.py3-none-any.whl and /dev/null differ diff --git a/Lib/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl b/Lib/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl new file mode 100644 index 000000000000..c3c146f6da27 Binary files /dev/null and b/Lib/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl differ diff --git a/Lib/ensurepip/_bundled/setuptools-39.0.1-py2.py3-none-any.whl b/Lib/ensurepip/_bundled/setuptools-40.6.2-py2.py3-none-any.whl similarity index 54% rename from Lib/ensurepip/_bundled/setuptools-39.0.1-py2.py3-none-any.whl rename to Lib/ensurepip/_bundled/setuptools-40.6.2-py2.py3-none-any.whl index edc3ca2d8ec3..4c8a619571d1 100644 Binary files a/Lib/ensurepip/_bundled/setuptools-39.0.1-py2.py3-none-any.whl and b/Lib/ensurepip/_bundled/setuptools-40.6.2-py2.py3-none-any.whl differ diff --git a/Misc/NEWS.d/next/Library/2018-11-19-07-22-04.bpo-35277.dsD-2E.rst b/Misc/NEWS.d/next/Library/2018-11-19-07-22-04.bpo-35277.dsD-2E.rst new file mode 100644 index 000000000000..ff76988e33e7 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-11-19-07-22-04.bpo-35277.dsD-2E.rst @@ -0,0 +1 @@ +Update ensurepip to install pip 18.1 and setuptools 40.6.2. From webhook-mailer at python.org Mon Nov 19 08:08:02 2018 From: webhook-mailer at python.org (Donald Stufft) Date: Mon, 19 Nov 2018 13:08:02 -0000 Subject: [Python-checkins] Upgrade pip to 18.1 and setuptools to 40.6.2 (GH-10598) Message-ID: https://github.com/python/cpython/commit/4845aa6ef813313051db34726afc76c0e7dc5fee commit: 4845aa6ef813313051db34726afc76c0e7dc5fee branch: 2.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Donald Stufft date: 2018-11-19T08:07:58-05:00 summary: Upgrade pip to 18.1 and setuptools to 40.6.2 (GH-10598) (cherry picked from commit 8b9c33ea9ce902f902c9d9900121010801950547) Co-authored-by: Donald Stufft files: A Lib/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl A Lib/ensurepip/_bundled/setuptools-40.6.2-py2.py3-none-any.whl A Misc/NEWS.d/next/Library/2018-11-19-07-22-04.bpo-35277.dsD-2E.rst D Lib/ensurepip/_bundled/pip-10.0.1-py2.py3-none-any.whl D Lib/ensurepip/_bundled/setuptools-39.0.1-py2.py3-none-any.whl M Lib/ensurepip/__init__.py diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py index 3c679e596874..5021ebf77e16 100644 --- a/Lib/ensurepip/__init__.py +++ b/Lib/ensurepip/__init__.py @@ -12,9 +12,9 @@ __all__ = ["version", "bootstrap"] -_SETUPTOOLS_VERSION = "39.0.1" +_SETUPTOOLS_VERSION = "40.6.2" -_PIP_VERSION = "10.0.1" +_PIP_VERSION = "18.1" _PROJECTS = [ ("setuptools", _SETUPTOOLS_VERSION), diff --git a/Lib/ensurepip/_bundled/pip-10.0.1-py2.py3-none-any.whl b/Lib/ensurepip/_bundled/pip-10.0.1-py2.py3-none-any.whl deleted file mode 100644 index 9837092c07bb..000000000000 Binary files a/Lib/ensurepip/_bundled/pip-10.0.1-py2.py3-none-any.whl and /dev/null differ diff --git a/Lib/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl b/Lib/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl new file mode 100644 index 000000000000..c3c146f6da27 Binary files /dev/null and b/Lib/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl differ diff --git a/Lib/ensurepip/_bundled/setuptools-39.0.1-py2.py3-none-any.whl b/Lib/ensurepip/_bundled/setuptools-40.6.2-py2.py3-none-any.whl similarity index 54% rename from Lib/ensurepip/_bundled/setuptools-39.0.1-py2.py3-none-any.whl rename to Lib/ensurepip/_bundled/setuptools-40.6.2-py2.py3-none-any.whl index edc3ca2d8ec3..4c8a619571d1 100644 Binary files a/Lib/ensurepip/_bundled/setuptools-39.0.1-py2.py3-none-any.whl and b/Lib/ensurepip/_bundled/setuptools-40.6.2-py2.py3-none-any.whl differ diff --git a/Misc/NEWS.d/next/Library/2018-11-19-07-22-04.bpo-35277.dsD-2E.rst b/Misc/NEWS.d/next/Library/2018-11-19-07-22-04.bpo-35277.dsD-2E.rst new file mode 100644 index 000000000000..ff76988e33e7 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-11-19-07-22-04.bpo-35277.dsD-2E.rst @@ -0,0 +1 @@ +Update ensurepip to install pip 18.1 and setuptools 40.6.2. From solipsis at pitrou.net Tue Nov 20 04:09:29 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Tue, 20 Nov 2018 09:09:29 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=7 Message-ID: <20181120090929.1.0C79AD7FE12F3D40@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_asyncio leaked [0, 3, 0] memory blocks, sum=3 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_fork leaked [0, -2, 2] memory blocks, sum=0 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogIMWCzz', '--timeout', '7200'] From webhook-mailer at python.org Tue Nov 20 06:11:02 2018 From: webhook-mailer at python.org (=?utf-8?q?=C5=81ukasz?= Langa) Date: Tue, 20 Nov 2018 11:11:02 -0000 Subject: [Python-checkins] bpo-18859: Document --with-valgrind option in README.valgrind (#10591) Message-ID: https://github.com/python/cpython/commit/d5d33681c1cd1df7731eb0fb7c0f297bc2f114e6 commit: d5d33681c1cd1df7731eb0fb7c0f297bc2f114e6 branch: master author: Sanyam Khurana <8039608+CuriousLearner at users.noreply.github.com> committer: ?ukasz Langa date: 2018-11-20T12:10:49+01:00 summary: bpo-18859: Document --with-valgrind option in README.valgrind (#10591) files: M Misc/README.valgrind diff --git a/Misc/README.valgrind b/Misc/README.valgrind index 908f137eff07..b483b2ea60a4 100644 --- a/Misc/README.valgrind +++ b/Misc/README.valgrind @@ -2,6 +2,10 @@ This document describes some caveats about the use of Valgrind with Python. Valgrind is used periodically by Python developers to try to ensure there are no memory leaks or invalid memory reads/writes. +If you want to enable valgrind support in Python, you will need to +configure Python --with-valgrind option or an older option +--without-pymalloc. + UPDATE: Python 3.6 now supports PYTHONMALLOC=malloc environment variable which can be used to force the usage of the malloc() allocator of the C library. @@ -46,6 +50,10 @@ If you disable PyMalloc, most of the information in this document and the supplied suppressions file will not be useful. As discussed above, disabling PyMalloc can catch more problems. +PyMalloc uses 256KB chunks of memory, so it can't detect anything +wrong within these blocks. For that reason, compiling Python +--without-pymalloc usually increases the usefulness of other tools. + If you use valgrind on a default build of Python, you will see many errors like: From webhook-mailer at python.org Tue Nov 20 10:20:29 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 20 Nov 2018 15:20:29 -0000 Subject: [Python-checkins] bpo-28604: Fix localeconv() for different LC_MONETARY (GH-10606) Message-ID: https://github.com/python/cpython/commit/02e6bf7f2025cddcbde6432f6b6396198ab313f4 commit: 02e6bf7f2025cddcbde6432f6b6396198ab313f4 branch: master author: Victor Stinner committer: GitHub date: 2018-11-20T16:20:16+01:00 summary: bpo-28604: Fix localeconv() for different LC_MONETARY (GH-10606) locale.localeconv() now sets temporarily the LC_CTYPE locale to the LC_MONETARY locale if the two locales are different and monetary strings are non-ASCII. This temporary change affects other threads. Changes: * locale.localeconv() can now set LC_CTYPE to LC_MONETARY to decode monetary fields. * Add LocaleInfo.grouping_buffer: copy localeconv() grouping string since it can be replaced anytime if a different thread calls localeconv(). * _Py_GetLocaleconvNumeric() now requires a "struct lconv *" structure, so locale.localeconv() now longer calls localeconv() twice. Moreover, the function now requires all arguments to be non-NULL. * Rename STATIC_LOCALE_INFO_INIT to LocaleInfo_STATIC_INIT. * Move _Py_GetLocaleconvNumeric() definition from fileutils.h to pycore_fileutils.h. pycore_fileutils.h now includes locale.h. * The _locale module is now built with Py_BUILD_CORE defined. files: A Misc/NEWS.d/next/Library/2018-11-20-13-34-01.bpo-28604.iiih5h.rst M Doc/library/locale.rst M Include/fileutils.h M Include/internal/pycore_fileutils.h M Modules/Setup M Modules/_localemodule.c M Python/fileutils.c M Python/formatter_unicode.c diff --git a/Doc/library/locale.rst b/Doc/library/locale.rst index 2fd44fe8e90a..bf57a0835591 100644 --- a/Doc/library/locale.rst +++ b/Doc/library/locale.rst @@ -148,10 +148,8 @@ The :mod:`locale` module defines the following exception and functions: +--------------+-----------------------------------------+ The function sets temporarily the ``LC_CTYPE`` locale to the ``LC_NUMERIC`` - locale to decode ``decimal_point`` and ``thousands_sep`` byte strings if - they are non-ASCII or longer than 1 byte, and the ``LC_NUMERIC`` locale is - different than the ``LC_CTYPE`` locale. This temporary change affects other - threads. + locale or the ``LC_MONETARY`` locale if locales are different and numeric or + monetary strings are non-ASCII. This temporary change affects other threads. .. versionchanged:: 3.7 The function now sets temporarily the ``LC_CTYPE`` locale to the diff --git a/Include/fileutils.h b/Include/fileutils.h index fdd60fffcd55..830e56ad367a 100644 --- a/Include/fileutils.h +++ b/Include/fileutils.h @@ -170,11 +170,6 @@ PyAPI_FUNC(int) _Py_get_blocking(int fd); PyAPI_FUNC(int) _Py_set_blocking(int fd, int blocking); #endif /* !MS_WINDOWS */ -PyAPI_FUNC(int) _Py_GetLocaleconvNumeric( - PyObject **decimal_point, - PyObject **thousands_sep, - const char **grouping); - #endif /* Py_LIMITED_API */ #ifdef __cplusplus diff --git a/Include/internal/pycore_fileutils.h b/Include/internal/pycore_fileutils.h index d577e099d1f5..98eb258fe61e 100644 --- a/Include/internal/pycore_fileutils.h +++ b/Include/internal/pycore_fileutils.h @@ -8,6 +8,8 @@ extern "C" { # error "Py_BUILD_CORE must be defined to include this header" #endif +#include /* struct lconv */ + PyAPI_FUNC(int) _Py_DecodeUTF8Ex( const char *arg, Py_ssize_t arglen, @@ -30,6 +32,11 @@ PyAPI_FUNC(wchar_t*) _Py_DecodeUTF8_surrogateescape( PyAPI_FUNC(int) _Py_GetForceASCII(void); +PyAPI_FUNC(int) _Py_GetLocaleconvNumeric( + struct lconv *lc, + PyObject **decimal_point, + PyObject **thousands_sep); + #ifdef __cplusplus } #endif diff --git a/Misc/NEWS.d/next/Library/2018-11-20-13-34-01.bpo-28604.iiih5h.rst b/Misc/NEWS.d/next/Library/2018-11-20-13-34-01.bpo-28604.iiih5h.rst new file mode 100644 index 000000000000..289e484c35d6 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-11-20-13-34-01.bpo-28604.iiih5h.rst @@ -0,0 +1,3 @@ +:func:`locale.localeconv` now sets temporarily the ``LC_CTYPE`` locale to the +``LC_MONETARY`` locale if the two locales are different and monetary strings +are non-ASCII. This temporary change affects other threads. diff --git a/Modules/Setup b/Modules/Setup index e7b939d55182..11ddd0c7b202 100644 --- a/Modules/Setup +++ b/Modules/Setup @@ -120,7 +120,7 @@ time -DPy_BUILD_CORE -I$(srcdir)/Include/internal timemodule.c # -lm # time oper _thread -DPy_BUILD_CORE -I$(srcdir)/Include/internal _threadmodule.c # low-level threading interface # access to ISO C locale support -_locale _localemodule.c # -lintl +_locale -DPy_BUILD_CORE _localemodule.c # -lintl # Standard I/O baseline _io -DPy_BUILD_CORE -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io _io/_iomodule.c _io/iobase.c _io/fileio.c _io/bytesio.c _io/bufferedio.c _io/textio.c _io/stringio.c diff --git a/Modules/_localemodule.c b/Modules/_localemodule.c index 3fdbc5ea8122..4202cc401414 100644 --- a/Modules/_localemodule.c +++ b/Modules/_localemodule.c @@ -11,6 +11,7 @@ This software comes with no warranty. Use at your own risk. #define PY_SSIZE_T_CLEAN #include "Python.h" +#include "pycore_fileutils.h" #include #include @@ -128,6 +129,82 @@ PyLocale_setlocale(PyObject* self, PyObject* args) return result_object; } +static int +locale_is_ascii(const char *str) +{ + return (strlen(str) == 1 && ((unsigned char)str[0]) <= 127); +} + +static int +locale_decode_monetary(PyObject *dict, struct lconv *lc) +{ + int change_locale; + change_locale = (!locale_is_ascii(lc->int_curr_symbol) + || !locale_is_ascii(lc->currency_symbol) + || !locale_is_ascii(lc->mon_decimal_point) + || !locale_is_ascii(lc->mon_thousands_sep)); + + /* Keep a copy of the LC_CTYPE locale */ + char *oldloc = NULL, *loc = NULL; + if (change_locale) { + oldloc = setlocale(LC_CTYPE, NULL); + if (!oldloc) { + PyErr_SetString(PyExc_RuntimeWarning, + "failed to get LC_CTYPE locale"); + return -1; + } + + oldloc = _PyMem_Strdup(oldloc); + if (!oldloc) { + PyErr_NoMemory(); + return -1; + } + + loc = setlocale(LC_MONETARY, NULL); + if (loc != NULL && strcmp(loc, oldloc) == 0) { + loc = NULL; + } + + if (loc != NULL) { + /* Only set the locale temporarily the LC_CTYPE locale + to the LC_MONETARY locale if the two locales are different and + at least one string is non-ASCII. */ + setlocale(LC_CTYPE, loc); + } + } + + int res = -1; + +#define RESULT_STRING(ATTR) \ + do { \ + PyObject *obj; \ + obj = PyUnicode_DecodeLocale(lc->ATTR, NULL); \ + if (obj == NULL) { \ + goto done; \ + } \ + if (PyDict_SetItemString(dict, Py_STRINGIFY(ATTR), obj) < 0) { \ + Py_DECREF(obj); \ + goto done; \ + } \ + Py_DECREF(obj); \ + } while (0) + + RESULT_STRING(int_curr_symbol); + RESULT_STRING(currency_symbol); + RESULT_STRING(mon_decimal_point); + RESULT_STRING(mon_thousands_sep); +#undef RESULT_STRING + + res = 0; + +done: + if (loc != NULL) { + setlocale(LC_CTYPE, oldloc); + } + PyMem_Free(oldloc); + return res; +} + PyDoc_STRVAR(localeconv__doc__, "() -> dict. Returns numeric and monetary locale-specific parameters."); @@ -135,7 +212,7 @@ static PyObject* PyLocale_localeconv(PyObject* self, PyObject *Py_UNUSED(ignored)) { PyObject* result; - struct lconv *l; + struct lconv *lc; PyObject *x; result = PyDict_New(); @@ -144,7 +221,7 @@ PyLocale_localeconv(PyObject* self, PyObject *Py_UNUSED(ignored)) } /* if LC_NUMERIC is different in the C library, use saved value */ - l = localeconv(); + lc = localeconv(); /* hopefully, the localeconv result survives the C library calls involved herein */ @@ -162,22 +239,21 @@ PyLocale_localeconv(PyObject* self, PyObject *Py_UNUSED(ignored)) #define RESULT_STRING(s)\ do { \ - x = PyUnicode_DecodeLocale(l->s, NULL); \ + x = PyUnicode_DecodeLocale(lc->s, NULL); \ RESULT(#s, x); \ } while (0) #define RESULT_INT(i)\ do { \ - x = PyLong_FromLong(l->i); \ + x = PyLong_FromLong(lc->i); \ RESULT(#i, x); \ } while (0) - /* Monetary information */ - RESULT_STRING(int_curr_symbol); - RESULT_STRING(currency_symbol); - RESULT_STRING(mon_decimal_point); - RESULT_STRING(mon_thousands_sep); - x = copy_grouping(l->mon_grouping); + /* Monetary information: LC_MONETARY encoding */ + if (locale_decode_monetary(result, lc) < 0) { + goto failed; + } + x = copy_grouping(lc->mon_grouping); RESULT("mon_grouping", x); RESULT_STRING(positive_sign); @@ -191,12 +267,9 @@ PyLocale_localeconv(PyObject* self, PyObject *Py_UNUSED(ignored)) RESULT_INT(p_sign_posn); RESULT_INT(n_sign_posn); - /* Numeric information */ + /* Numeric information: LC_NUMERIC encoding */ PyObject *decimal_point, *thousands_sep; - const char *grouping; - if (_Py_GetLocaleconvNumeric(&decimal_point, - &thousands_sep, - &grouping) < 0) { + if (_Py_GetLocaleconvNumeric(lc, &decimal_point, &thousands_sep) < 0) { goto failed; } @@ -213,7 +286,7 @@ PyLocale_localeconv(PyObject* self, PyObject *Py_UNUSED(ignored)) } Py_DECREF(thousands_sep); - x = copy_grouping(grouping); + x = copy_grouping(lc->grouping); RESULT("grouping", x); return result; @@ -221,6 +294,10 @@ PyLocale_localeconv(PyObject* self, PyObject *Py_UNUSED(ignored)) failed: Py_DECREF(result); return NULL; + +#undef RESULT +#undef RESULT_STRING +#undef RESULT_INT } #if defined(HAVE_WCSCOLL) diff --git a/Python/fileutils.c b/Python/fileutils.c index c9a8e58dd122..033c2ff71b91 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -1868,22 +1868,17 @@ _Py_set_blocking(int fd, int blocking) int -_Py_GetLocaleconvNumeric(PyObject **decimal_point, PyObject **thousands_sep, - const char **grouping) +_Py_GetLocaleconvNumeric(struct lconv *lc, + PyObject **decimal_point, PyObject **thousands_sep) { - int res = -1; - - struct lconv *lc = localeconv(); + assert(decimal_point != NULL); + assert(thousands_sep != NULL); int change_locale = 0; - if (decimal_point != NULL && - (strlen(lc->decimal_point) > 1 || ((unsigned char)lc->decimal_point[0]) > 127)) - { + if ((strlen(lc->decimal_point) > 1 || ((unsigned char)lc->decimal_point[0]) > 127)) { change_locale = 1; } - if (thousands_sep != NULL && - (strlen(lc->thousands_sep) > 1 || ((unsigned char)lc->thousands_sep[0]) > 127)) - { + if ((strlen(lc->thousands_sep) > 1 || ((unsigned char)lc->thousands_sep[0]) > 127)) { change_locale = 1; } @@ -1892,7 +1887,8 @@ _Py_GetLocaleconvNumeric(PyObject **decimal_point, PyObject **thousands_sep, if (change_locale) { oldloc = setlocale(LC_CTYPE, NULL); if (!oldloc) { - PyErr_SetString(PyExc_RuntimeWarning, "faild to get LC_CTYPE locale"); + PyErr_SetString(PyExc_RuntimeWarning, + "failed to get LC_CTYPE locale"); return -1; } @@ -1908,7 +1904,7 @@ _Py_GetLocaleconvNumeric(PyObject **decimal_point, PyObject **thousands_sep, } if (loc != NULL) { - /* Only set the locale temporarilty the LC_CTYPE locale + /* Only set the locale temporarily the LC_CTYPE locale if LC_NUMERIC locale is different than LC_CTYPE locale and decimal_point and/or thousands_sep are non-ASCII or longer than 1 byte */ @@ -1916,26 +1912,21 @@ _Py_GetLocaleconvNumeric(PyObject **decimal_point, PyObject **thousands_sep, } } - if (decimal_point != NULL) { - *decimal_point = PyUnicode_DecodeLocale(lc->decimal_point, NULL); - if (*decimal_point == NULL) { - goto error; - } - } - if (thousands_sep != NULL) { - *thousands_sep = PyUnicode_DecodeLocale(lc->thousands_sep, NULL); - if (*thousands_sep == NULL) { - goto error; - } + int res = -1; + + *decimal_point = PyUnicode_DecodeLocale(lc->decimal_point, NULL); + if (*decimal_point == NULL) { + goto done; } - if (grouping != NULL) { - *grouping = lc->grouping; + *thousands_sep = PyUnicode_DecodeLocale(lc->thousands_sep, NULL); + if (*thousands_sep == NULL) { + goto done; } res = 0; -error: +done: if (loc != NULL) { setlocale(LC_CTYPE, oldloc); } diff --git a/Python/formatter_unicode.c b/Python/formatter_unicode.c index ba09cc67becf..e12ba49bd2c1 100644 --- a/Python/formatter_unicode.c +++ b/Python/formatter_unicode.c @@ -3,6 +3,7 @@ of int.__float__, etc., that take and return unicode objects */ #include "Python.h" +#include "pycore_fileutils.h" #include /* Raises an exception about an unknown presentation type for this @@ -396,9 +397,10 @@ typedef struct { PyObject *decimal_point; PyObject *thousands_sep; const char *grouping; + char *grouping_buffer; } LocaleInfo; -#define STATIC_LOCALE_INFO_INIT {0, 0, 0} +#define LocaleInfo_STATIC_INIT {0, 0, 0, 0} /* describes the layout for an integer, see the comment in calc_number_widths() for details */ @@ -705,11 +707,22 @@ get_locale_info(enum LocaleType type, LocaleInfo *locale_info) { switch (type) { case LT_CURRENT_LOCALE: { - if (_Py_GetLocaleconvNumeric(&locale_info->decimal_point, - &locale_info->thousands_sep, - &locale_info->grouping) < 0) { + struct lconv *lc = localeconv(); + if (_Py_GetLocaleconvNumeric(lc, + &locale_info->decimal_point, + &locale_info->thousands_sep) < 0) { return -1; } + + /* localeconv() grouping can become a dangling pointer or point + to a different string if another thread calls localeconv() during + the string formatting. Copy the string to avoid this risk. */ + locale_info->grouping_buffer = _PyMem_Strdup(lc->grouping); + if (locale_info->grouping_buffer == NULL) { + PyErr_NoMemory(); + return -1; + } + locale_info->grouping = locale_info->grouping_buffer; break; } case LT_DEFAULT_LOCALE: @@ -743,6 +756,7 @@ free_locale_info(LocaleInfo *locale_info) { Py_XDECREF(locale_info->decimal_point); Py_XDECREF(locale_info->thousands_sep); + PyMem_Free(locale_info->grouping_buffer); } /************************************************************************/ @@ -855,7 +869,7 @@ format_long_internal(PyObject *value, const InternalFormatSpec *format, /* Locale settings, either from the actual locale or from a hard-code pseudo-locale */ - LocaleInfo locale = STATIC_LOCALE_INFO_INIT; + LocaleInfo locale = LocaleInfo_STATIC_INIT; /* no precision allowed on integers */ if (format->precision != -1) { @@ -1027,7 +1041,7 @@ format_float_internal(PyObject *value, /* Locale settings, either from the actual locale or from a hard-code pseudo-locale */ - LocaleInfo locale = STATIC_LOCALE_INFO_INIT; + LocaleInfo locale = LocaleInfo_STATIC_INIT; if (format->precision > INT_MAX) { PyErr_SetString(PyExc_ValueError, "precision too big"); @@ -1190,7 +1204,7 @@ format_complex_internal(PyObject *value, /* Locale settings, either from the actual locale or from a hard-code pseudo-locale */ - LocaleInfo locale = STATIC_LOCALE_INFO_INIT; + LocaleInfo locale = LocaleInfo_STATIC_INIT; if (format->precision > INT_MAX) { PyErr_SetString(PyExc_ValueError, "precision too big"); From webhook-mailer at python.org Tue Nov 20 11:18:42 2018 From: webhook-mailer at python.org (Julien Palard) Date: Tue, 20 Nov 2018 16:18:42 -0000 Subject: [Python-checkins] bpo-31146: Don't fallback switcher to english on not-yet pusblished languages. (GH-10558) Message-ID: https://github.com/python/cpython/commit/6b73bb523a176123a819e4ebac3727d31d861515 commit: 6b73bb523a176123a819e4ebac3727d31d861515 branch: master author: Julien Palard committer: GitHub date: 2018-11-20T17:18:30+01:00 summary: bpo-31146: Don't fallback switcher to english on not-yet pusblished languages. (GH-10558) files: M Doc/tools/static/switchers.js diff --git a/Doc/tools/static/switchers.js b/Doc/tools/static/switchers.js index d885ff2bbf21..20dad93d6a5e 100644 --- a/Doc/tools/static/switchers.js +++ b/Doc/tools/static/switchers.js @@ -49,6 +49,12 @@ else buf.push(''); }); + if (!(current_language in all_languages)) { + // In case we're browsing a language that is not yet in all_languages. + buf.push(''); + all_languages[current_language] = current_language; + } buf.push(''); return buf.join(''); } From webhook-mailer at python.org Tue Nov 20 12:26:14 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Tue, 20 Nov 2018 17:26:14 -0000 Subject: [Python-checkins] bpo-9842: Add references for using "..." as a placeholder to the index. (GH-10330) Message-ID: https://github.com/python/cpython/commit/6c48bf2d9e1e18dfbfa35f7582ddd32f11f75129 commit: 6c48bf2d9e1e18dfbfa35f7582ddd32f11f75129 branch: master author: Serhiy Storchaka committer: GitHub date: 2018-11-20T19:26:09+02:00 summary: bpo-9842: Add references for using "..." as a placeholder to the index. (GH-10330) files: M Doc/library/pprint.rst M Doc/library/reprlib.rst M Doc/library/textwrap.rst diff --git a/Doc/library/pprint.rst b/Doc/library/pprint.rst index 3922a768311c..deadf1820851 100644 --- a/Doc/library/pprint.rst +++ b/Doc/library/pprint.rst @@ -30,6 +30,8 @@ The :mod:`pprint` module defines one class: .. First the implementation class: +.. index:: single: ...; placeholder + .. class:: PrettyPrinter(indent=1, width=80, depth=None, stream=None, *, \ compact=False) diff --git a/Doc/library/reprlib.rst b/Doc/library/reprlib.rst index 5149bcf10f66..1a0c1b0dcd1a 100644 --- a/Doc/library/reprlib.rst +++ b/Doc/library/reprlib.rst @@ -42,6 +42,9 @@ In addition to size-limiting tools, the module also provides a decorator for detecting recursive calls to :meth:`__repr__` and substituting a placeholder string instead. + +.. index:: single: ...; placeholder + .. decorator:: recursive_repr(fillvalue="...") Decorator for :meth:`__repr__` methods to detect recursive calls within the diff --git a/Doc/library/textwrap.rst b/Doc/library/textwrap.rst index 438007d0028d..d254466c9a32 100644 --- a/Doc/library/textwrap.rst +++ b/Doc/library/textwrap.rst @@ -268,6 +268,8 @@ hyphenated words; only then will long words be broken if necessary, unless .. versionadded:: 3.4 + .. index:: single: ...; placeholder + .. attribute:: placeholder (default: ``' [...]'``) String that will appear at the end of the output From webhook-mailer at python.org Tue Nov 20 12:27:20 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Tue, 20 Nov 2018 17:27:20 -0000 Subject: [Python-checkins] bpo-35169: Improve error messages for forbidden assignments. (GH-10342) Message-ID: https://github.com/python/cpython/commit/97f1efb6062188645a470daaa91e3669d739c75f commit: 97f1efb6062188645a470daaa91e3669d739c75f branch: master author: Serhiy Storchaka committer: GitHub date: 2018-11-20T19:27:16+02:00 summary: bpo-35169: Improve error messages for forbidden assignments. (GH-10342) files: A Misc/NEWS.d/next/Core and Builtins/2018-11-05-21-19-05.bpo-35169._FyPI2.rst M Lib/test/test_dictcomps.py M Lib/test/test_generators.py M Lib/test/test_genexps.py M Lib/test/test_syntax.py M Python/ast.c diff --git a/Lib/test/test_dictcomps.py b/Lib/test/test_dictcomps.py index 087307188343..afe68a8de753 100644 --- a/Lib/test/test_dictcomps.py +++ b/Lib/test/test_dictcomps.py @@ -73,11 +73,11 @@ def test_local_visibility(self): self.assertEqual(v, "Local variable") def test_illegal_assignment(self): - with self.assertRaisesRegex(SyntaxError, "can't assign"): + with self.assertRaisesRegex(SyntaxError, "cannot assign"): compile("{x: y for y, x in ((1, 2), (3, 4))} = 5", "", "exec") - with self.assertRaisesRegex(SyntaxError, "can't assign"): + with self.assertRaisesRegex(SyntaxError, "cannot assign"): compile("{x: y for y, x in ((1, 2), (3, 4))} += 5", "", "exec") diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py index 7a21cb7e954a..320793c7dab6 100644 --- a/Lib/test/test_generators.py +++ b/Lib/test/test_generators.py @@ -1865,12 +1865,12 @@ def printsolution(self, x): >>> def f(): (yield bar) = y Traceback (most recent call last): ... -SyntaxError: can't assign to yield expression +SyntaxError: cannot assign to yield expression >>> def f(): (yield bar) += y Traceback (most recent call last): ... -SyntaxError: can't assign to yield expression +SyntaxError: cannot assign to yield expression Now check some throw() conditions: diff --git a/Lib/test/test_genexps.py b/Lib/test/test_genexps.py index fb531d6d472b..fd712bb172d5 100644 --- a/Lib/test/test_genexps.py +++ b/Lib/test/test_genexps.py @@ -137,12 +137,12 @@ >>> (y for y in (1,2)) = 10 Traceback (most recent call last): ... - SyntaxError: can't assign to generator expression + SyntaxError: cannot assign to generator expression >>> (y for y in (1,2)) += 10 Traceback (most recent call last): ... - SyntaxError: can't assign to generator expression + SyntaxError: cannot assign to generator expression ########### Tests borrowed from or inspired by test_generators.py ############ diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py index c5b2496e010d..ce1de4b319f2 100644 --- a/Lib/test/test_syntax.py +++ b/Lib/test/test_syntax.py @@ -33,35 +33,55 @@ >>> None = 1 Traceback (most recent call last): -SyntaxError: can't assign to keyword +SyntaxError: cannot assign to None + +>>> obj.True = 1 +Traceback (most recent call last): +SyntaxError: invalid syntax + +>>> True = 1 +Traceback (most recent call last): +SyntaxError: cannot assign to True + +>>> obj.__debug__ = 1 +Traceback (most recent call last): +SyntaxError: cannot assign to __debug__ + +>>> __debug__ = 1 +Traceback (most recent call last): +SyntaxError: cannot assign to __debug__ >>> f() = 1 Traceback (most recent call last): -SyntaxError: can't assign to function call +SyntaxError: cannot assign to function call >>> del f() Traceback (most recent call last): -SyntaxError: can't delete function call +SyntaxError: cannot delete function call >>> a + 1 = 2 Traceback (most recent call last): -SyntaxError: can't assign to operator +SyntaxError: cannot assign to operator >>> (x for x in x) = 1 Traceback (most recent call last): -SyntaxError: can't assign to generator expression +SyntaxError: cannot assign to generator expression >>> 1 = 1 Traceback (most recent call last): -SyntaxError: can't assign to literal +SyntaxError: cannot assign to literal >>> "abc" = 1 Traceback (most recent call last): -SyntaxError: can't assign to literal +SyntaxError: cannot assign to literal >>> b"" = 1 Traceback (most recent call last): -SyntaxError: can't assign to literal +SyntaxError: cannot assign to literal + +>>> ... = 1 +Traceback (most recent call last): +SyntaxError: cannot assign to Ellipsis >>> `1` = 1 Traceback (most recent call last): @@ -74,15 +94,31 @@ >>> (a, "b", c) = (1, 2, 3) Traceback (most recent call last): -SyntaxError: can't assign to literal +SyntaxError: cannot assign to literal + +>>> (a, True, c) = (1, 2, 3) +Traceback (most recent call last): +SyntaxError: cannot assign to True + +>>> (a, __debug__, c) = (1, 2, 3) +Traceback (most recent call last): +SyntaxError: cannot assign to __debug__ + +>>> (a, *True, c) = (1, 2, 3) +Traceback (most recent call last): +SyntaxError: cannot assign to True + +>>> (a, *__debug__, c) = (1, 2, 3) +Traceback (most recent call last): +SyntaxError: cannot assign to __debug__ >>> [a, b, c + 1] = [1, 2, 3] Traceback (most recent call last): -SyntaxError: can't assign to operator +SyntaxError: cannot assign to operator >>> a if 1 else b = 1 Traceback (most recent call last): -SyntaxError: can't assign to conditional expression +SyntaxError: cannot assign to conditional expression From compiler_complex_args(): @@ -255,36 +291,45 @@ >>> f(lambda x: x[0] = 3) Traceback (most recent call last): -SyntaxError: lambda cannot contain assignment +SyntaxError: expression cannot contain assignment, perhaps you meant "=="? The grammar accepts any test (basically, any expression) in the keyword slot of a call site. Test a few different options. >>> f(x()=2) Traceback (most recent call last): -SyntaxError: keyword can't be an expression +SyntaxError: expression cannot contain assignment, perhaps you meant "=="? >>> f(a or b=1) Traceback (most recent call last): -SyntaxError: keyword can't be an expression +SyntaxError: expression cannot contain assignment, perhaps you meant "=="? >>> f(x.y=1) Traceback (most recent call last): -SyntaxError: keyword can't be an expression +SyntaxError: expression cannot contain assignment, perhaps you meant "=="? >>> f((x)=2) Traceback (most recent call last): -SyntaxError: keyword can't be an expression +SyntaxError: expression cannot contain assignment, perhaps you meant "=="? +>>> f(True=2) +Traceback (most recent call last): +SyntaxError: cannot assign to True +>>> f(__debug__=1) +Traceback (most recent call last): +SyntaxError: cannot assign to __debug__ More set_context(): >>> (x for x in x) += 1 Traceback (most recent call last): -SyntaxError: can't assign to generator expression +SyntaxError: cannot assign to generator expression >>> None += 1 Traceback (most recent call last): -SyntaxError: can't assign to keyword +SyntaxError: cannot assign to None +>>> __debug__ += 1 +Traceback (most recent call last): +SyntaxError: cannot assign to __debug__ >>> f() += 1 Traceback (most recent call last): -SyntaxError: can't assign to function call +SyntaxError: cannot assign to function call Test continue in finally in weird combinations. @@ -481,7 +526,7 @@ ... pass Traceback (most recent call last): ... - SyntaxError: can't assign to function call + SyntaxError: cannot assign to function call >>> if 1: ... pass @@ -489,7 +534,7 @@ ... x() = 1 Traceback (most recent call last): ... - SyntaxError: can't assign to function call + SyntaxError: cannot assign to function call >>> if 1: ... x() = 1 @@ -499,7 +544,7 @@ ... pass Traceback (most recent call last): ... - SyntaxError: can't assign to function call + SyntaxError: cannot assign to function call >>> if 1: ... pass @@ -509,7 +554,7 @@ ... pass Traceback (most recent call last): ... - SyntaxError: can't assign to function call + SyntaxError: cannot assign to function call >>> if 1: ... pass @@ -519,7 +564,7 @@ ... x() = 1 Traceback (most recent call last): ... - SyntaxError: can't assign to function call + SyntaxError: cannot assign to function call Make sure that the old "raise X, Y[, Z]" form is gone: >>> raise X, Y @@ -539,21 +584,33 @@ >>> {1, 2, 3} = 42 Traceback (most recent call last): -SyntaxError: can't assign to literal +SyntaxError: cannot assign to set display + +>>> {1: 2, 3: 4} = 42 +Traceback (most recent call last): +SyntaxError: cannot assign to dict display + +>>> f'{x}' = 42 +Traceback (most recent call last): +SyntaxError: cannot assign to f-string expression + +>>> f'{x}-{y}' = 42 +Traceback (most recent call last): +SyntaxError: cannot assign to f-string expression Corner-cases that used to fail to raise the correct error: >>> def f(*, x=lambda __debug__:0): pass Traceback (most recent call last): - SyntaxError: assignment to keyword + SyntaxError: cannot assign to __debug__ >>> def f(*args:(lambda __debug__:0)): pass Traceback (most recent call last): - SyntaxError: assignment to keyword + SyntaxError: cannot assign to __debug__ >>> def f(**kwargs:(lambda __debug__:0)): pass Traceback (most recent call last): - SyntaxError: assignment to keyword + SyntaxError: cannot assign to __debug__ >>> with (lambda *:0): pass Traceback (most recent call last): @@ -563,11 +620,11 @@ >>> def f(**__debug__): pass Traceback (most recent call last): - SyntaxError: assignment to keyword + SyntaxError: cannot assign to __debug__ >>> def f(*xx, __debug__): pass Traceback (most recent call last): - SyntaxError: assignment to keyword + SyntaxError: cannot assign to __debug__ """ diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-11-05-21-19-05.bpo-35169._FyPI2.rst b/Misc/NEWS.d/next/Core and Builtins/2018-11-05-21-19-05.bpo-35169._FyPI2.rst new file mode 100644 index 000000000000..63c28f423ac2 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-11-05-21-19-05.bpo-35169._FyPI2.rst @@ -0,0 +1 @@ +Improved error messages for forbidden assignments. diff --git a/Python/ast.c b/Python/ast.c index d5c7ce6982d1..7f72aa2bd373 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -647,21 +647,25 @@ new_identifier(const char *n, struct compiling *c) #define NEW_IDENTIFIER(n) new_identifier(STR(n), c) static int -ast_error(struct compiling *c, const node *n, const char *errmsg) +ast_error(struct compiling *c, const node *n, const char *errmsg, ...) { PyObject *value, *errstr, *loc, *tmp; + va_list va; + va_start(va, errmsg); + errstr = PyUnicode_FromFormatV(errmsg, va); + va_end(va); + if (!errstr) { + return 0; + } loc = PyErr_ProgramTextObject(c->c_filename, LINENO(n)); if (!loc) { Py_INCREF(Py_None); loc = Py_None; } tmp = Py_BuildValue("(OiiN)", c->c_filename, LINENO(n), n->n_col_offset + 1, loc); - if (!tmp) - return 0; - errstr = PyUnicode_FromString(errmsg); - if (!errstr) { - Py_DECREF(tmp); + if (!tmp) { + Py_DECREF(errstr); return 0; } value = PyTuple_Pack(2, errstr, tmp); @@ -903,6 +907,7 @@ static const char * const FORBIDDEN[] = { "None", "True", "False", + "__debug__", NULL, }; @@ -911,17 +916,16 @@ forbidden_name(struct compiling *c, identifier name, const node *n, int full_checks) { assert(PyUnicode_Check(name)); - if (_PyUnicode_EqualToASCIIString(name, "__debug__")) { - ast_error(c, n, "assignment to keyword"); - return 1; - } - if (full_checks) { - const char * const *p; - for (p = FORBIDDEN; *p; p++) { - if (_PyUnicode_EqualToASCIIString(name, *p)) { - ast_error(c, n, "assignment to keyword"); - return 1; - } + const char * const *p = FORBIDDEN; + if (!full_checks) { + /* In most cases, the parser will protect True, False, and None + from being assign to. */ + p += 3; + } + for (; *p; p++) { + if (_PyUnicode_EqualToASCIIString(name, *p)) { + ast_error(c, n, "cannot assign to %U", name); + return 1; } } return 0; @@ -1012,22 +1016,25 @@ set_context(struct compiling *c, expr_ty e, expr_context_ty ctx, const node *n) expr_name = "dict comprehension"; break; case Dict_kind: + expr_name = "dict display"; + break; case Set_kind: + expr_name = "set display"; + break; case JoinedStr_kind: case FormattedValue_kind: - expr_name = "literal"; + expr_name = "f-string expression"; break; case Constant_kind: { PyObject *value = e->v.Constant.value; - if (value == Py_None || value == Py_False || value == Py_True) { - expr_name = "keyword"; - } - else if (value == Py_Ellipsis) { - expr_name = "Ellipsis"; - } - else { - expr_name = "literal"; + if (value == Py_None || value == Py_False || value == Py_True + || value == Py_Ellipsis) + { + return ast_error(c, n, "cannot %s %R", + ctx == Store ? "assign to" : "delete", + value); } + expr_name = "literal"; break; } case Compare_kind: @@ -1044,12 +1051,9 @@ set_context(struct compiling *c, expr_ty e, expr_context_ty ctx, const node *n) } /* Check for error string set by switch */ if (expr_name) { - char buf[300]; - PyOS_snprintf(buf, sizeof(buf), - "can't %s %s", - ctx == Store ? "assign to" : "delete", - expr_name); - return ast_error(c, n, buf); + return ast_error(c, n, "cannot %s %s", + ctx == Store ? "assign to" : "delete", + expr_name); } /* If the LHS is a list or tuple, we need to set the assignment @@ -2083,21 +2087,17 @@ ast_for_atom(struct compiling *c, const node *n) else if (PyErr_ExceptionMatches(PyExc_ValueError)) errtype = "value error"; if (errtype) { - char buf[128]; - const char *s = NULL; PyObject *type, *value, *tback, *errstr; PyErr_Fetch(&type, &value, &tback); errstr = PyObject_Str(value); - if (errstr) - s = PyUnicode_AsUTF8(errstr); - if (s) { - PyOS_snprintf(buf, sizeof(buf), "(%s) %s", errtype, s); - } else { + if (errstr) { + ast_error(c, n, "(%s) %U", errtype, errstr); + Py_DECREF(errstr); + } + else { PyErr_Clear(); - PyOS_snprintf(buf, sizeof(buf), "(%s) unknown error", errtype); + ast_error(c, n, "(%s) unknown error", errtype); } - Py_XDECREF(errstr); - ast_error(c, n, buf); Py_DECREF(type); Py_XDECREF(value); Py_XDECREF(tback); @@ -2815,18 +2815,10 @@ ast_for_call(struct compiling *c, const node *n, expr_ty func, bool allowgen) break; expr_node = CHILD(expr_node, 0); } - if (TYPE(expr_node) == lambdef) { - // f(lambda x: x[0] = 3) ends up getting parsed with LHS - // test = lambda x: x[0], and RHS test = 3. Issue #132313 - // points out that complaining about a keyword then is very - // confusing. + if (TYPE(expr_node) != NAME) { ast_error(c, chch, - "lambda cannot contain assignment"); - return NULL; - } - else if (TYPE(expr_node) != NAME) { - ast_error(c, chch, - "keyword can't be an expression"); + "expression cannot contain assignment, " + "perhaps you meant \"==\"?"); return NULL; } key = new_identifier(STR(expr_node), c); @@ -4127,16 +4119,10 @@ warn_invalid_escape_sequence(struct compiling *c, const node *n, NULL, NULL) < 0) { if (PyErr_ExceptionMatches(PyExc_SyntaxWarning)) { - const char *s; - /* Replace the SyntaxWarning exception with a SyntaxError to get a more accurate error report */ PyErr_Clear(); - - s = PyUnicode_AsUTF8(msg); - if (s != NULL) { - ast_error(c, n, s); - } + ast_error(c, n, "%U", msg); } Py_DECREF(msg); return -1; From webhook-mailer at python.org Tue Nov 20 13:07:58 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 20 Nov 2018 18:07:58 -0000 Subject: [Python-checkins] bpo-9842: Add references for using "..." as a placeholder to the index. (GH-10330) Message-ID: https://github.com/python/cpython/commit/f8f9915f9585a5d4f4a4457ef43ac66607c5f380 commit: f8f9915f9585a5d4f4a4457ef43ac66607c5f380 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-20T10:07:54-08:00 summary: bpo-9842: Add references for using "..." as a placeholder to the index. (GH-10330) (cherry picked from commit 6c48bf2d9e1e18dfbfa35f7582ddd32f11f75129) Co-authored-by: Serhiy Storchaka files: M Doc/library/pprint.rst M Doc/library/reprlib.rst M Doc/library/textwrap.rst diff --git a/Doc/library/pprint.rst b/Doc/library/pprint.rst index 3922a768311c..deadf1820851 100644 --- a/Doc/library/pprint.rst +++ b/Doc/library/pprint.rst @@ -30,6 +30,8 @@ The :mod:`pprint` module defines one class: .. First the implementation class: +.. index:: single: ...; placeholder + .. class:: PrettyPrinter(indent=1, width=80, depth=None, stream=None, *, \ compact=False) diff --git a/Doc/library/reprlib.rst b/Doc/library/reprlib.rst index 5149bcf10f66..1a0c1b0dcd1a 100644 --- a/Doc/library/reprlib.rst +++ b/Doc/library/reprlib.rst @@ -42,6 +42,9 @@ In addition to size-limiting tools, the module also provides a decorator for detecting recursive calls to :meth:`__repr__` and substituting a placeholder string instead. + +.. index:: single: ...; placeholder + .. decorator:: recursive_repr(fillvalue="...") Decorator for :meth:`__repr__` methods to detect recursive calls within the diff --git a/Doc/library/textwrap.rst b/Doc/library/textwrap.rst index 438007d0028d..d254466c9a32 100644 --- a/Doc/library/textwrap.rst +++ b/Doc/library/textwrap.rst @@ -268,6 +268,8 @@ hyphenated words; only then will long words be broken if necessary, unless .. versionadded:: 3.4 + .. index:: single: ...; placeholder + .. attribute:: placeholder (default: ``' [...]'``) String that will appear at the end of the output From webhook-mailer at python.org Tue Nov 20 13:08:11 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 20 Nov 2018 18:08:11 -0000 Subject: [Python-checkins] bpo-9842: Add references for using "..." as a placeholder to the index. (GH-10330) Message-ID: https://github.com/python/cpython/commit/dac5124ba498b51a2c46e2bda751150ae244ed47 commit: dac5124ba498b51a2c46e2bda751150ae244ed47 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-20T10:08:07-08:00 summary: bpo-9842: Add references for using "..." as a placeholder to the index. (GH-10330) (cherry picked from commit 6c48bf2d9e1e18dfbfa35f7582ddd32f11f75129) Co-authored-by: Serhiy Storchaka files: M Doc/library/pprint.rst M Doc/library/reprlib.rst M Doc/library/textwrap.rst diff --git a/Doc/library/pprint.rst b/Doc/library/pprint.rst index 3922a768311c..deadf1820851 100644 --- a/Doc/library/pprint.rst +++ b/Doc/library/pprint.rst @@ -30,6 +30,8 @@ The :mod:`pprint` module defines one class: .. First the implementation class: +.. index:: single: ...; placeholder + .. class:: PrettyPrinter(indent=1, width=80, depth=None, stream=None, *, \ compact=False) diff --git a/Doc/library/reprlib.rst b/Doc/library/reprlib.rst index 0905b982cd83..dbe2a7182aec 100644 --- a/Doc/library/reprlib.rst +++ b/Doc/library/reprlib.rst @@ -42,6 +42,9 @@ In addition to size-limiting tools, the module also provides a decorator for detecting recursive calls to :meth:`__repr__` and substituting a placeholder string instead. + +.. index:: single: ...; placeholder + .. decorator:: recursive_repr(fillvalue="...") Decorator for :meth:`__repr__` methods to detect recursive calls within the diff --git a/Doc/library/textwrap.rst b/Doc/library/textwrap.rst index 438007d0028d..d254466c9a32 100644 --- a/Doc/library/textwrap.rst +++ b/Doc/library/textwrap.rst @@ -268,6 +268,8 @@ hyphenated words; only then will long words be broken if necessary, unless .. versionadded:: 3.4 + .. index:: single: ...; placeholder + .. attribute:: placeholder (default: ``' [...]'``) String that will appear at the end of the output From webhook-mailer at python.org Tue Nov 20 13:41:12 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Tue, 20 Nov 2018 18:41:12 -0000 Subject: [Python-checkins] bpo-35021: Fix assertion failures in _datetimemodule.c. (GH-10039) Message-ID: https://github.com/python/cpython/commit/3ec0f495163da3b7a15deb2805cec48aed432f58 commit: 3ec0f495163da3b7a15deb2805cec48aed432f58 branch: master author: Serhiy Storchaka committer: GitHub date: 2018-11-20T20:41:09+02:00 summary: bpo-35021: Fix assertion failures in _datetimemodule.c. (GH-10039) Fixes assertion failures in _datetimemodule.c introduced in the previous fix (see bpo-31752). Rather of trying to handle an int subclass as exact int, let it to use overridden special methods, but check the result of divmod(). files: M Lib/test/datetimetester.py M Modules/_datetimemodule.c diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py index 06fe647fb1a4..78b123f5b118 100644 --- a/Lib/test/datetimetester.py +++ b/Lib/test/datetimetester.py @@ -896,19 +896,50 @@ def test_issue31752(self): class BadInt(int): def __mul__(self, other): return Prod() + def __rmul__(self, other): + return Prod() + def __floordiv__(self, other): + return Prod() + def __rfloordiv__(self, other): + return Prod() class Prod: + def __add__(self, other): + return Sum() def __radd__(self, other): return Sum() class Sum(int): def __divmod__(self, other): - # negative remainder - return (0, -1) - - timedelta(microseconds=BadInt(1)) - timedelta(hours=BadInt(1)) - timedelta(weeks=BadInt(1)) + return divmodresult + + for divmodresult in [None, (), (0, 1, 2), (0, -1)]: + with self.subTest(divmodresult=divmodresult): + # The following examples should not crash. + try: + timedelta(microseconds=BadInt(1)) + except TypeError: + pass + try: + timedelta(hours=BadInt(1)) + except TypeError: + pass + try: + timedelta(weeks=BadInt(1)) + except (TypeError, ValueError): + pass + try: + timedelta(1) * BadInt(1) + except (TypeError, ValueError): + pass + try: + BadInt(1) * timedelta(1) + except TypeError: + pass + try: + timedelta(1) // BadInt(1) + except TypeError: + pass ############################################################################# diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c index 02c510f055bd..371bfaec3a05 100644 --- a/Modules/_datetimemodule.c +++ b/Modules/_datetimemodule.c @@ -1797,6 +1797,29 @@ delta_to_microseconds(PyDateTime_Delta *self) return result; } +static PyObject * +checked_divmod(PyObject *a, PyObject *b) +{ + PyObject *result = PyNumber_Divmod(a, b); + if (result != NULL) { + if (!PyTuple_Check(result)) { + PyErr_Format(PyExc_TypeError, + "divmod() returned non-tuple (type %.200s)", + result->ob_type->tp_name); + Py_DECREF(result); + return NULL; + } + if (PyTuple_GET_SIZE(result) != 2) { + PyErr_Format(PyExc_TypeError, + "divmod() returned a tuple of size %zd", + PyTuple_GET_SIZE(result)); + Py_DECREF(result); + return NULL; + } + } + return result; +} + /* Convert a number of us (as a Python int) to a timedelta. */ static PyObject * @@ -1805,70 +1828,49 @@ microseconds_to_delta_ex(PyObject *pyus, PyTypeObject *type) int us; int s; int d; - long temp; PyObject *tuple = NULL; PyObject *num = NULL; PyObject *result = NULL; - assert(PyLong_CheckExact(pyus)); - tuple = PyNumber_Divmod(pyus, us_per_second); - if (tuple == NULL) + tuple = checked_divmod(pyus, us_per_second); + if (tuple == NULL) { goto Done; + } - num = PyTuple_GetItem(tuple, 1); /* us */ - if (num == NULL) - goto Done; - temp = PyLong_AsLong(num); + num = PyTuple_GET_ITEM(tuple, 1); /* us */ + us = _PyLong_AsInt(num); num = NULL; - if (temp == -1 && PyErr_Occurred()) - goto Done; - assert(0 <= temp && temp < 1000000); - us = (int)temp; - if (us < 0) { - /* The divisor was positive, so this must be an error. */ - assert(PyErr_Occurred()); + if (us == -1 && PyErr_Occurred()) { goto Done; } + if (!(0 <= us && us < 1000000)) { + goto BadDivmod; + } - num = PyTuple_GetItem(tuple, 0); /* leftover seconds */ - if (num == NULL) - goto Done; + num = PyTuple_GET_ITEM(tuple, 0); /* leftover seconds */ Py_INCREF(num); Py_DECREF(tuple); - tuple = PyNumber_Divmod(num, seconds_per_day); + tuple = checked_divmod(num, seconds_per_day); if (tuple == NULL) goto Done; Py_DECREF(num); - num = PyTuple_GetItem(tuple, 1); /* seconds */ - if (num == NULL) - goto Done; - temp = PyLong_AsLong(num); + num = PyTuple_GET_ITEM(tuple, 1); /* seconds */ + s = _PyLong_AsInt(num); num = NULL; - if (temp == -1 && PyErr_Occurred()) - goto Done; - assert(0 <= temp && temp < 24*3600); - s = (int)temp; - - if (s < 0) { - /* The divisor was positive, so this must be an error. */ - assert(PyErr_Occurred()); + if (s == -1 && PyErr_Occurred()) { goto Done; } + if (!(0 <= s && s < 24*3600)) { + goto BadDivmod; + } - num = PyTuple_GetItem(tuple, 0); /* leftover days */ - if (num == NULL) - goto Done; + num = PyTuple_GET_ITEM(tuple, 0); /* leftover days */ Py_INCREF(num); - temp = PyLong_AsLong(num); - if (temp == -1 && PyErr_Occurred()) - goto Done; - d = (int)temp; - if ((long)d != temp) { - PyErr_SetString(PyExc_OverflowError, "normalized days too " - "large to fit in a C int"); + d = _PyLong_AsInt(num); + if (d == -1 && PyErr_Occurred()) { goto Done; } result = new_delta_ex(d, s, us, 0, type); @@ -1877,6 +1879,11 @@ microseconds_to_delta_ex(PyObject *pyus, PyTypeObject *type) Py_XDECREF(tuple); Py_XDECREF(num); return result; + +BadDivmod: + PyErr_SetString(PyExc_TypeError, + "divmod() returned a value out of range"); + goto Done; } #define microseconds_to_delta(pymicros) \ @@ -1893,7 +1900,7 @@ multiply_int_timedelta(PyObject *intobj, PyDateTime_Delta *delta) if (pyus_in == NULL) return NULL; - pyus_out = PyNumber_Multiply(pyus_in, intobj); + pyus_out = PyNumber_Multiply(intobj, pyus_in); Py_DECREF(pyus_in); if (pyus_out == NULL) return NULL; @@ -2297,13 +2304,12 @@ delta_divmod(PyObject *left, PyObject *right) return NULL; } - divmod = PyNumber_Divmod(pyus_left, pyus_right); + divmod = checked_divmod(pyus_left, pyus_right); Py_DECREF(pyus_left); Py_DECREF(pyus_right); if (divmod == NULL) return NULL; - assert(PyTuple_Size(divmod) == 2); delta = microseconds_to_delta(PyTuple_GET_ITEM(divmod, 1)); if (delta == NULL) { Py_DECREF(divmod); @@ -2334,13 +2340,11 @@ accum(const char* tag, PyObject *sofar, PyObject *num, PyObject *factor, assert(num != NULL); if (PyLong_Check(num)) { - prod = PyNumber_Multiply(factor, num); + prod = PyNumber_Multiply(num, factor); if (prod == NULL) return NULL; - assert(PyLong_CheckExact(prod)); sum = PyNumber_Add(sofar, prod); Py_DECREF(prod); - assert(sum == NULL || PyLong_CheckExact(sum)); return sum; } @@ -2398,7 +2402,6 @@ accum(const char* tag, PyObject *sofar, PyObject *num, PyObject *factor, Py_DECREF(sum); Py_DECREF(x); *leftover += fracpart; - assert(y == NULL || PyLong_CheckExact(y)); return y; } From webhook-mailer at python.org Tue Nov 20 13:45:44 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Tue, 20 Nov 2018 18:45:44 -0000 Subject: [Python-checkins] bpo-25750: Fix a compiler warning introduced in GH-9084. (GH-10234) Message-ID: https://github.com/python/cpython/commit/b1dede3ee3498100b95265f7fdb0ea2bef9a2ba2 commit: b1dede3ee3498100b95265f7fdb0ea2bef9a2ba2 branch: master author: Serhiy Storchaka committer: GitHub date: 2018-11-20T20:45:40+02:00 summary: bpo-25750: Fix a compiler warning introduced in GH-9084. (GH-10234) files: M Modules/_testcapimodule.c diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index 56a08a418b36..0dc4d7a36b76 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -4586,18 +4586,18 @@ new_hamt(PyObject *self, PyObject *args) static PyObject* bad_get(PyObject *module, PyObject *const *args, Py_ssize_t nargs) { - if (nargs != 3) { - PyErr_SetString(PyExc_TypeError, "bad_get requires exactly 3 arguments"); + PyObject *self, *obj, *cls; + if (!_PyArg_UnpackStack(args, nargs, "bad_get", 3, 3, &self, &obj, &cls)) { return NULL; } - PyObject *res = PyObject_CallObject(args[2], NULL); + PyObject *res = PyObject_CallObject(cls, NULL); if (res == NULL) { return NULL; } Py_DECREF(res); - return PyObject_Repr(args[0]); + return PyObject_Repr(self); } @@ -4960,7 +4960,7 @@ static PyMethodDef TestMethods[] = { {"get_mapping_items", get_mapping_items, METH_O}, {"test_pythread_tss_key_state", test_pythread_tss_key_state, METH_VARARGS}, {"hamt", new_hamt, METH_NOARGS}, - {"bad_get", bad_get, METH_FASTCALL}, + {"bad_get", (PyCFunction)bad_get, METH_FASTCALL}, {"EncodeLocaleEx", encode_locale_ex, METH_VARARGS}, {"DecodeLocaleEx", decode_locale_ex, METH_VARARGS}, {"get_global_config", get_global_config, METH_NOARGS}, From webhook-mailer at python.org Tue Nov 20 13:59:15 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 20 Nov 2018 18:59:15 -0000 Subject: [Python-checkins] bpo-35021: Fix assertion failures in _datetimemodule.c. (GH-10039) Message-ID: https://github.com/python/cpython/commit/d57ab8ac182d15558118523ad1b11b029e105c46 commit: d57ab8ac182d15558118523ad1b11b029e105c46 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-20T10:59:12-08:00 summary: bpo-35021: Fix assertion failures in _datetimemodule.c. (GH-10039) Fixes assertion failures in _datetimemodule.c introduced in the previous fix (see bpo-31752). Rather of trying to handle an int subclass as exact int, let it to use overridden special methods, but check the result of divmod(). (cherry picked from commit 3ec0f495163da3b7a15deb2805cec48aed432f58) Co-authored-by: Serhiy Storchaka files: M Lib/test/datetimetester.py M Modules/_datetimemodule.c diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py index 06fe647fb1a4..78b123f5b118 100644 --- a/Lib/test/datetimetester.py +++ b/Lib/test/datetimetester.py @@ -896,19 +896,50 @@ def test_issue31752(self): class BadInt(int): def __mul__(self, other): return Prod() + def __rmul__(self, other): + return Prod() + def __floordiv__(self, other): + return Prod() + def __rfloordiv__(self, other): + return Prod() class Prod: + def __add__(self, other): + return Sum() def __radd__(self, other): return Sum() class Sum(int): def __divmod__(self, other): - # negative remainder - return (0, -1) - - timedelta(microseconds=BadInt(1)) - timedelta(hours=BadInt(1)) - timedelta(weeks=BadInt(1)) + return divmodresult + + for divmodresult in [None, (), (0, 1, 2), (0, -1)]: + with self.subTest(divmodresult=divmodresult): + # The following examples should not crash. + try: + timedelta(microseconds=BadInt(1)) + except TypeError: + pass + try: + timedelta(hours=BadInt(1)) + except TypeError: + pass + try: + timedelta(weeks=BadInt(1)) + except (TypeError, ValueError): + pass + try: + timedelta(1) * BadInt(1) + except (TypeError, ValueError): + pass + try: + BadInt(1) * timedelta(1) + except TypeError: + pass + try: + timedelta(1) // BadInt(1) + except TypeError: + pass ############################################################################# diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c index 1f15367d3fa3..9477f776138c 100644 --- a/Modules/_datetimemodule.c +++ b/Modules/_datetimemodule.c @@ -1783,6 +1783,29 @@ delta_to_microseconds(PyDateTime_Delta *self) return result; } +static PyObject * +checked_divmod(PyObject *a, PyObject *b) +{ + PyObject *result = PyNumber_Divmod(a, b); + if (result != NULL) { + if (!PyTuple_Check(result)) { + PyErr_Format(PyExc_TypeError, + "divmod() returned non-tuple (type %.200s)", + result->ob_type->tp_name); + Py_DECREF(result); + return NULL; + } + if (PyTuple_GET_SIZE(result) != 2) { + PyErr_Format(PyExc_TypeError, + "divmod() returned a tuple of size %zd", + PyTuple_GET_SIZE(result)); + Py_DECREF(result); + return NULL; + } + } + return result; +} + /* Convert a number of us (as a Python int) to a timedelta. */ static PyObject * @@ -1791,70 +1814,49 @@ microseconds_to_delta_ex(PyObject *pyus, PyTypeObject *type) int us; int s; int d; - long temp; PyObject *tuple = NULL; PyObject *num = NULL; PyObject *result = NULL; - assert(PyLong_CheckExact(pyus)); - tuple = PyNumber_Divmod(pyus, us_per_second); - if (tuple == NULL) + tuple = checked_divmod(pyus, us_per_second); + if (tuple == NULL) { goto Done; + } - num = PyTuple_GetItem(tuple, 1); /* us */ - if (num == NULL) - goto Done; - temp = PyLong_AsLong(num); + num = PyTuple_GET_ITEM(tuple, 1); /* us */ + us = _PyLong_AsInt(num); num = NULL; - if (temp == -1 && PyErr_Occurred()) - goto Done; - assert(0 <= temp && temp < 1000000); - us = (int)temp; - if (us < 0) { - /* The divisor was positive, so this must be an error. */ - assert(PyErr_Occurred()); + if (us == -1 && PyErr_Occurred()) { goto Done; } + if (!(0 <= us && us < 1000000)) { + goto BadDivmod; + } - num = PyTuple_GetItem(tuple, 0); /* leftover seconds */ - if (num == NULL) - goto Done; + num = PyTuple_GET_ITEM(tuple, 0); /* leftover seconds */ Py_INCREF(num); Py_DECREF(tuple); - tuple = PyNumber_Divmod(num, seconds_per_day); + tuple = checked_divmod(num, seconds_per_day); if (tuple == NULL) goto Done; Py_DECREF(num); - num = PyTuple_GetItem(tuple, 1); /* seconds */ - if (num == NULL) - goto Done; - temp = PyLong_AsLong(num); + num = PyTuple_GET_ITEM(tuple, 1); /* seconds */ + s = _PyLong_AsInt(num); num = NULL; - if (temp == -1 && PyErr_Occurred()) - goto Done; - assert(0 <= temp && temp < 24*3600); - s = (int)temp; - - if (s < 0) { - /* The divisor was positive, so this must be an error. */ - assert(PyErr_Occurred()); + if (s == -1 && PyErr_Occurred()) { goto Done; } + if (!(0 <= s && s < 24*3600)) { + goto BadDivmod; + } - num = PyTuple_GetItem(tuple, 0); /* leftover days */ - if (num == NULL) - goto Done; + num = PyTuple_GET_ITEM(tuple, 0); /* leftover days */ Py_INCREF(num); - temp = PyLong_AsLong(num); - if (temp == -1 && PyErr_Occurred()) - goto Done; - d = (int)temp; - if ((long)d != temp) { - PyErr_SetString(PyExc_OverflowError, "normalized days too " - "large to fit in a C int"); + d = _PyLong_AsInt(num); + if (d == -1 && PyErr_Occurred()) { goto Done; } result = new_delta_ex(d, s, us, 0, type); @@ -1863,6 +1865,11 @@ microseconds_to_delta_ex(PyObject *pyus, PyTypeObject *type) Py_XDECREF(tuple); Py_XDECREF(num); return result; + +BadDivmod: + PyErr_SetString(PyExc_TypeError, + "divmod() returned a value out of range"); + goto Done; } #define microseconds_to_delta(pymicros) \ @@ -1879,7 +1886,7 @@ multiply_int_timedelta(PyObject *intobj, PyDateTime_Delta *delta) if (pyus_in == NULL) return NULL; - pyus_out = PyNumber_Multiply(pyus_in, intobj); + pyus_out = PyNumber_Multiply(intobj, pyus_in); Py_DECREF(pyus_in); if (pyus_out == NULL) return NULL; @@ -2283,13 +2290,12 @@ delta_divmod(PyObject *left, PyObject *right) return NULL; } - divmod = PyNumber_Divmod(pyus_left, pyus_right); + divmod = checked_divmod(pyus_left, pyus_right); Py_DECREF(pyus_left); Py_DECREF(pyus_right); if (divmod == NULL) return NULL; - assert(PyTuple_Size(divmod) == 2); delta = microseconds_to_delta(PyTuple_GET_ITEM(divmod, 1)); if (delta == NULL) { Py_DECREF(divmod); @@ -2320,13 +2326,11 @@ accum(const char* tag, PyObject *sofar, PyObject *num, PyObject *factor, assert(num != NULL); if (PyLong_Check(num)) { - prod = PyNumber_Multiply(factor, num); + prod = PyNumber_Multiply(num, factor); if (prod == NULL) return NULL; - assert(PyLong_CheckExact(prod)); sum = PyNumber_Add(sofar, prod); Py_DECREF(prod); - assert(sum == NULL || PyLong_CheckExact(sum)); return sum; } @@ -2384,7 +2388,6 @@ accum(const char* tag, PyObject *sofar, PyObject *num, PyObject *factor, Py_DECREF(sum); Py_DECREF(x); *leftover += fracpart; - assert(y == NULL || PyLong_CheckExact(y)); return y; } From webhook-mailer at python.org Tue Nov 20 14:02:53 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 20 Nov 2018 19:02:53 -0000 Subject: [Python-checkins] bpo-35021: Fix assertion failures in _datetimemodule.c. (GH-10039) Message-ID: https://github.com/python/cpython/commit/7a0d964afb41bde846771c81ba746238339cdd8c commit: 7a0d964afb41bde846771c81ba746238339cdd8c branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-20T11:02:49-08:00 summary: bpo-35021: Fix assertion failures in _datetimemodule.c. (GH-10039) Fixes assertion failures in _datetimemodule.c introduced in the previous fix (see bpo-31752). Rather of trying to handle an int subclass as exact int, let it to use overridden special methods, but check the result of divmod(). (cherry picked from commit 3ec0f495163da3b7a15deb2805cec48aed432f58) Co-authored-by: Serhiy Storchaka files: M Lib/test/datetimetester.py M Modules/_datetimemodule.c diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py index 40a457c9c538..54035ab57f8d 100644 --- a/Lib/test/datetimetester.py +++ b/Lib/test/datetimetester.py @@ -872,19 +872,50 @@ def test_issue31752(self): class BadInt(int): def __mul__(self, other): return Prod() + def __rmul__(self, other): + return Prod() + def __floordiv__(self, other): + return Prod() + def __rfloordiv__(self, other): + return Prod() class Prod: + def __add__(self, other): + return Sum() def __radd__(self, other): return Sum() class Sum(int): def __divmod__(self, other): - # negative remainder - return (0, -1) - - timedelta(microseconds=BadInt(1)) - timedelta(hours=BadInt(1)) - timedelta(weeks=BadInt(1)) + return divmodresult + + for divmodresult in [None, (), (0, 1, 2), (0, -1)]: + with self.subTest(divmodresult=divmodresult): + # The following examples should not crash. + try: + timedelta(microseconds=BadInt(1)) + except TypeError: + pass + try: + timedelta(hours=BadInt(1)) + except TypeError: + pass + try: + timedelta(weeks=BadInt(1)) + except (TypeError, ValueError): + pass + try: + timedelta(1) * BadInt(1) + except (TypeError, ValueError): + pass + try: + BadInt(1) * timedelta(1) + except TypeError: + pass + try: + timedelta(1) // BadInt(1) + except TypeError: + pass ############################################################################# diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c index b2e0176b3232..2edaf1b319c4 100644 --- a/Modules/_datetimemodule.c +++ b/Modules/_datetimemodule.c @@ -1542,6 +1542,29 @@ delta_to_microseconds(PyDateTime_Delta *self) return result; } +static PyObject * +checked_divmod(PyObject *a, PyObject *b) +{ + PyObject *result = PyNumber_Divmod(a, b); + if (result != NULL) { + if (!PyTuple_Check(result)) { + PyErr_Format(PyExc_TypeError, + "divmod() returned non-tuple (type %.200s)", + result->ob_type->tp_name); + Py_DECREF(result); + return NULL; + } + if (PyTuple_GET_SIZE(result) != 2) { + PyErr_Format(PyExc_TypeError, + "divmod() returned a tuple of size %zd", + PyTuple_GET_SIZE(result)); + Py_DECREF(result); + return NULL; + } + } + return result; +} + /* Convert a number of us (as a Python int) to a timedelta. */ static PyObject * @@ -1550,70 +1573,49 @@ microseconds_to_delta_ex(PyObject *pyus, PyTypeObject *type) int us; int s; int d; - long temp; PyObject *tuple = NULL; PyObject *num = NULL; PyObject *result = NULL; - assert(PyLong_CheckExact(pyus)); - tuple = PyNumber_Divmod(pyus, us_per_second); - if (tuple == NULL) + tuple = checked_divmod(pyus, us_per_second); + if (tuple == NULL) { goto Done; + } - num = PyTuple_GetItem(tuple, 1); /* us */ - if (num == NULL) - goto Done; - temp = PyLong_AsLong(num); + num = PyTuple_GET_ITEM(tuple, 1); /* us */ + us = _PyLong_AsInt(num); num = NULL; - if (temp == -1 && PyErr_Occurred()) - goto Done; - assert(0 <= temp && temp < 1000000); - us = (int)temp; - if (us < 0) { - /* The divisor was positive, so this must be an error. */ - assert(PyErr_Occurred()); + if (us == -1 && PyErr_Occurred()) { goto Done; } + if (!(0 <= us && us < 1000000)) { + goto BadDivmod; + } - num = PyTuple_GetItem(tuple, 0); /* leftover seconds */ - if (num == NULL) - goto Done; + num = PyTuple_GET_ITEM(tuple, 0); /* leftover seconds */ Py_INCREF(num); Py_DECREF(tuple); - tuple = PyNumber_Divmod(num, seconds_per_day); + tuple = checked_divmod(num, seconds_per_day); if (tuple == NULL) goto Done; Py_DECREF(num); - num = PyTuple_GetItem(tuple, 1); /* seconds */ - if (num == NULL) - goto Done; - temp = PyLong_AsLong(num); + num = PyTuple_GET_ITEM(tuple, 1); /* seconds */ + s = _PyLong_AsInt(num); num = NULL; - if (temp == -1 && PyErr_Occurred()) - goto Done; - assert(0 <= temp && temp < 24*3600); - s = (int)temp; - - if (s < 0) { - /* The divisor was positive, so this must be an error. */ - assert(PyErr_Occurred()); + if (s == -1 && PyErr_Occurred()) { goto Done; } + if (!(0 <= s && s < 24*3600)) { + goto BadDivmod; + } - num = PyTuple_GetItem(tuple, 0); /* leftover days */ - if (num == NULL) - goto Done; + num = PyTuple_GET_ITEM(tuple, 0); /* leftover days */ Py_INCREF(num); - temp = PyLong_AsLong(num); - if (temp == -1 && PyErr_Occurred()) - goto Done; - d = (int)temp; - if ((long)d != temp) { - PyErr_SetString(PyExc_OverflowError, "normalized days too " - "large to fit in a C int"); + d = _PyLong_AsInt(num); + if (d == -1 && PyErr_Occurred()) { goto Done; } result = new_delta_ex(d, s, us, 0, type); @@ -1622,6 +1624,11 @@ microseconds_to_delta_ex(PyObject *pyus, PyTypeObject *type) Py_XDECREF(tuple); Py_XDECREF(num); return result; + +BadDivmod: + PyErr_SetString(PyExc_TypeError, + "divmod() returned a value out of range"); + goto Done; } #define microseconds_to_delta(pymicros) \ @@ -1638,7 +1645,7 @@ multiply_int_timedelta(PyObject *intobj, PyDateTime_Delta *delta) if (pyus_in == NULL) return NULL; - pyus_out = PyNumber_Multiply(pyus_in, intobj); + pyus_out = PyNumber_Multiply(intobj, pyus_in); Py_DECREF(pyus_in); if (pyus_out == NULL) return NULL; @@ -2073,13 +2080,12 @@ delta_divmod(PyObject *left, PyObject *right) return NULL; } - divmod = PyNumber_Divmod(pyus_left, pyus_right); + divmod = checked_divmod(pyus_left, pyus_right); Py_DECREF(pyus_left); Py_DECREF(pyus_right); if (divmod == NULL) return NULL; - assert(PyTuple_Size(divmod) == 2); delta = microseconds_to_delta(PyTuple_GET_ITEM(divmod, 1)); if (delta == NULL) { Py_DECREF(divmod); @@ -2110,13 +2116,11 @@ accum(const char* tag, PyObject *sofar, PyObject *num, PyObject *factor, assert(num != NULL); if (PyLong_Check(num)) { - prod = PyNumber_Multiply(factor, num); + prod = PyNumber_Multiply(num, factor); if (prod == NULL) return NULL; - assert(PyLong_CheckExact(prod)); sum = PyNumber_Add(sofar, prod); Py_DECREF(prod); - assert(sum == NULL || PyLong_CheckExact(sum)); return sum; } @@ -2174,7 +2178,6 @@ accum(const char* tag, PyObject *sofar, PyObject *num, PyObject *factor, Py_DECREF(sum); Py_DECREF(x); *leftover += fracpart; - assert(y == NULL || PyLong_CheckExact(y)); return y; } From webhook-mailer at python.org Tue Nov 20 14:56:41 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Tue, 20 Nov 2018 19:56:41 -0000 Subject: [Python-checkins] [2.7] bpo-35021: Fix assertion failures in _datetimemodule.c. (GH-10039) (GH-10617) Message-ID: https://github.com/python/cpython/commit/40fdf471931f029ea07e6190f0fe116e0735661b commit: 40fdf471931f029ea07e6190f0fe116e0735661b branch: 2.7 author: Serhiy Storchaka committer: GitHub date: 2018-11-20T21:56:34+02:00 summary: [2.7] bpo-35021: Fix assertion failures in _datetimemodule.c. (GH-10039) (GH-10617) Fixes assertion failures in _datetimemodule.c introduced in the previous fix (see bpo-31752). Rather of trying to handle an int subclass as exact int, let it to use overridden special methods, but check the result of divmod(). (cherry picked from commit 3ec0f495163da3b7a15deb2805cec48aed432f58) Co-authored-by: Serhiy Storchaka files: M Lib/test/test_datetime.py M Modules/datetimemodule.c diff --git a/Lib/test/test_datetime.py b/Lib/test/test_datetime.py index f56c3f5fe3de..2620fbb9fbf7 100644 --- a/Lib/test/test_datetime.py +++ b/Lib/test/test_datetime.py @@ -495,41 +495,64 @@ def as_hours(self): def test_issue31752(self): # The interpreter shouldn't crash because divmod() returns negative # remainder. - class BadInt(int): - def __mul__(self, other): - return Prod() - - class BadLong(long): - def __mul__(self, other): - return Prod() - - class Prod: - def __radd__(self, other): - return Sum() - - class Sum(int): - def __divmod__(self, other): - # negative remainder - return (0, -1) - - timedelta(microseconds=BadInt(1)) - timedelta(hours=BadInt(1)) - timedelta(weeks=BadInt(1)) - timedelta(microseconds=BadLong(1)) - timedelta(hours=BadLong(1)) - timedelta(weeks=BadLong(1)) - - class Sum(long): - def __divmod__(self, other): - # negative remainder - return (0, -1) - - timedelta(microseconds=BadInt(1)) - timedelta(hours=BadInt(1)) - timedelta(weeks=BadInt(1)) - timedelta(microseconds=BadLong(1)) - timedelta(hours=BadLong(1)) - timedelta(weeks=BadLong(1)) + for inttype in (int, long): + class BadInt(inttype): + def __mul__(self, other): + return Prod() + def __rmul__(self, other): + return Prod() + def __floordiv__(self, other): + return Prod() + def __rfloordiv__(self, other): + return Prod() + + class BadLong(long): + def __mul__(self, other): + return Prod() + def __rmul__(self, other): + return Prod() + def __floordiv__(self, other): + return Prod() + def __rfloordiv__(self, other): + return Prod() + + class Prod: + def __add__(self, other): + return Sum() + def __radd__(self, other): + return Sum() + + for inttype2 in (int, long): + class Sum(inttype2): + def __divmod__(self, other): + return divmodresult + + for divmodresult in [None, (), (0, 1, 2), (0, -1)]: + # The following examples should not crash. + try: + timedelta(microseconds=BadInt(1)) + except TypeError: + pass + try: + timedelta(hours=BadInt(1)) + except TypeError: + pass + try: + timedelta(weeks=BadInt(1)) + except (TypeError, ValueError): + pass + try: + timedelta(1) * BadInt(1) + except (TypeError, ValueError): + pass + try: + BadInt(1) * timedelta(1) + except TypeError: + pass + try: + timedelta(1) // BadInt(1) + except TypeError: + pass ############################################################################# diff --git a/Modules/datetimemodule.c b/Modules/datetimemodule.c index c0b7102de234..29492de5167c 100644 --- a/Modules/datetimemodule.c +++ b/Modules/datetimemodule.c @@ -1546,6 +1546,29 @@ delta_to_microseconds(PyDateTime_Delta *self) return result; } +static PyObject * +checked_divmod(PyObject *a, PyObject *b) +{ + PyObject *result = PyNumber_Divmod(a, b); + if (result != NULL) { + if (!PyTuple_Check(result)) { + PyErr_Format(PyExc_TypeError, + "divmod() returned non-tuple (type %.200s)", + result->ob_type->tp_name); + Py_DECREF(result); + return NULL; + } + if (PyTuple_GET_SIZE(result) != 2) { + PyErr_Format(PyExc_TypeError, + "divmod() returned a tuple of size %zd", + PyTuple_GET_SIZE(result)); + Py_DECREF(result); + return NULL; + } + } + return result; +} + /* Convert a number of us (as a Python int or long) to a timedelta. */ static PyObject * @@ -1554,70 +1577,49 @@ microseconds_to_delta_ex(PyObject *pyus, PyTypeObject *type) int us; int s; int d; - long temp; PyObject *tuple = NULL; PyObject *num = NULL; PyObject *result = NULL; - assert(_PyAnyInt_CheckExact(pyus)); - tuple = PyNumber_Divmod(pyus, us_per_second); - if (tuple == NULL) + tuple = checked_divmod(pyus, us_per_second); + if (tuple == NULL) { goto Done; + } - num = PyTuple_GetItem(tuple, 1); /* us */ - if (num == NULL) - goto Done; - temp = PyLong_AsLong(num); + num = PyTuple_GET_ITEM(tuple, 1); /* us */ + us = _PyLong_AsInt(num); num = NULL; - if (temp == -1 && PyErr_Occurred()) - goto Done; - assert(0 <= temp && temp < 1000000); - us = (int)temp; - if (us < 0) { - /* The divisor was positive, so this must be an error. */ - assert(PyErr_Occurred()); + if (us == -1 && PyErr_Occurred()) { goto Done; } + if (!(0 <= us && us < 1000000)) { + goto BadDivmod; + } - num = PyTuple_GetItem(tuple, 0); /* leftover seconds */ - if (num == NULL) - goto Done; + num = PyTuple_GET_ITEM(tuple, 0); /* leftover seconds */ Py_INCREF(num); Py_DECREF(tuple); - tuple = PyNumber_Divmod(num, seconds_per_day); + tuple = checked_divmod(num, seconds_per_day); if (tuple == NULL) goto Done; Py_DECREF(num); - num = PyTuple_GetItem(tuple, 1); /* seconds */ - if (num == NULL) - goto Done; - temp = PyLong_AsLong(num); + num = PyTuple_GET_ITEM(tuple, 1); /* seconds */ + s = _PyLong_AsInt(num); num = NULL; - if (temp == -1 && PyErr_Occurred()) - goto Done; - assert(0 <= temp && temp < 24*3600); - s = (int)temp; - - if (s < 0) { - /* The divisor was positive, so this must be an error. */ - assert(PyErr_Occurred()); + if (s == -1 && PyErr_Occurred()) { goto Done; } + if (!(0 <= s && s < 24*3600)) { + goto BadDivmod; + } - num = PyTuple_GetItem(tuple, 0); /* leftover days */ - if (num == NULL) - goto Done; + num = PyTuple_GET_ITEM(tuple, 0); /* leftover days */ Py_INCREF(num); - temp = PyLong_AsLong(num); - if (temp == -1 && PyErr_Occurred()) - goto Done; - d = (int)temp; - if ((long)d != temp) { - PyErr_SetString(PyExc_OverflowError, "normalized days too " - "large to fit in a C int"); + d = _PyLong_AsInt(num); + if (d == -1 && PyErr_Occurred()) { goto Done; } result = new_delta_ex(d, s, us, 0, type); @@ -1626,6 +1628,11 @@ microseconds_to_delta_ex(PyObject *pyus, PyTypeObject *type) Py_XDECREF(tuple); Py_XDECREF(num); return result; + +BadDivmod: + PyErr_SetString(PyExc_TypeError, + "divmod() returned a value out of range"); + goto Done; } #define microseconds_to_delta(pymicros) \ @@ -1642,7 +1649,7 @@ multiply_int_timedelta(PyObject *intobj, PyDateTime_Delta *delta) if (pyus_in == NULL) return NULL; - pyus_out = PyNumber_Multiply(pyus_in, intobj); + pyus_out = PyNumber_Multiply(intobj, pyus_in); Py_DECREF(pyus_in); if (pyus_out == NULL) return NULL; @@ -1853,13 +1860,11 @@ accum(const char* tag, PyObject *sofar, PyObject *num, PyObject *factor, assert(num != NULL); if (_PyAnyInt_Check(num)) { - prod = PyNumber_Multiply(factor, num); + prod = PyNumber_Multiply(num, factor); if (prod == NULL) return NULL; - assert(_PyAnyInt_CheckExact(prod)); sum = PyNumber_Add(sofar, prod); Py_DECREF(prod); - assert(sum == NULL || _PyAnyInt_CheckExact(sum)); return sum; } @@ -1920,7 +1925,6 @@ accum(const char* tag, PyObject *sofar, PyObject *num, PyObject *factor, Py_DECREF(sum); Py_DECREF(x); *leftover += fracpart; - assert(y == NULL || _PyAnyInt_CheckExact(y)); return y; } From webhook-mailer at python.org Tue Nov 20 16:06:26 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 20 Nov 2018 21:06:26 -0000 Subject: [Python-checkins] bpo-28604: Fix localeconv() for different LC_MONETARY (GH-10606) (GH-10619) Message-ID: https://github.com/python/cpython/commit/6eff6b8eecd7a8eccad16419269fa18ec820922e commit: 6eff6b8eecd7a8eccad16419269fa18ec820922e branch: 3.7 author: Victor Stinner committer: GitHub date: 2018-11-20T22:06:21+01:00 summary: bpo-28604: Fix localeconv() for different LC_MONETARY (GH-10606) (GH-10619) locale.localeconv() now sets temporarily the LC_CTYPE locale to the LC_MONETARY locale if the two locales are different and monetary strings are non-ASCII. This temporary change affects other threads. Changes: * locale.localeconv() can now set LC_CTYPE to LC_MONETARY to decode monetary fields. * Add LocaleInfo.grouping_buffer: copy localeconv() grouping string since it can be replaced anytime if a different thread calls localeconv(). (cherry picked from commit 02e6bf7f2025cddcbde6432f6b6396198ab313f4) files: A Misc/NEWS.d/next/Library/2018-11-20-13-34-01.bpo-28604.iiih5h.rst M Doc/library/locale.rst M Modules/_localemodule.c M Python/fileutils.c M Python/formatter_unicode.c diff --git a/Doc/library/locale.rst b/Doc/library/locale.rst index 2fd44fe8e90a..bf57a0835591 100644 --- a/Doc/library/locale.rst +++ b/Doc/library/locale.rst @@ -148,10 +148,8 @@ The :mod:`locale` module defines the following exception and functions: +--------------+-----------------------------------------+ The function sets temporarily the ``LC_CTYPE`` locale to the ``LC_NUMERIC`` - locale to decode ``decimal_point`` and ``thousands_sep`` byte strings if - they are non-ASCII or longer than 1 byte, and the ``LC_NUMERIC`` locale is - different than the ``LC_CTYPE`` locale. This temporary change affects other - threads. + locale or the ``LC_MONETARY`` locale if locales are different and numeric or + monetary strings are non-ASCII. This temporary change affects other threads. .. versionchanged:: 3.7 The function now sets temporarily the ``LC_CTYPE`` locale to the diff --git a/Misc/NEWS.d/next/Library/2018-11-20-13-34-01.bpo-28604.iiih5h.rst b/Misc/NEWS.d/next/Library/2018-11-20-13-34-01.bpo-28604.iiih5h.rst new file mode 100644 index 000000000000..289e484c35d6 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-11-20-13-34-01.bpo-28604.iiih5h.rst @@ -0,0 +1,3 @@ +:func:`locale.localeconv` now sets temporarily the ``LC_CTYPE`` locale to the +``LC_MONETARY`` locale if the two locales are different and monetary strings +are non-ASCII. This temporary change affects other threads. diff --git a/Modules/_localemodule.c b/Modules/_localemodule.c index f9eeeb72dd9e..716a7306d3dc 100644 --- a/Modules/_localemodule.c +++ b/Modules/_localemodule.c @@ -128,6 +128,82 @@ PyLocale_setlocale(PyObject* self, PyObject* args) return result_object; } +static int +locale_is_ascii(const char *str) +{ + return (strlen(str) == 1 && ((unsigned char)str[0]) <= 127); +} + +static int +locale_decode_monetary(PyObject *dict, struct lconv *lc) +{ + int change_locale; + change_locale = (!locale_is_ascii(lc->int_curr_symbol) + || !locale_is_ascii(lc->currency_symbol) + || !locale_is_ascii(lc->mon_decimal_point) + || !locale_is_ascii(lc->mon_thousands_sep)); + + /* Keep a copy of the LC_CTYPE locale */ + char *oldloc = NULL, *loc = NULL; + if (change_locale) { + oldloc = setlocale(LC_CTYPE, NULL); + if (!oldloc) { + PyErr_SetString(PyExc_RuntimeWarning, + "failed to get LC_CTYPE locale"); + return -1; + } + + oldloc = _PyMem_Strdup(oldloc); + if (!oldloc) { + PyErr_NoMemory(); + return -1; + } + + loc = setlocale(LC_MONETARY, NULL); + if (loc != NULL && strcmp(loc, oldloc) == 0) { + loc = NULL; + } + + if (loc != NULL) { + /* Only set the locale temporarily the LC_CTYPE locale + to the LC_MONETARY locale if the two locales are different and + at least one string is non-ASCII. */ + setlocale(LC_CTYPE, loc); + } + } + + int res = -1; + +#define RESULT_STRING(ATTR) \ + do { \ + PyObject *obj; \ + obj = PyUnicode_DecodeLocale(lc->ATTR, NULL); \ + if (obj == NULL) { \ + goto done; \ + } \ + if (PyDict_SetItemString(dict, Py_STRINGIFY(ATTR), obj) < 0) { \ + Py_DECREF(obj); \ + goto done; \ + } \ + Py_DECREF(obj); \ + } while (0) + + RESULT_STRING(int_curr_symbol); + RESULT_STRING(currency_symbol); + RESULT_STRING(mon_decimal_point); + RESULT_STRING(mon_thousands_sep); +#undef RESULT_STRING + + res = 0; + +done: + if (loc != NULL) { + setlocale(LC_CTYPE, oldloc); + } + PyMem_Free(oldloc); + return res; +} + PyDoc_STRVAR(localeconv__doc__, "() -> dict. Returns numeric and monetary locale-specific parameters."); @@ -172,11 +248,10 @@ PyLocale_localeconv(PyObject* self) RESULT(#i, x); \ } while (0) - /* Monetary information */ - RESULT_STRING(int_curr_symbol); - RESULT_STRING(currency_symbol); - RESULT_STRING(mon_decimal_point); - RESULT_STRING(mon_thousands_sep); + /* Monetary information: LC_MONETARY encoding */ + if (locale_decode_monetary(result, l) < 0) { + goto failed; + } x = copy_grouping(l->mon_grouping); RESULT("mon_grouping", x); @@ -191,7 +266,7 @@ PyLocale_localeconv(PyObject* self) RESULT_INT(p_sign_posn); RESULT_INT(n_sign_posn); - /* Numeric information */ + /* Numeric information: LC_NUMERIC encoding */ PyObject *decimal_point, *thousands_sep; const char *grouping; if (_Py_GetLocaleconvNumeric(&decimal_point, @@ -221,6 +296,10 @@ PyLocale_localeconv(PyObject* self) failed: Py_DECREF(result); return NULL; + +#undef RESULT +#undef RESULT_STRING +#undef RESULT_INT } #if defined(HAVE_WCSCOLL) diff --git a/Python/fileutils.c b/Python/fileutils.c index b3b7925073b2..b77e490ce236 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -1801,7 +1801,7 @@ _Py_GetLocaleconvNumeric(PyObject **decimal_point, PyObject **thousands_sep, if (change_locale) { oldloc = setlocale(LC_CTYPE, NULL); if (!oldloc) { - PyErr_SetString(PyExc_RuntimeWarning, "faild to get LC_CTYPE locale"); + PyErr_SetString(PyExc_RuntimeWarning, "failed to get LC_CTYPE locale"); return -1; } @@ -1817,7 +1817,7 @@ _Py_GetLocaleconvNumeric(PyObject **decimal_point, PyObject **thousands_sep, } if (loc != NULL) { - /* Only set the locale temporarilty the LC_CTYPE locale + /* Only set the locale temporarily the LC_CTYPE locale if LC_NUMERIC locale is different than LC_CTYPE locale and decimal_point and/or thousands_sep are non-ASCII or longer than 1 byte */ diff --git a/Python/formatter_unicode.c b/Python/formatter_unicode.c index ba09cc67becf..2cd3eb8eb750 100644 --- a/Python/formatter_unicode.c +++ b/Python/formatter_unicode.c @@ -396,9 +396,10 @@ typedef struct { PyObject *decimal_point; PyObject *thousands_sep; const char *grouping; + char *grouping_buffer; } LocaleInfo; -#define STATIC_LOCALE_INFO_INIT {0, 0, 0} +#define STATIC_LOCALE_INFO_INIT {0, 0, 0, 0} /* describes the layout for an integer, see the comment in calc_number_widths() for details */ @@ -705,11 +706,22 @@ get_locale_info(enum LocaleType type, LocaleInfo *locale_info) { switch (type) { case LT_CURRENT_LOCALE: { + const char *grouping; if (_Py_GetLocaleconvNumeric(&locale_info->decimal_point, &locale_info->thousands_sep, - &locale_info->grouping) < 0) { + &grouping) < 0) { return -1; } + + /* localeconv() grouping can become a dangling pointer or point + to a different string if another thread calls localeconv() during + the string formatting. Copy the string to avoid this risk. */ + locale_info->grouping_buffer = _PyMem_Strdup(grouping); + if (locale_info->grouping_buffer == NULL) { + PyErr_NoMemory(); + return -1; + } + locale_info->grouping = locale_info->grouping_buffer; break; } case LT_DEFAULT_LOCALE: @@ -743,6 +755,7 @@ free_locale_info(LocaleInfo *locale_info) { Py_XDECREF(locale_info->decimal_point); Py_XDECREF(locale_info->thousands_sep); + PyMem_Free(locale_info->grouping_buffer); } /************************************************************************/ From webhook-mailer at python.org Tue Nov 20 16:28:34 2018 From: webhook-mailer at python.org (Steve Dower) Date: Tue, 20 Nov 2018 21:28:34 -0000 Subject: [Python-checkins] bpo-34532: Fixed exit code for py.exe list versions arg (GH-9039) Message-ID: https://github.com/python/cpython/commit/c8fe9ccf7bfbcf9a2cb48e3b6abacf6ec0e5e58d commit: c8fe9ccf7bfbcf9a2cb48e3b6abacf6ec0e5e58d branch: master author: Brendan Gerrity committer: Steve Dower date: 2018-11-20T13:28:27-08:00 summary: bpo-34532: Fixed exit code for py.exe list versions arg (GH-9039) files: A Misc/NEWS.d/next/Windows/2018-09-03-01-23-52.bpo-34532.N1HEbE.rst M PC/launcher.c diff --git a/Misc/NEWS.d/next/Windows/2018-09-03-01-23-52.bpo-34532.N1HEbE.rst b/Misc/NEWS.d/next/Windows/2018-09-03-01-23-52.bpo-34532.N1HEbE.rst new file mode 100644 index 000000000000..812b47497c2d --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2018-09-03-01-23-52.bpo-34532.N1HEbE.rst @@ -0,0 +1 @@ +Fixes exit code of list version arguments for py.exe. diff --git a/PC/launcher.c b/PC/launcher.c index 75a06c2310c8..2c2da76f6146 100644 --- a/PC/launcher.c +++ b/PC/launcher.c @@ -1454,7 +1454,7 @@ show_python_list(wchar_t ** argv) fwprintf(stderr, L"\n\nCan't find a Default Python.\n\n"); else fwprintf(stderr, L"\n\n"); /* End with a blank line */ - return(FALSE); /* If this has been called we cannot continue */ + return FALSE; /* If this has been called we cannot continue */ } static int @@ -1601,11 +1601,12 @@ process(int argc, wchar_t ** argv) else { p = argv[1]; plen = wcslen(p); - if ((argc == 2) && - (!wcsncmp(p, L"-0", wcslen(L"-0")) || /* Starts with -0 or --list */ + if ((argc == 2) && // list version args + (!wcsncmp(p, L"-0", wcslen(L"-0")) || !wcsncmp(p, L"--list", wcslen(L"--list")))) { - valid = show_python_list(argv); /* Check for -0 or --list FIRST */ + show_python_list(argv); + return rc; } valid = valid && (*p == L'-') && validate_version(&p[1]); if (valid) { From webhook-mailer at python.org Tue Nov 20 16:36:20 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 20 Nov 2018 21:36:20 -0000 Subject: [Python-checkins] bpo-28604: Fix localeconv() for different LC_MONETARY (GH-10606) (GH-10619) (GH-10621) Message-ID: https://github.com/python/cpython/commit/df3051b53fd7f2862a4087f5449e811d8421347a commit: df3051b53fd7f2862a4087f5449e811d8421347a branch: 3.6 author: Victor Stinner committer: GitHub date: 2018-11-20T22:36:15+01:00 summary: bpo-28604: Fix localeconv() for different LC_MONETARY (GH-10606) (GH-10619) (GH-10621) locale.localeconv() now sets temporarily the LC_CTYPE locale to the LC_MONETARY locale if the two locales are different and monetary strings are non-ASCII. This temporary change affects other threads. Changes: * locale.localeconv() can now set LC_CTYPE to LC_MONETARY to decode monetary fields. * Add LocaleInfo.grouping_buffer: copy localeconv() grouping string since it can be replaced anytime if a different thread calls localeconv(). (cherry picked from commit 02e6bf7f2025cddcbde6432f6b6396198ab313f4) (cherry picked from commit 6eff6b8eecd7a8eccad16419269fa18ec820922e) files: A Misc/NEWS.d/next/Library/2018-11-20-13-34-01.bpo-28604.iiih5h.rst M Doc/library/locale.rst M Modules/_localemodule.c M Python/fileutils.c M Python/formatter_unicode.c diff --git a/Doc/library/locale.rst b/Doc/library/locale.rst index 9a0c570533a1..2addc0ea6622 100644 --- a/Doc/library/locale.rst +++ b/Doc/library/locale.rst @@ -148,10 +148,8 @@ The :mod:`locale` module defines the following exception and functions: +--------------+-----------------------------------------+ The function sets temporarily the ``LC_CTYPE`` locale to the ``LC_NUMERIC`` - locale to decode ``decimal_point`` and ``thousands_sep`` byte strings if - they are non-ASCII or longer than 1 byte, and the ``LC_NUMERIC`` locale is - different than the ``LC_CTYPE`` locale. This temporary change affects other - threads. + locale or the ``LC_MONETARY`` locale if locales are different and numeric or + monetary strings are non-ASCII. This temporary change affects other threads. .. versionchanged:: 3.6.5 The function now sets temporarily the ``LC_CTYPE`` locale to the diff --git a/Misc/NEWS.d/next/Library/2018-11-20-13-34-01.bpo-28604.iiih5h.rst b/Misc/NEWS.d/next/Library/2018-11-20-13-34-01.bpo-28604.iiih5h.rst new file mode 100644 index 000000000000..289e484c35d6 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-11-20-13-34-01.bpo-28604.iiih5h.rst @@ -0,0 +1,3 @@ +:func:`locale.localeconv` now sets temporarily the ``LC_CTYPE`` locale to the +``LC_MONETARY`` locale if the two locales are different and monetary strings +are non-ASCII. This temporary change affects other threads. diff --git a/Modules/_localemodule.c b/Modules/_localemodule.c index 95b370b1ad08..f3421af65f3d 100644 --- a/Modules/_localemodule.c +++ b/Modules/_localemodule.c @@ -128,6 +128,82 @@ PyLocale_setlocale(PyObject* self, PyObject* args) return result_object; } +static int +locale_is_ascii(const char *str) +{ + return (strlen(str) == 1 && ((unsigned char)str[0]) <= 127); +} + +static int +locale_decode_monetary(PyObject *dict, struct lconv *lc) +{ + int change_locale; + change_locale = (!locale_is_ascii(lc->int_curr_symbol) + || !locale_is_ascii(lc->currency_symbol) + || !locale_is_ascii(lc->mon_decimal_point) + || !locale_is_ascii(lc->mon_thousands_sep)); + + /* Keep a copy of the LC_CTYPE locale */ + char *oldloc = NULL, *loc = NULL; + if (change_locale) { + oldloc = setlocale(LC_CTYPE, NULL); + if (!oldloc) { + PyErr_SetString(PyExc_RuntimeWarning, + "failed to get LC_CTYPE locale"); + return -1; + } + + oldloc = _PyMem_Strdup(oldloc); + if (!oldloc) { + PyErr_NoMemory(); + return -1; + } + + loc = setlocale(LC_MONETARY, NULL); + if (loc != NULL && strcmp(loc, oldloc) == 0) { + loc = NULL; + } + + if (loc != NULL) { + /* Only set the locale temporarily the LC_CTYPE locale + to the LC_MONETARY locale if the two locales are different and + at least one string is non-ASCII. */ + setlocale(LC_CTYPE, loc); + } + } + + int res = -1; + +#define RESULT_STRING(ATTR) \ + do { \ + PyObject *obj; \ + obj = PyUnicode_DecodeLocale(lc->ATTR, NULL); \ + if (obj == NULL) { \ + goto done; \ + } \ + if (PyDict_SetItemString(dict, Py_STRINGIFY(ATTR), obj) < 0) { \ + Py_DECREF(obj); \ + goto done; \ + } \ + Py_DECREF(obj); \ + } while (0) + + RESULT_STRING(int_curr_symbol); + RESULT_STRING(currency_symbol); + RESULT_STRING(mon_decimal_point); + RESULT_STRING(mon_thousands_sep); +#undef RESULT_STRING + + res = 0; + +done: + if (loc != NULL) { + setlocale(LC_CTYPE, oldloc); + } + PyMem_Free(oldloc); + return res; +} + PyDoc_STRVAR(localeconv__doc__, "() -> dict. Returns numeric and monetary locale-specific parameters."); @@ -171,11 +247,10 @@ PyLocale_localeconv(PyObject* self) RESULT(#i, x); \ } while (0) - /* Monetary information */ - RESULT_STRING(int_curr_symbol); - RESULT_STRING(currency_symbol); - RESULT_STRING(mon_decimal_point); - RESULT_STRING(mon_thousands_sep); + /* Monetary information: LC_MONETARY encoding */ + if (locale_decode_monetary(result, l) < 0) { + goto failed; + } x = copy_grouping(l->mon_grouping); RESULT("mon_grouping", x); @@ -190,7 +265,7 @@ PyLocale_localeconv(PyObject* self) RESULT_INT(p_sign_posn); RESULT_INT(n_sign_posn); - /* Numeric information */ + /* Numeric information: LC_NUMERIC encoding */ PyObject *decimal_point, *thousands_sep; const char *grouping; if (_Py_GetLocaleconvNumeric(&decimal_point, @@ -220,6 +295,10 @@ PyLocale_localeconv(PyObject* self) failed: Py_XDECREF(result); return NULL; + +#undef RESULT +#undef RESULT_STRING +#undef RESULT_INT } #if defined(HAVE_WCSCOLL) diff --git a/Python/fileutils.c b/Python/fileutils.c index 306838ecce44..d1a9ca03a134 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -1687,7 +1687,7 @@ _Py_GetLocaleconvNumeric(PyObject **decimal_point, PyObject **thousands_sep, if (change_locale) { oldloc = setlocale(LC_CTYPE, NULL); if (!oldloc) { - PyErr_SetString(PyExc_RuntimeWarning, "faild to get LC_CTYPE locale"); + PyErr_SetString(PyExc_RuntimeWarning, "failed to get LC_CTYPE locale"); return -1; } @@ -1703,7 +1703,7 @@ _Py_GetLocaleconvNumeric(PyObject **decimal_point, PyObject **thousands_sep, } if (loc != NULL) { - /* Only set the locale temporarilty the LC_CTYPE locale + /* Only set the locale temporarily the LC_CTYPE locale if LC_NUMERIC locale is different than LC_CTYPE locale and decimal_point and/or thousands_sep are non-ASCII or longer than 1 byte */ diff --git a/Python/formatter_unicode.c b/Python/formatter_unicode.c index d6772c593877..c9a2c99dd257 100644 --- a/Python/formatter_unicode.c +++ b/Python/formatter_unicode.c @@ -397,9 +397,10 @@ typedef struct { PyObject *decimal_point; PyObject *thousands_sep; const char *grouping; + char *grouping_buffer; } LocaleInfo; -#define STATIC_LOCALE_INFO_INIT {0, 0, 0} +#define STATIC_LOCALE_INFO_INIT {0, 0, 0, 0} /* describes the layout for an integer, see the comment in calc_number_widths() for details */ @@ -708,11 +709,22 @@ get_locale_info(enum LocaleType type, LocaleInfo *locale_info) { switch (type) { case LT_CURRENT_LOCALE: { + const char *grouping; if (_Py_GetLocaleconvNumeric(&locale_info->decimal_point, &locale_info->thousands_sep, - &locale_info->grouping) < 0) { + &grouping) < 0) { return -1; } + + /* localeconv() grouping can become a dangling pointer or point + to a different string if another thread calls localeconv() during + the string formatting. Copy the string to avoid this risk. */ + locale_info->grouping_buffer = _PyMem_Strdup(grouping); + if (locale_info->grouping_buffer == NULL) { + PyErr_NoMemory(); + return -1; + } + locale_info->grouping = locale_info->grouping_buffer; break; } case LT_DEFAULT_LOCALE: @@ -746,6 +758,7 @@ free_locale_info(LocaleInfo *locale_info) { Py_XDECREF(locale_info->decimal_point); Py_XDECREF(locale_info->thousands_sep); + PyMem_Free(locale_info->grouping_buffer); } /************************************************************************/ From webhook-mailer at python.org Tue Nov 20 16:48:39 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 20 Nov 2018 21:48:39 -0000 Subject: [Python-checkins] bpo-34532: Fixed exit code for py.exe list versions arg (GH-9039) Message-ID: https://github.com/python/cpython/commit/129642a1ff6a2f55933186b2303c307d58b710eb commit: 129642a1ff6a2f55933186b2303c307d58b710eb branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-20T13:48:34-08:00 summary: bpo-34532: Fixed exit code for py.exe list versions arg (GH-9039) (cherry picked from commit c8fe9ccf7bfbcf9a2cb48e3b6abacf6ec0e5e58d) Co-authored-by: Brendan Gerrity files: A Misc/NEWS.d/next/Windows/2018-09-03-01-23-52.bpo-34532.N1HEbE.rst M PC/launcher.c diff --git a/Misc/NEWS.d/next/Windows/2018-09-03-01-23-52.bpo-34532.N1HEbE.rst b/Misc/NEWS.d/next/Windows/2018-09-03-01-23-52.bpo-34532.N1HEbE.rst new file mode 100644 index 000000000000..812b47497c2d --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2018-09-03-01-23-52.bpo-34532.N1HEbE.rst @@ -0,0 +1 @@ +Fixes exit code of list version arguments for py.exe. diff --git a/PC/launcher.c b/PC/launcher.c index eb3433ab53fe..7d666aae4ab1 100644 --- a/PC/launcher.c +++ b/PC/launcher.c @@ -1453,7 +1453,7 @@ show_python_list(wchar_t ** argv) fwprintf(stderr, L"\n\nCan't find a Default Python.\n\n"); else fwprintf(stderr, L"\n\n"); /* End with a blank line */ - return(FALSE); /* If this has been called we cannot continue */ + return FALSE; /* If this has been called we cannot continue */ } static int @@ -1600,11 +1600,12 @@ process(int argc, wchar_t ** argv) else { p = argv[1]; plen = wcslen(p); - if ((argc == 2) && - (!wcsncmp(p, L"-0", wcslen(L"-0")) || /* Starts with -0 or --list */ + if ((argc == 2) && // list version args + (!wcsncmp(p, L"-0", wcslen(L"-0")) || !wcsncmp(p, L"--list", wcslen(L"--list")))) { - valid = show_python_list(argv); /* Check for -0 or --list FIRST */ + show_python_list(argv); + return rc; } valid = valid && (*p == L'-') && validate_version(&p[1]); if (valid) { From webhook-mailer at python.org Tue Nov 20 18:43:15 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 20 Nov 2018 23:43:15 -0000 Subject: [Python-checkins] bpo-35081: Move _PyGC_FINALIZED() back to C API (GH-10626) Message-ID: https://github.com/python/cpython/commit/3e21ad1a254cc33e8d4920ad7f026254ec728bee commit: 3e21ad1a254cc33e8d4920ad7f026254ec728bee branch: master author: Victor Stinner committer: GitHub date: 2018-11-21T00:43:09+01:00 summary: bpo-35081: Move _PyGC_FINALIZED() back to C API (GH-10626) Partially revert commit 1a6be91e6fd65ce9cb88cbbbb193db7e92ec6076, move back PyGC API from the internal API to the C API: * _PyGCHead_NEXT(g), _PyGCHead_SET_NEXT(g, p) * _PyGCHead_PREV(g), _PyGCHead_SET_PREV(g, p) * _PyGCHead_FINALIZED(g), _PyGCHead_SET_FINALIZED(g) * _PyGC_FINALIZED(o), _PyGC_SET_FINALIZED(o) * _PyGC_PREV_MASK_FINALIZED * _PyGC_PREV_MASK_COLLECTING * _PyGC_PREV_SHIFT * _PyGC_PREV_MASK _PyObject_GC_TRACK(o) and _PyObject_GC_UNTRACK(o) remain in the internal API. files: M Include/objimpl.h diff --git a/Include/objimpl.h b/Include/objimpl.h index e1946c74560c..b51b751b9c85 100644 --- a/Include/objimpl.h +++ b/Include/objimpl.h @@ -288,10 +288,7 @@ typedef struct { #define _PyObject_GC_MAY_BE_TRACKED(obj) \ (PyObject_IS_GC(obj) && \ (!PyTuple_CheckExact(obj) || _PyObject_GC_IS_TRACKED(obj))) -#endif - -#if defined(Py_BUILD_CORE) || defined(Py_BUILD_CORE_BUILTIN) /* Bit flags for _gc_prev */ /* Bit 0 is set when tp_finalize is called */ @@ -324,7 +321,10 @@ typedef struct { _PyGCHead_FINALIZED(_Py_AS_GC(o)) #define _PyGC_SET_FINALIZED(o) \ _PyGCHead_SET_FINALIZED(_Py_AS_GC(o)) +#endif /* !defined(Py_LIMITED_API) */ + +#if defined(Py_BUILD_CORE) || defined(Py_BUILD_CORE_BUILTIN) /* Tell the GC to track this object. * * NB: While the object is tracked by the collector, it must be safe to call the From webhook-mailer at python.org Wed Nov 21 03:40:17 2018 From: webhook-mailer at python.org (Raymond Hettinger) Date: Wed, 21 Nov 2018 08:40:17 -0000 Subject: [Python-checkins] bpo-35221: Additional hint that the placeholder is to be replaced. (GH-10604) Message-ID: https://github.com/python/cpython/commit/d936a8f8e0964de1147656f1435532f0170f8b6c commit: d936a8f8e0964de1147656f1435532f0170f8b6c branch: master author: Julien Palard committer: Raymond Hettinger date: 2018-11-21T00:40:05-08:00 summary: bpo-35221: Additional hint that the placeholder is to be replaced. (GH-10604) files: M Doc/using/venv-create.inc diff --git a/Doc/using/venv-create.inc b/Doc/using/venv-create.inc index 272090d083a5..45abd59d1868 100644 --- a/Doc/using/venv-create.inc +++ b/Doc/using/venv-create.inc @@ -82,7 +82,8 @@ path. Once a virtual environment has been created, it can be "activated" using a script in the virtual environment's binary directory. The invocation of the -script is platform-specific: +script is platform-specific (`` must be replaced by the path of the +directory containing the virtual environment): +-------------+-----------------+-----------------------------------------+ | Platform | Shell | Command to activate virtual environment | From webhook-mailer at python.org Wed Nov 21 03:48:47 2018 From: webhook-mailer at python.org (Raymond Hettinger) Date: Wed, 21 Nov 2018 08:48:47 -0000 Subject: [Python-checkins] bpo-35221: Additional hint that the placeholder is to be replaced. (GH-10604) (GH-10630) Message-ID: https://github.com/python/cpython/commit/7af2144e558a0268b1aa20bb88046716c89f987d commit: 7af2144e558a0268b1aa20bb88046716c89f987d branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Raymond Hettinger date: 2018-11-21T00:48:42-08:00 summary: bpo-35221: Additional hint that the placeholder is to be replaced. (GH-10604) (GH-10630) (cherry picked from commit d936a8f8e0964de1147656f1435532f0170f8b6c) Co-authored-by: Julien Palard files: M Doc/using/venv-create.inc diff --git a/Doc/using/venv-create.inc b/Doc/using/venv-create.inc index 4c7795ad8019..7e8ae4a85f8a 100644 --- a/Doc/using/venv-create.inc +++ b/Doc/using/venv-create.inc @@ -87,7 +87,8 @@ path. Once a virtual environment has been created, it can be "activated" using a script in the virtual environment's binary directory. The invocation of the -script is platform-specific: +script is platform-specific (`` must be replaced by the path of the +directory containing the virtual environment): +-------------+-----------------+-----------------------------------------+ | Platform | Shell | Command to activate virtual environment | From webhook-mailer at python.org Wed Nov 21 03:49:00 2018 From: webhook-mailer at python.org (Raymond Hettinger) Date: Wed, 21 Nov 2018 08:49:00 -0000 Subject: [Python-checkins] bpo-35221: Additional hint that the placeholder is to be replaced. (GH-10604) (GH-10629) Message-ID: https://github.com/python/cpython/commit/d170e594b2736c579d12b96b129a8e58975a9c0a commit: d170e594b2736c579d12b96b129a8e58975a9c0a branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Raymond Hettinger date: 2018-11-21T00:48:57-08:00 summary: bpo-35221: Additional hint that the placeholder is to be replaced. (GH-10604) (GH-10629) (cherry picked from commit d936a8f8e0964de1147656f1435532f0170f8b6c) Co-authored-by: Julien Palard files: M Doc/using/venv-create.inc diff --git a/Doc/using/venv-create.inc b/Doc/using/venv-create.inc index 272090d083a5..45abd59d1868 100644 --- a/Doc/using/venv-create.inc +++ b/Doc/using/venv-create.inc @@ -82,7 +82,8 @@ path. Once a virtual environment has been created, it can be "activated" using a script in the virtual environment's binary directory. The invocation of the -script is platform-specific: +script is platform-specific (`` must be replaced by the path of the +directory containing the virtual environment): +-------------+-----------------+-----------------------------------------+ | Platform | Shell | Command to activate virtual environment | From solipsis at pitrou.net Wed Nov 21 04:10:56 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Wed, 21 Nov 2018 09:10:56 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=4 Message-ID: <20181121091056.1.7E2D9475A7F95769@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [0, 7, -7] memory blocks, sum=0 test_functools leaked [0, 3, 1] memory blocks, sum=4 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflog3R2ELu', '--timeout', '7200'] From webhook-mailer at python.org Wed Nov 21 06:21:32 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 21 Nov 2018 11:21:32 -0000 Subject: [Python-checkins] bpo-35290: Add debug info to test_c_locale_coercion (GH-10631) Message-ID: https://github.com/python/cpython/commit/7c2d5702d11b41dd9a2391e6813fbaef5dbda79a commit: 7c2d5702d11b41dd9a2391e6813fbaef5dbda79a branch: master author: Victor Stinner committer: GitHub date: 2018-11-21T12:21:25+01:00 summary: bpo-35290: Add debug info to test_c_locale_coercion (GH-10631) In verbose mode, test_c_locale_coercion now dumps global variables at startup. files: M Lib/test/test_c_locale_coercion.py diff --git a/Lib/test/test_c_locale_coercion.py b/Lib/test/test_c_locale_coercion.py index 1db293b9c373..ce8ac4eb843b 100644 --- a/Lib/test/test_c_locale_coercion.py +++ b/Lib/test/test_c_locale_coercion.py @@ -8,7 +8,7 @@ import shutil from collections import namedtuple -import test.support +from test import support from test.support.script_helper import ( run_python_until_end, interpreter_requires_environment, @@ -27,7 +27,7 @@ # Apply some platform dependent overrides if sys.platform.startswith("linux"): - if test.support.is_android: + if support.is_android: # Android defaults to using UTF-8 for all system interfaces EXPECTED_C_LOCALE_STREAM_ENCODING = "utf-8" EXPECTED_C_LOCALE_FS_ENCODING = "utf-8" @@ -203,6 +203,15 @@ def setUpModule(): CLI_COERCION_TARGET = AVAILABLE_TARGETS[0] CLI_COERCION_WARNING = CLI_COERCION_WARNING_FMT.format(CLI_COERCION_TARGET) + if support.verbose: + print(f"AVAILABLE_TARGETS = {AVAILABLE_TARGETS!r}") + print(f"EXPECTED_C_LOCALE_EQUIVALENTS = {EXPECTED_C_LOCALE_EQUIVALENTS!r}") + print(f"EXPECTED_C_LOCALE_STREAM_ENCODING = {EXPECTED_C_LOCALE_STREAM_ENCODING!r}") + print(f"EXPECTED_C_LOCALE_FS_ENCODING = {EXPECTED_C_LOCALE_FS_ENCODING!r}") + print(f"EXPECT_COERCION_IN_DEFAULT_LOCALE = {EXPECT_COERCION_IN_DEFAULT_LOCALE!r}") + print(f"_C_UTF8_LOCALES = {_C_UTF8_LOCALES!r}") + print(f"_check_nl_langinfo_CODESET = {_check_nl_langinfo_CODESET!r}") + class _LocaleHandlingTestCase(unittest.TestCase): # Base class to check expected locale handling behaviour @@ -279,7 +288,7 @@ def test_external_target_locale_configuration(self): - at test.support.cpython_only + at support.cpython_only @unittest.skipUnless(sysconfig.get_config_var("PY_COERCE_C_LOCALE"), "C locale coercion disabled at build time") class LocaleCoercionTests(_LocaleHandlingTestCase): @@ -335,7 +344,7 @@ def _check_c_locale_coercion(self, # locale environment variables are undefined or empty. When # this code path is run with environ['LC_ALL'] == 'C', then # LEGACY_LOCALE_WARNING is printed. - if (test.support.is_android and + if (support.is_android and _expected_warnings == [CLI_COERCION_WARNING]): _expected_warnings = None self._check_child_encoding_details(base_var_dict, @@ -405,11 +414,11 @@ def test_LC_ALL_set_to_C(self): coercion_expected=False) def test_main(): - test.support.run_unittest( + support.run_unittest( LocaleConfigurationTests, LocaleCoercionTests ) - test.support.reap_children() + support.reap_children() if __name__ == "__main__": test_main() From webhook-mailer at python.org Wed Nov 21 07:41:13 2018 From: webhook-mailer at python.org (Julien Palard) Date: Wed, 21 Nov 2018 12:41:13 -0000 Subject: [Python-checkins] bpo-35035: Rename email.utils documentation to email.utils.rst (GH-10023) Message-ID: https://github.com/python/cpython/commit/361e8683e7340c600b22f4a514b81448ccec66dc commit: 361e8683e7340c600b22f4a514b81448ccec66dc branch: master author: Zhiming Wang committer: Julien Palard date: 2018-11-21T13:41:07+01:00 summary: bpo-35035: Rename email.utils documentation to email.utils.rst (GH-10023) I'll watch for 404 on the old URL and will setup an HTTP redirection if needed. files: A Doc/library/email.utils.rst A Misc/NEWS.d/next/Documentation/2018-10-21-02-20-36.bpo-35035.4zBObK.rst D Doc/library/email.util.rst M Doc/library/email.rst diff --git a/Doc/library/email.rst b/Doc/library/email.rst index 07d455ba39d3..fae99cf3e6ab 100644 --- a/Doc/library/email.rst +++ b/Doc/library/email.rst @@ -126,7 +126,7 @@ Legacy API: email.header.rst email.charset.rst email.encoders.rst - email.util.rst + email.utils.rst email.iterators.rst diff --git a/Doc/library/email.util.rst b/Doc/library/email.utils.rst similarity index 100% rename from Doc/library/email.util.rst rename to Doc/library/email.utils.rst diff --git a/Misc/NEWS.d/next/Documentation/2018-10-21-02-20-36.bpo-35035.4zBObK.rst b/Misc/NEWS.d/next/Documentation/2018-10-21-02-20-36.bpo-35035.4zBObK.rst new file mode 100644 index 000000000000..46436f1b979b --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2018-10-21-02-20-36.bpo-35035.4zBObK.rst @@ -0,0 +1 @@ +Rename documentation for :mod:`email.utils` to ``email.utils.rst``. From webhook-mailer at python.org Wed Nov 21 07:51:31 2018 From: webhook-mailer at python.org (Julien Palard) Date: Wed, 21 Nov 2018 12:51:31 -0000 Subject: [Python-checkins] bpo-35035: Rename email.utils documentation to email.utils.rst (GH-10023) Message-ID: https://github.com/python/cpython/commit/27c16e33b1acac55641a27faa5a11508ee605adc commit: 27c16e33b1acac55641a27faa5a11508ee605adc branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Julien Palard date: 2018-11-21T13:51:26+01:00 summary: bpo-35035: Rename email.utils documentation to email.utils.rst (GH-10023) I'll watch for 404 on the old URL and will setup an HTTP redirection if needed. (cherry picked from commit 361e8683e7340c600b22f4a514b81448ccec66dc) Co-authored-by: Zhiming Wang files: A Doc/library/email.utils.rst A Misc/NEWS.d/next/Documentation/2018-10-21-02-20-36.bpo-35035.4zBObK.rst D Doc/library/email.util.rst M Doc/library/email.rst diff --git a/Doc/library/email.rst b/Doc/library/email.rst index 07d455ba39d3..fae99cf3e6ab 100644 --- a/Doc/library/email.rst +++ b/Doc/library/email.rst @@ -126,7 +126,7 @@ Legacy API: email.header.rst email.charset.rst email.encoders.rst - email.util.rst + email.utils.rst email.iterators.rst diff --git a/Doc/library/email.util.rst b/Doc/library/email.utils.rst similarity index 100% rename from Doc/library/email.util.rst rename to Doc/library/email.utils.rst diff --git a/Misc/NEWS.d/next/Documentation/2018-10-21-02-20-36.bpo-35035.4zBObK.rst b/Misc/NEWS.d/next/Documentation/2018-10-21-02-20-36.bpo-35035.4zBObK.rst new file mode 100644 index 000000000000..46436f1b979b --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2018-10-21-02-20-36.bpo-35035.4zBObK.rst @@ -0,0 +1 @@ +Rename documentation for :mod:`email.utils` to ``email.utils.rst``. From webhook-mailer at python.org Wed Nov 21 07:54:20 2018 From: webhook-mailer at python.org (Julien Palard) Date: Wed, 21 Nov 2018 12:54:20 -0000 Subject: [Python-checkins] [3.7] bpo-35035: Rename email.utils documentation to email.utils.rst (GH-10023) Message-ID: https://github.com/python/cpython/commit/3b7258a5a5fddc6c46f71a89b7c8ce89f4b79641 commit: 3b7258a5a5fddc6c46f71a89b7c8ce89f4b79641 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Julien Palard date: 2018-11-21T13:54:17+01:00 summary: [3.7] bpo-35035: Rename email.utils documentation to email.utils.rst (GH-10023) I'll watch for 404 on the old URL and will setup an HTTP redirection if needed. (cherry picked from commit 361e8683e7340c600b22f4a514b81448ccec66dc) Co-authored-by: Zhiming Wang files: A Doc/library/email.utils.rst A Misc/NEWS.d/next/Documentation/2018-10-21-02-20-36.bpo-35035.4zBObK.rst D Doc/library/email.util.rst M Doc/library/email.rst diff --git a/Doc/library/email.rst b/Doc/library/email.rst index 07d455ba39d3..fae99cf3e6ab 100644 --- a/Doc/library/email.rst +++ b/Doc/library/email.rst @@ -126,7 +126,7 @@ Legacy API: email.header.rst email.charset.rst email.encoders.rst - email.util.rst + email.utils.rst email.iterators.rst diff --git a/Doc/library/email.util.rst b/Doc/library/email.utils.rst similarity index 100% rename from Doc/library/email.util.rst rename to Doc/library/email.utils.rst diff --git a/Misc/NEWS.d/next/Documentation/2018-10-21-02-20-36.bpo-35035.4zBObK.rst b/Misc/NEWS.d/next/Documentation/2018-10-21-02-20-36.bpo-35035.4zBObK.rst new file mode 100644 index 000000000000..46436f1b979b --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2018-10-21-02-20-36.bpo-35035.4zBObK.rst @@ -0,0 +1 @@ +Rename documentation for :mod:`email.utils` to ``email.utils.rst``. From webhook-mailer at python.org Wed Nov 21 10:33:19 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 21 Nov 2018 15:33:19 -0000 Subject: [Python-checkins] bpo-35189: Fix eintr_tester.py (GH-10637) Message-ID: https://github.com/python/cpython/commit/aac1f81eef971876ba5b1673db9ce6620311c469 commit: aac1f81eef971876ba5b1673db9ce6620311c469 branch: master author: Victor Stinner committer: GitHub date: 2018-11-21T16:33:13+01:00 summary: bpo-35189: Fix eintr_tester.py (GH-10637) Call setitimer() before each test method, instead of once per test case, to ensure that signals are sent in each test method. Previously, only the first method of a testcase class got signals. Changes: * Replace setUpClass() with setUp() and replace tearDownClass() with tearDown(). * tearDown() now ensures that at least one signal has been sent. * Replace support.run_unittest() with unittest.main() which has a nicer CLI and automatically discover test cases. files: M Lib/test/eintrdata/eintr_tester.py diff --git a/Lib/test/eintrdata/eintr_tester.py b/Lib/test/eintrdata/eintr_tester.py index 1caeafe25d9b..18d9d8451feb 100644 --- a/Lib/test/eintrdata/eintr_tester.py +++ b/Lib/test/eintrdata/eintr_tester.py @@ -44,27 +44,32 @@ class EINTRBaseTest(unittest.TestCase): # sleep_time > signal_period sleep_time = 0.2 - @classmethod - def setUpClass(cls): - cls.orig_handler = signal.signal(signal.SIGALRM, lambda *args: None) - signal.setitimer(signal.ITIMER_REAL, cls.signal_delay, - cls.signal_period) + def sighandler(self, signum, frame): + self.signals += 1 - # Issue #25277: Use faulthandler to try to debug a hang on FreeBSD + def setUp(self): + self.signals = 0 + self.orig_handler = signal.signal(signal.SIGALRM, self.sighandler) + signal.setitimer(signal.ITIMER_REAL, self.signal_delay, + self.signal_period) + + # Use faulthandler as watchdog to debug when a test hangs + # (timeout of 10 minutes) if hasattr(faulthandler, 'dump_traceback_later'): faulthandler.dump_traceback_later(10 * 60, exit=True, file=sys.__stderr__) - @classmethod - def stop_alarm(cls): + @staticmethod + def stop_alarm(): signal.setitimer(signal.ITIMER_REAL, 0, 0) - @classmethod - def tearDownClass(cls): - cls.stop_alarm() - signal.signal(signal.SIGALRM, cls.orig_handler) + def tearDown(self): + self.stop_alarm() + signal.signal(signal.SIGALRM, self.orig_handler) if hasattr(faulthandler, 'cancel_dump_traceback_later'): faulthandler.cancel_dump_traceback_later() + # make sure that at least one signal has been received + self.assertGreater(self.signals, 0) def subprocess(self, *args, **kw): cmd_args = (sys.executable, '-c') + args @@ -481,14 +486,5 @@ def test_devpoll(self): self.assertGreaterEqual(dt, self.sleep_time) -def test_main(): - support.run_unittest( - OSEINTRTest, - SocketEINTRTest, - TimeEINTRTest, - SignalEINTRTest, - SelectEINTRTest) - - if __name__ == "__main__": - test_main() + unittest.main() From webhook-mailer at python.org Wed Nov 21 16:27:52 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 21 Nov 2018 21:27:52 -0000 Subject: [Python-checkins] bpo-35081: Add Include/internal/pycore_object.h (GH-10640) Message-ID: https://github.com/python/cpython/commit/bcda8f1d42a98d9022736dd52d855be8e220fe15 commit: bcda8f1d42a98d9022736dd52d855be8e220fe15 branch: master author: Victor Stinner committer: GitHub date: 2018-11-21T22:27:47+01:00 summary: bpo-35081: Add Include/internal/pycore_object.h (GH-10640) Move _PyObject_GC_TRACK() and _PyObject_GC_UNTRACK() from Include/objimpl.h to Include/internal/pycore_object.h. files: A Include/internal/pycore_object.h M Include/objimpl.h M Modules/_io/bufferedio.c M Modules/_io/bytesio.c M Modules/_io/fileio.c M Modules/_io/iobase.c M Modules/_io/stringio.c M Modules/_io/textio.c M Modules/_io/winconsoleio.c M Modules/gcmodule.c M Objects/bytearrayobject.c M Objects/bytesobject.c M Objects/call.c M Objects/cellobject.c M Objects/classobject.c M Objects/descrobject.c M Objects/dictobject.c M Objects/exceptions.c M Objects/frameobject.c M Objects/funcobject.c M Objects/genobject.c M Objects/iterobject.c M Objects/listobject.c M Objects/memoryobject.c M Objects/methodobject.c M Objects/odictobject.c M Objects/setobject.c M Objects/sliceobject.c M Objects/tupleobject.c M Objects/typeobject.c M Objects/unicodeobject.c M Python/ceval.c M Python/context.c M Python/hamt.c diff --git a/Include/internal/pycore_object.h b/Include/internal/pycore_object.h new file mode 100644 index 000000000000..a2638344b160 --- /dev/null +++ b/Include/internal/pycore_object.h @@ -0,0 +1,56 @@ +#ifndef Py_INTERNAL_OBJECT_H +#define Py_INTERNAL_OBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN) +# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN defined" +#endif + +/* Tell the GC to track this object. + * + * NB: While the object is tracked by the collector, it must be safe to call the + * ob_traverse method. + * + * Internal note: _PyRuntime.gc.generation0->_gc_prev doesn't have any bit flags + * because it's not object header. So we don't use _PyGCHead_PREV() and + * _PyGCHead_SET_PREV() for it to avoid unnecessary bitwise operations. + * + * The PyObject_GC_Track() function is the public version of this macro. + */ +#define _PyObject_GC_TRACK(o) do { \ + PyGC_Head *g = _Py_AS_GC(o); \ + if (g->_gc_next != 0) { \ + Py_FatalError("GC object already tracked"); \ + } \ + assert((g->_gc_prev & _PyGC_PREV_MASK_COLLECTING) == 0); \ + PyGC_Head *last = (PyGC_Head*)(_PyRuntime.gc.generation0->_gc_prev); \ + _PyGCHead_SET_NEXT(last, g); \ + _PyGCHead_SET_PREV(g, last); \ + _PyGCHead_SET_NEXT(g, _PyRuntime.gc.generation0); \ + _PyRuntime.gc.generation0->_gc_prev = (uintptr_t)g; \ + } while (0); + +/* Tell the GC to stop tracking this object. + * + * Internal note: This may be called while GC. So _PyGC_PREV_MASK_COLLECTING must + * be cleared. But _PyGC_PREV_MASK_FINALIZED bit is kept. + * + * The PyObject_GC_UnTrack() function is the public version of this macro. + */ +#define _PyObject_GC_UNTRACK(o) do { \ + PyGC_Head *g = _Py_AS_GC(o); \ + PyGC_Head *prev = _PyGCHead_PREV(g); \ + PyGC_Head *next = _PyGCHead_NEXT(g); \ + assert(next != NULL); \ + _PyGCHead_SET_NEXT(prev, next); \ + _PyGCHead_SET_PREV(next, prev); \ + g->_gc_next = 0; \ + g->_gc_prev &= _PyGC_PREV_MASK_FINALIZED; \ + } while (0); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_OBJECT_H */ diff --git a/Include/objimpl.h b/Include/objimpl.h index b51b751b9c85..c455d4bebbdc 100644 --- a/Include/objimpl.h +++ b/Include/objimpl.h @@ -323,51 +323,6 @@ typedef struct { _PyGCHead_SET_FINALIZED(_Py_AS_GC(o)) #endif /* !defined(Py_LIMITED_API) */ - -#if defined(Py_BUILD_CORE) || defined(Py_BUILD_CORE_BUILTIN) -/* Tell the GC to track this object. - * - * NB: While the object is tracked by the collector, it must be safe to call the - * ob_traverse method. - * - * Internal note: _PyRuntime.gc.generation0->_gc_prev doesn't have any bit flags - * because it's not object header. So we don't use _PyGCHead_PREV() and - * _PyGCHead_SET_PREV() for it to avoid unnecessary bitwise operations. - * - * The PyObject_GC_Track() function is the public version of this macro. - */ -#define _PyObject_GC_TRACK(o) do { \ - PyGC_Head *g = _Py_AS_GC(o); \ - if (g->_gc_next != 0) { \ - Py_FatalError("GC object already tracked"); \ - } \ - assert((g->_gc_prev & _PyGC_PREV_MASK_COLLECTING) == 0); \ - PyGC_Head *last = (PyGC_Head*)(_PyRuntime.gc.generation0->_gc_prev); \ - _PyGCHead_SET_NEXT(last, g); \ - _PyGCHead_SET_PREV(g, last); \ - _PyGCHead_SET_NEXT(g, _PyRuntime.gc.generation0); \ - _PyRuntime.gc.generation0->_gc_prev = (uintptr_t)g; \ - } while (0); - -/* Tell the GC to stop tracking this object. - * - * Internal note: This may be called while GC. So _PyGC_PREV_MASK_COLLECTING must - * be cleared. But _PyGC_PREV_MASK_FINALIZED bit is kept. - * - * The PyObject_GC_UnTrack() function is the public version of this macro. - */ -#define _PyObject_GC_UNTRACK(o) do { \ - PyGC_Head *g = _Py_AS_GC(o); \ - PyGC_Head *prev = _PyGCHead_PREV(g); \ - PyGC_Head *next = _PyGCHead_NEXT(g); \ - assert(next != NULL); \ - _PyGCHead_SET_NEXT(prev, next); \ - _PyGCHead_SET_PREV(next, prev); \ - g->_gc_next = 0; \ - g->_gc_prev &= _PyGC_PREV_MASK_FINALIZED; \ - } while (0); -#endif /* defined(Py_BUILD_CORE) || defined(Py_BUILD_CORE_BUILTIN) */ - #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) _PyObject_GC_Malloc(size_t size); PyAPI_FUNC(PyObject *) _PyObject_GC_Calloc(size_t size); diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c index e1e45dc8fae0..6f855b9edd08 100644 --- a/Modules/_io/bufferedio.c +++ b/Modules/_io/bufferedio.c @@ -9,6 +9,7 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" +#include "pycore_object.h" #include "pycore_pystate.h" #include "structmember.h" #include "pythread.h" diff --git a/Modules/_io/bytesio.c b/Modules/_io/bytesio.c index a50add2389e5..8e54ec8e99c3 100644 --- a/Modules/_io/bytesio.c +++ b/Modules/_io/bytesio.c @@ -1,4 +1,5 @@ #include "Python.h" +#include "pycore_object.h" #include "structmember.h" /* for offsetof() */ #include "_iomodule.h" diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c index ffcb73012953..c502c430134e 100644 --- a/Modules/_io/fileio.c +++ b/Modules/_io/fileio.c @@ -2,6 +2,7 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" +#include "pycore_object.h" #include "structmember.h" #ifdef HAVE_SYS_TYPES_H #include diff --git a/Modules/_io/iobase.c b/Modules/_io/iobase.c index 5b71732ef19c..9b063cd372fe 100644 --- a/Modules/_io/iobase.c +++ b/Modules/_io/iobase.c @@ -10,6 +10,7 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" +#include "pycore_object.h" #include "structmember.h" #include "_iomodule.h" diff --git a/Modules/_io/stringio.c b/Modules/_io/stringio.c index 793fa1ee150b..bb5c3736a77a 100644 --- a/Modules/_io/stringio.c +++ b/Modules/_io/stringio.c @@ -2,6 +2,7 @@ #include "Python.h" #include "structmember.h" #include "pycore_accu.h" +#include "pycore_object.h" #include "_iomodule.h" /* Implementation note: the buffer is always at least one character longer diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c index 8924834eb81c..645d7123324c 100644 --- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c @@ -8,6 +8,7 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" +#include "pycore_object.h" #include "structmember.h" #include "_iomodule.h" diff --git a/Modules/_io/winconsoleio.c b/Modules/_io/winconsoleio.c index 148255c354a4..824690ff58d6 100644 --- a/Modules/_io/winconsoleio.c +++ b/Modules/_io/winconsoleio.c @@ -8,6 +8,7 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" +#include "pycore_object.h" #ifdef MS_WINDOWS @@ -556,7 +557,7 @@ read_console_w(HANDLE handle, DWORD maxlen, DWORD *readlen) { Py_BEGIN_ALLOW_THREADS DWORD off = 0; while (off < maxlen) { - DWORD n = (DWORD)-1; + DWORD n = (DWORD)-1; DWORD len = min(maxlen - off, BUFSIZ); SetLastError(0); BOOL res = ReadConsoleW(handle, &buf[off], len, &n, NULL); diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index 48b470006c4a..2cbf73866d12 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -25,6 +25,7 @@ #include "Python.h" #include "pycore_context.h" +#include "pycore_object.h" #include "pycore_pymem.h" #include "pycore_pystate.h" #include "frameobject.h" /* for PyFrame_ClearFreeList */ diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c index 561b06cdf967..144265381943 100644 --- a/Objects/bytearrayobject.c +++ b/Objects/bytearrayobject.c @@ -2,6 +2,7 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" +#include "pycore_object.h" #include "pycore_pymem.h" #include "pycore_pystate.h" #include "structmember.h" diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index fac12f55210e..bed75ee49e27 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -3,6 +3,7 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" +#include "pycore_object.h" #include "pycore_pymem.h" #include "pycore_pystate.h" diff --git a/Objects/call.c b/Objects/call.c index 7c452b99d117..ce346c293486 100644 --- a/Objects/call.c +++ b/Objects/call.c @@ -1,4 +1,5 @@ #include "Python.h" +#include "pycore_object.h" #include "pycore_pystate.h" #include "frameobject.h" diff --git a/Objects/cellobject.c b/Objects/cellobject.c index 7605bcf7bc9b..6b7136c41270 100644 --- a/Objects/cellobject.c +++ b/Objects/cellobject.c @@ -1,6 +1,7 @@ /* Cell object implementation */ #include "Python.h" +#include "pycore_object.h" #include "pycore_pymem.h" #include "pycore_pystate.h" diff --git a/Objects/classobject.c b/Objects/classobject.c index 79b0562f7d5f..6d1f05ccd3a9 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@ -1,6 +1,7 @@ /* Class object implementation (dead now except for methods) */ #include "Python.h" +#include "pycore_object.h" #include "pycore_pymem.h" #include "pycore_pystate.h" #include "structmember.h" diff --git a/Objects/descrobject.c b/Objects/descrobject.c index ca814bf78a69..dd3c5014aea7 100644 --- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -1,6 +1,7 @@ /* Descriptors -- a new, flexible way to describe attributes */ #include "Python.h" +#include "pycore_object.h" #include "pycore_pystate.h" #include "structmember.h" /* Why is this not included in Python.h? */ diff --git a/Objects/dictobject.c b/Objects/dictobject.c index df92bfd6a978..24561dd42c2e 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -111,6 +111,7 @@ converting the dict to the combined table. #define PyDict_MINSIZE 8 #include "Python.h" +#include "pycore_object.h" #include "pycore_pystate.h" #include "dict-common.h" #include "stringlib/eq.h" /* to get unicode_eq() */ diff --git a/Objects/exceptions.c b/Objects/exceptions.c index 5ab127111caf..cecbf977a327 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -6,6 +6,7 @@ #define PY_SSIZE_T_CLEAN #include +#include "pycore_object.h" #include "pycore_pymem.h" #include "pycore_pystate.h" #include "structmember.h" diff --git a/Objects/frameobject.c b/Objects/frameobject.c index 70cf5807130e..b1a83d82a398 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -1,6 +1,7 @@ /* Frame object implementation */ #include "Python.h" +#include "pycore_object.h" #include "pycore_pystate.h" #include "code.h" diff --git a/Objects/funcobject.c b/Objects/funcobject.c index a8e11a9a2d3d..982df5434d25 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c @@ -2,6 +2,7 @@ /* Function object implementation */ #include "Python.h" +#include "pycore_object.h" #include "pycore_pymem.h" #include "pycore_pystate.h" #include "code.h" diff --git a/Objects/genobject.c b/Objects/genobject.c index 716bd6d067bd..3279a0947e8f 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -1,6 +1,7 @@ /* Generator object implementation */ #include "Python.h" +#include "pycore_object.h" #include "pycore_pystate.h" #include "frameobject.h" #include "structmember.h" diff --git a/Objects/iterobject.c b/Objects/iterobject.c index 64bf92382be4..ada1bdc7e87e 100644 --- a/Objects/iterobject.c +++ b/Objects/iterobject.c @@ -1,6 +1,7 @@ /* Iterator objects */ #include "Python.h" +#include "pycore_object.h" #include "pycore_pymem.h" #include "pycore_pystate.h" diff --git a/Objects/listobject.c b/Objects/listobject.c index 44160abae6ee..6da8391fc275 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -1,6 +1,7 @@ /* List object implementation */ #include "Python.h" +#include "pycore_object.h" #include "pycore_pystate.h" #include "pycore_accu.h" diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c index 060ae4dd3cd0..0f528eec68bc 100644 --- a/Objects/memoryobject.c +++ b/Objects/memoryobject.c @@ -1,6 +1,7 @@ /* Memoryview object implementation */ #include "Python.h" +#include "pycore_object.h" #include "pycore_pymem.h" #include "pycore_pystate.h" #include "pystrhex.h" diff --git a/Objects/methodobject.c b/Objects/methodobject.c index cfea8cf410d7..23325e2a1b3e 100644 --- a/Objects/methodobject.c +++ b/Objects/methodobject.c @@ -2,6 +2,7 @@ /* Method object implementation */ #include "Python.h" +#include "pycore_object.h" #include "pycore_pymem.h" #include "pycore_pystate.h" #include "structmember.h" diff --git a/Objects/odictobject.c b/Objects/odictobject.c index 13bc972039f3..bdd61080d18b 100644 --- a/Objects/odictobject.c +++ b/Objects/odictobject.c @@ -465,6 +465,7 @@ Potential Optimizations */ #include "Python.h" +#include "pycore_object.h" #include "pycore_pystate.h" #include "structmember.h" #include "dict-common.h" diff --git a/Objects/setobject.c b/Objects/setobject.c index b11cb3a58696..c2a1467ba61a 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -32,6 +32,7 @@ */ #include "Python.h" +#include "pycore_object.h" #include "pycore_pystate.h" #include "structmember.h" diff --git a/Objects/sliceobject.c b/Objects/sliceobject.c index 1f79faa3e6ca..c60483ea9494 100644 --- a/Objects/sliceobject.c +++ b/Objects/sliceobject.c @@ -14,6 +14,7 @@ this type and there is exactly one in existence. */ #include "Python.h" +#include "pycore_object.h" #include "pycore_pymem.h" #include "pycore_pystate.h" #include "structmember.h" diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index e7ba09d71d33..83c63e089c3e 100644 --- a/Objects/tupleobject.c +++ b/Objects/tupleobject.c @@ -2,6 +2,7 @@ /* Tuple object implementation */ #include "Python.h" +#include "pycore_object.h" #include "pycore_pystate.h" #include "pycore_accu.h" diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 4d599bf51632..2345b7c07dc5 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -1,6 +1,7 @@ /* Type object implementation */ #include "Python.h" +#include "pycore_object.h" #include "pycore_pystate.h" #include "frameobject.h" #include "structmember.h" diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 04ca5f334447..d22b277a51c8 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -41,6 +41,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #define PY_SSIZE_T_CLEAN #include "Python.h" #include "pycore_fileutils.h" +#include "pycore_object.h" #include "pycore_pystate.h" #include "ucnhash.h" #include "bytes_methods.h" diff --git a/Python/ceval.c b/Python/ceval.c index 9c0ab0663b14..7b2465592a4b 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -10,6 +10,7 @@ #define PY_LOCAL_AGGRESSIVE #include "Python.h" +#include "pycore_object.h" #include "pycore_pystate.h" #include "code.h" diff --git a/Python/context.c b/Python/context.c index b548ffee3bc0..302f7696bb6b 100644 --- a/Python/context.c +++ b/Python/context.c @@ -1,9 +1,10 @@ #include "Python.h" -#include "structmember.h" -#include "pycore_pystate.h" #include "pycore_context.h" #include "pycore_hamt.h" +#include "pycore_object.h" +#include "pycore_pystate.h" +#include "structmember.h" #define CONTEXT_FREELIST_MAXLEN 255 diff --git a/Python/hamt.c b/Python/hamt.c index 3fe70b40fafc..d734d6ed07fb 100644 --- a/Python/hamt.c +++ b/Python/hamt.c @@ -1,8 +1,9 @@ #include "Python.h" -#include "structmember.h" -#include "pycore_pystate.h" #include "pycore_hamt.h" +#include "pycore_object.h" +#include "pycore_pystate.h" +#include "structmember.h" /* This file provides an implemention of an immutable mapping using the From webhook-mailer at python.org Wed Nov 21 17:46:34 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 21 Nov 2018 22:46:34 -0000 Subject: [Python-checkins] bpo-31146: Don't fallback switcher to english on not-yet pusblished languages. (GH-10558) Message-ID: https://github.com/python/cpython/commit/df6374e15aadff7eb547fc210c0f4f28bbff7010 commit: df6374e15aadff7eb547fc210c0f4f28bbff7010 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-21T14:46:30-08:00 summary: bpo-31146: Don't fallback switcher to english on not-yet pusblished languages. (GH-10558) (cherry picked from commit 6b73bb523a176123a819e4ebac3727d31d861515) Co-authored-by: Julien Palard files: M Doc/tools/static/switchers.js diff --git a/Doc/tools/static/switchers.js b/Doc/tools/static/switchers.js index d885ff2bbf21..20dad93d6a5e 100644 --- a/Doc/tools/static/switchers.js +++ b/Doc/tools/static/switchers.js @@ -49,6 +49,12 @@ else buf.push(''); }); + if (!(current_language in all_languages)) { + // In case we're browsing a language that is not yet in all_languages. + buf.push(''); + all_languages[current_language] = current_language; + } buf.push(''); return buf.join(''); } From webhook-mailer at python.org Wed Nov 21 17:47:00 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 21 Nov 2018 22:47:00 -0000 Subject: [Python-checkins] bpo-31146: Don't fallback switcher to english on not-yet pusblished languages. (GH-10558) Message-ID: https://github.com/python/cpython/commit/c487cf9261c61f0db4e5d1df3c83a60384b330db commit: c487cf9261c61f0db4e5d1df3c83a60384b330db branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-21T14:46:57-08:00 summary: bpo-31146: Don't fallback switcher to english on not-yet pusblished languages. (GH-10558) (cherry picked from commit 6b73bb523a176123a819e4ebac3727d31d861515) Co-authored-by: Julien Palard files: M Doc/tools/static/switchers.js diff --git a/Doc/tools/static/switchers.js b/Doc/tools/static/switchers.js index d885ff2bbf21..20dad93d6a5e 100644 --- a/Doc/tools/static/switchers.js +++ b/Doc/tools/static/switchers.js @@ -49,6 +49,12 @@ else buf.push(''); }); + if (!(current_language in all_languages)) { + // In case we're browsing a language that is not yet in all_languages. + buf.push(''); + all_languages[current_language] = current_language; + } buf.push(''); return buf.join(''); } From webhook-mailer at python.org Wed Nov 21 17:47:13 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 21 Nov 2018 22:47:13 -0000 Subject: [Python-checkins] bpo-31146: Don't fallback switcher to english on not-yet pusblished languages. (GH-10558) Message-ID: https://github.com/python/cpython/commit/fcbcebadff46f907b38fcf2d79adb3209c5a205d commit: fcbcebadff46f907b38fcf2d79adb3209c5a205d branch: 2.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-21T14:47:10-08:00 summary: bpo-31146: Don't fallback switcher to english on not-yet pusblished languages. (GH-10558) (cherry picked from commit 6b73bb523a176123a819e4ebac3727d31d861515) Co-authored-by: Julien Palard files: M Doc/tools/static/switchers.js diff --git a/Doc/tools/static/switchers.js b/Doc/tools/static/switchers.js index 2c051eb0776a..dbf907e09dc5 100644 --- a/Doc/tools/static/switchers.js +++ b/Doc/tools/static/switchers.js @@ -48,6 +48,12 @@ else buf.push(''); }); + if (!(current_language in all_languages)) { + // In case we're browsing a language that is not yet in all_languages. + buf.push(''); + all_languages[current_language] = current_language; + } buf.push(''); return buf.join(''); } From webhook-mailer at python.org Wed Nov 21 17:53:47 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 21 Nov 2018 22:53:47 -0000 Subject: [Python-checkins] bpo-35059: Enhance _PyObject_AssertFailed() (GH-10642) Message-ID: https://github.com/python/cpython/commit/f1d002c1e094922b0f17a820f90ff102d68ab253 commit: f1d002c1e094922b0f17a820f90ff102d68ab253 branch: master author: Victor Stinner committer: GitHub date: 2018-11-21T23:53:44+01:00 summary: bpo-35059: Enhance _PyObject_AssertFailed() (GH-10642) Enhance _PyObject_AssertFailed() * Exchange 'expr' and 'msg' parameters * 'expr' and 'func' arguments can now be NULL files: M Include/object.h M Lib/test/test_capi.py M Objects/object.c diff --git a/Include/object.h b/Include/object.h index 48ce9d2b970a..0d84d3604f0a 100644 --- a/Include/object.h +++ b/Include/object.h @@ -1158,8 +1158,8 @@ _PyObject_DebugTypeStats(FILE *out); ((expr) \ ? (void)(0) \ : _PyObject_AssertFailed((obj), \ - (msg), \ Py_STRINGIFY(expr), \ + (msg), \ __FILE__, \ __LINE__, \ __func__)) @@ -1169,11 +1169,13 @@ _PyObject_DebugTypeStats(FILE *out); /* Declare and define _PyObject_AssertFailed() even when NDEBUG is defined, to avoid causing compiler/linker errors when building extensions without - NDEBUG against a Python built with NDEBUG defined. */ + NDEBUG against a Python built with NDEBUG defined. + + msg, expr and function can be NULL. */ PyAPI_FUNC(void) _PyObject_AssertFailed( PyObject *obj, - const char *msg, const char *expr, + const char *msg, const char *file, int line, const char *function); diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py index 3c8c3f02bf78..7c68b2c0fc2c 100644 --- a/Lib/test/test_capi.py +++ b/Lib/test/test_capi.py @@ -330,7 +330,7 @@ def test_negative_refcount(self): rc, out, err = assert_python_failure('-c', code) self.assertRegex(err, br'_testcapimodule\.c:[0-9]+: ' - br'_Py_NegativeRefcount: Assertion ".*" failed; ' + br'_Py_NegativeRefcount: Assertion failed: ' br'object has negative ref count') diff --git a/Objects/object.c b/Objects/object.c index 801b205c9b6b..9d2614bb6d11 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -205,8 +205,7 @@ void _Py_dec_count(PyTypeObject *tp) void _Py_NegativeRefcount(const char *filename, int lineno, PyObject *op) { - _PyObject_AssertFailed(op, "object has negative ref count", - "op->ob_refcnt >= 0", + _PyObject_AssertFailed(op, NULL, "object has negative ref count", filename, lineno, __func__); } @@ -2219,20 +2218,25 @@ _PyTrash_thread_destroy_chain(void) void -_PyObject_AssertFailed(PyObject *obj, const char *msg, const char *expr, +_PyObject_AssertFailed(PyObject *obj, const char *expr, const char *msg, const char *file, int line, const char *function) { - fprintf(stderr, - "%s:%d: %s: Assertion \"%s\" failed", - file, line, function, expr); + fprintf(stderr, "%s:%d: ", file, line); + if (function) { + fprintf(stderr, "%s: ", function); + } fflush(stderr); - - if (msg) { - fprintf(stderr, "; %s.\n", msg); + if (expr) { + fprintf(stderr, "Assertion \"%s\" failed", expr); } else { - fprintf(stderr, ".\n"); + fprintf(stderr, "Assertion failed"); + } + fflush(stderr); + if (msg) { + fprintf(stderr, ": %s", msg); } + fprintf(stderr, "\n"); fflush(stderr); if (obj == NULL) { From webhook-mailer at python.org Wed Nov 21 19:02:59 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 22 Nov 2018 00:02:59 -0000 Subject: [Python-checkins] bpo-35059: Convert _PyObject_GC_TRACK() to inline function (GH-10643) Message-ID: https://github.com/python/cpython/commit/271753a27aca2e13275f0827080b915fb438107a commit: 271753a27aca2e13275f0827080b915fb438107a branch: master author: Victor Stinner committer: GitHub date: 2018-11-22T01:02:54+01:00 summary: bpo-35059: Convert _PyObject_GC_TRACK() to inline function (GH-10643) * Add _PyObject_ASSERT_FROM() and _PyObject_ASSERT_FAILED_MSG() macros. * PyObject_GC_Track() now calls _PyObject_ASSERT_FAILED_MSG(), instead of Py_FatalError(), if the object is already tracked, to dump more information on error. * _PyObject_GC_TRACK() no longer checks if the object is already tracked at runtime, use an assertion instead for best performances; PyObject_GC_Track() still checks at runtime. * pycore_object.h now includes pycore_pystate.h. * Convert _PyObject_GC_TRACK() and _PyObject_GC_UNTRACK() macros to inline functions. files: M Include/internal/pycore_object.h M Include/object.h M Modules/gcmodule.c diff --git a/Include/internal/pycore_object.h b/Include/internal/pycore_object.h index a2638344b160..347ab688013a 100644 --- a/Include/internal/pycore_object.h +++ b/Include/internal/pycore_object.h @@ -8,6 +8,8 @@ extern "C" { # error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN defined" #endif +#include "pycore_pystate.h" /* _PyRuntime */ + /* Tell the GC to track this object. * * NB: While the object is tracked by the collector, it must be safe to call the @@ -19,36 +21,56 @@ extern "C" { * * The PyObject_GC_Track() function is the public version of this macro. */ -#define _PyObject_GC_TRACK(o) do { \ - PyGC_Head *g = _Py_AS_GC(o); \ - if (g->_gc_next != 0) { \ - Py_FatalError("GC object already tracked"); \ - } \ - assert((g->_gc_prev & _PyGC_PREV_MASK_COLLECTING) == 0); \ - PyGC_Head *last = (PyGC_Head*)(_PyRuntime.gc.generation0->_gc_prev); \ - _PyGCHead_SET_NEXT(last, g); \ - _PyGCHead_SET_PREV(g, last); \ - _PyGCHead_SET_NEXT(g, _PyRuntime.gc.generation0); \ - _PyRuntime.gc.generation0->_gc_prev = (uintptr_t)g; \ - } while (0); +static inline void _PyObject_GC_TRACK_impl(const char *filename, int lineno, + PyObject *op) +{ + _PyObject_ASSERT_FROM(op, !_PyObject_GC_IS_TRACKED(op), + "object already tracked by the garbage collector", + filename, lineno, "_PyObject_GC_TRACK"); + + PyGC_Head *gc = _Py_AS_GC(op); + _PyObject_ASSERT_FROM(op, + (gc->_gc_prev & _PyGC_PREV_MASK_COLLECTING) == 0, + "object is in generation which is garbage collected", + filename, lineno, "_PyObject_GC_TRACK"); + + PyGC_Head *last = (PyGC_Head*)(_PyRuntime.gc.generation0->_gc_prev); + _PyGCHead_SET_NEXT(last, gc); + _PyGCHead_SET_PREV(gc, last); + _PyGCHead_SET_NEXT(gc, _PyRuntime.gc.generation0); + _PyRuntime.gc.generation0->_gc_prev = (uintptr_t)gc; +} + +#define _PyObject_GC_TRACK(op) \ + _PyObject_GC_TRACK_impl(__FILE__, __LINE__, (PyObject *)(op)) /* Tell the GC to stop tracking this object. * - * Internal note: This may be called while GC. So _PyGC_PREV_MASK_COLLECTING must - * be cleared. But _PyGC_PREV_MASK_FINALIZED bit is kept. + * Internal note: This may be called while GC. So _PyGC_PREV_MASK_COLLECTING + * must be cleared. But _PyGC_PREV_MASK_FINALIZED bit is kept. + * + * The object must be tracked by the GC. * * The PyObject_GC_UnTrack() function is the public version of this macro. */ -#define _PyObject_GC_UNTRACK(o) do { \ - PyGC_Head *g = _Py_AS_GC(o); \ - PyGC_Head *prev = _PyGCHead_PREV(g); \ - PyGC_Head *next = _PyGCHead_NEXT(g); \ - assert(next != NULL); \ - _PyGCHead_SET_NEXT(prev, next); \ - _PyGCHead_SET_PREV(next, prev); \ - g->_gc_next = 0; \ - g->_gc_prev &= _PyGC_PREV_MASK_FINALIZED; \ - } while (0); +static inline void _PyObject_GC_UNTRACK_impl(const char *filename, int lineno, + PyObject *op) +{ + _PyObject_ASSERT_FROM(op, _PyObject_GC_IS_TRACKED(op), + "object not tracked by the garbage collector", + filename, lineno, "_PyObject_GC_UNTRACK"); + + PyGC_Head *gc = _Py_AS_GC(op); + PyGC_Head *prev = _PyGCHead_PREV(gc); + PyGC_Head *next = _PyGCHead_NEXT(gc); + _PyGCHead_SET_NEXT(prev, next); + _PyGCHead_SET_PREV(next, prev); + gc->_gc_next = 0; + gc->_gc_prev &= _PyGC_PREV_MASK_FINALIZED; +} + +#define _PyObject_GC_UNTRACK(op) \ + _PyObject_GC_UNTRACK_impl(__FILE__, __LINE__, (PyObject *)(op)) #ifdef __cplusplus } diff --git a/Include/object.h b/Include/object.h index 0d84d3604f0a..5947b7905591 100644 --- a/Include/object.h +++ b/Include/object.h @@ -1136,7 +1136,7 @@ _PyObject_DebugTypeStats(FILE *out); #ifndef Py_LIMITED_API /* Define a pair of assertion macros: - _PyObject_ASSERT_WITH_MSG() and _PyObject_ASSERT(). + _PyObject_ASSERT_FROM(), _PyObject_ASSERT_WITH_MSG() and _PyObject_ASSERT(). These work like the regular C assert(), in that they will abort the process with a message on stderr if the given condition fails to hold, @@ -1151,21 +1151,24 @@ _PyObject_DebugTypeStats(FILE *out); will attempt to print to stderr, after the object dump. */ #ifdef NDEBUG /* No debugging: compile away the assertions: */ -# define _PyObject_ASSERT_WITH_MSG(obj, expr, msg) ((void)0) +# define _PyObject_ASSERT_FROM(obj, expr, msg, filename, lineno, func) \ + ((void)0) #else /* With debugging: generate checks: */ -# define _PyObject_ASSERT_WITH_MSG(obj, expr, msg) \ - ((expr) \ - ? (void)(0) \ - : _PyObject_AssertFailed((obj), \ - Py_STRINGIFY(expr), \ - (msg), \ - __FILE__, \ - __LINE__, \ - __func__)) +# define _PyObject_ASSERT_FROM(obj, expr, msg, filename, lineno, func) \ + ((expr) \ + ? (void)(0) \ + : _PyObject_AssertFailed((obj), Py_STRINGIFY(expr), \ + (msg), (filename), (lineno), (func))) #endif -#define _PyObject_ASSERT(obj, expr) _PyObject_ASSERT_WITH_MSG(obj, expr, NULL) +#define _PyObject_ASSERT_WITH_MSG(obj, expr, msg) \ + _PyObject_ASSERT_FROM(obj, expr, msg, __FILE__, __LINE__, __func__) +#define _PyObject_ASSERT(obj, expr) \ + _PyObject_ASSERT_WITH_MSG(obj, expr, NULL) + +#define _PyObject_ASSERT_FAILED_MSG(obj, msg) \ + _PyObject_AssertFailed((obj), NULL, (msg), __FILE__, __LINE__, __func__) /* Declare and define _PyObject_AssertFailed() even when NDEBUG is defined, to avoid causing compiler/linker errors when building extensions without diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index 2cbf73866d12..506ae196d0d0 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -1846,15 +1846,16 @@ _PyGC_Dump(PyGC_Head *g) /* extension modules might be compiled with GC support so these functions must always be available */ -#undef PyObject_GC_Track -#undef PyObject_GC_UnTrack -#undef PyObject_GC_Del -#undef _PyObject_GC_Malloc - void PyObject_GC_Track(void *op) { - _PyObject_GC_TRACK(op); + PyObject *obj = (PyObject *)op; + if (_PyObject_GC_IS_TRACKED(op)) { + _PyObject_ASSERT_FAILED_MSG(op, + "object already tracked " + "by the garbage collector"); + } + _PyObject_GC_TRACK(obj); } void From webhook-mailer at python.org Wed Nov 21 20:57:41 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 22 Nov 2018 01:57:41 -0000 Subject: [Python-checkins] bpo-35059: Add _PyObject_CAST() macro (GH-10645) Message-ID: https://github.com/python/cpython/commit/2ff8fb7639a86757c00a7cbbe7da418fffec3870 commit: 2ff8fb7639a86757c00a7cbbe7da418fffec3870 branch: master author: Victor Stinner committer: GitHub date: 2018-11-22T02:57:29+01:00 summary: bpo-35059: Add _PyObject_CAST() macro (GH-10645) Add _PyObject_CAST() and _PyVarObject_CAST() macros to cast argument to PyObject* and PyVarObject* properly. files: M Include/internal/pycore_object.h M Include/object.h M Include/objimpl.h M Include/odictobject.h M Include/unicodeobject.h diff --git a/Include/internal/pycore_object.h b/Include/internal/pycore_object.h index 347ab688013a..a88b626332f1 100644 --- a/Include/internal/pycore_object.h +++ b/Include/internal/pycore_object.h @@ -42,7 +42,7 @@ static inline void _PyObject_GC_TRACK_impl(const char *filename, int lineno, } #define _PyObject_GC_TRACK(op) \ - _PyObject_GC_TRACK_impl(__FILE__, __LINE__, (PyObject *)(op)) + _PyObject_GC_TRACK_impl(__FILE__, __LINE__, _PyObject_CAST(op)) /* Tell the GC to stop tracking this object. * @@ -70,7 +70,7 @@ static inline void _PyObject_GC_UNTRACK_impl(const char *filename, int lineno, } #define _PyObject_GC_UNTRACK(op) \ - _PyObject_GC_UNTRACK_impl(__FILE__, __LINE__, (PyObject *)(op)) + _PyObject_GC_UNTRACK_impl(__FILE__, __LINE__, _PyObject_CAST(op)) #ifdef __cplusplus } diff --git a/Include/object.h b/Include/object.h index 5947b7905591..cdcdca85c633 100644 --- a/Include/object.h +++ b/Include/object.h @@ -112,14 +112,20 @@ typedef struct _object { struct _typeobject *ob_type; } PyObject; +/* Cast argument to PyObject* type. */ +#define _PyObject_CAST(op) ((PyObject*)(op)) + typedef struct { PyObject ob_base; Py_ssize_t ob_size; /* Number of items in variable part */ } PyVarObject; -#define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) -#define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) -#define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) +/* Cast argument to PyVarObject* type. */ +#define _PyVarObject_CAST(op) ((PyVarObject*)(op)) + +#define Py_REFCNT(ob) (_PyObject_CAST(ob)->ob_refcnt) +#define Py_TYPE(ob) (_PyObject_CAST(ob)->ob_type) +#define Py_SIZE(ob) (_PyVarObject_CAST(ob)->ob_size) #ifndef Py_LIMITED_API /********************* String Literals ****************************************/ @@ -814,7 +820,7 @@ static inline void _Py_INCREF(PyObject *op) op->ob_refcnt++; } -#define Py_INCREF(op) _Py_INCREF((PyObject *)(op)) +#define Py_INCREF(op) _Py_INCREF(_PyObject_CAST(op)) static inline void _Py_DECREF(const char *filename, int lineno, PyObject *op) @@ -832,7 +838,7 @@ static inline void _Py_DECREF(const char *filename, int lineno, } } -#define Py_DECREF(op) _Py_DECREF(__FILE__, __LINE__, (PyObject *)(op)) +#define Py_DECREF(op) _Py_DECREF(__FILE__, __LINE__, _PyObject_CAST(op)) /* Safely decref `op` and set `op` to NULL, especially useful in tp_clear @@ -871,7 +877,7 @@ static inline void _Py_DECREF(const char *filename, int lineno, */ #define Py_CLEAR(op) \ do { \ - PyObject *_py_tmp = (PyObject *)(op); \ + PyObject *_py_tmp = _PyObject_CAST(op); \ if (_py_tmp != NULL) { \ (op) = NULL; \ Py_DECREF(_py_tmp); \ @@ -886,7 +892,7 @@ static inline void _Py_XINCREF(PyObject *op) } } -#define Py_XINCREF(op) _Py_XINCREF((PyObject *)(op)) +#define Py_XINCREF(op) _Py_XINCREF(_PyObject_CAST(op)) static inline void _Py_XDECREF(PyObject *op) { @@ -895,7 +901,7 @@ static inline void _Py_XDECREF(PyObject *op) } } -#define Py_XDECREF(op) _Py_XDECREF((PyObject *)(op)) +#define Py_XDECREF(op) _Py_XDECREF(_PyObject_CAST(op)) #ifndef Py_LIMITED_API /* Safely decref `op` and set `op` to `op2`. @@ -919,14 +925,14 @@ static inline void _Py_XDECREF(PyObject *op) #define Py_SETREF(op, op2) \ do { \ - PyObject *_py_tmp = (PyObject *)(op); \ + PyObject *_py_tmp = _PyObject_CAST(op); \ (op) = (op2); \ Py_DECREF(_py_tmp); \ } while (0) #define Py_XSETREF(op, op2) \ do { \ - PyObject *_py_tmp = (PyObject *)(op); \ + PyObject *_py_tmp = _PyObject_CAST(op); \ (op) = (op2); \ Py_XDECREF(_py_tmp); \ } while (0) @@ -1122,7 +1128,7 @@ PyAPI_FUNC(void) _PyTrash_thread_destroy_chain(void); _PyTrash_thread_destroy_chain(); \ } \ else \ - _PyTrash_thread_deposit_object((PyObject*)op); \ + _PyTrash_thread_deposit_object(_PyObject_CAST(op)); \ } while (0); #ifndef Py_LIMITED_API diff --git a/Include/objimpl.h b/Include/objimpl.h index c455d4bebbdc..1c50d8bd6c04 100644 --- a/Include/objimpl.h +++ b/Include/objimpl.h @@ -258,7 +258,7 @@ PyAPI_FUNC(Py_ssize_t) _PyGC_CollectIfEnabled(void); PyAPI_FUNC(PyVarObject *) _PyObject_GC_Resize(PyVarObject *, Py_ssize_t); #define PyObject_GC_Resize(type, op, n) \ - ( (type *) _PyObject_GC_Resize((PyVarObject *)(op), (n)) ) + ( (type *) _PyObject_GC_Resize(_PyVarObject_CAST(op), (n)) ) #ifndef Py_LIMITED_API @@ -356,7 +356,7 @@ PyAPI_FUNC(void) PyObject_GC_Del(void *); #define Py_VISIT(op) \ do { \ if (op) { \ - int vret = visit((PyObject *)(op), arg); \ + int vret = visit(_PyObject_CAST(op), arg); \ if (vret) \ return vret; \ } \ diff --git a/Include/odictobject.h b/Include/odictobject.h index 8378dc4bfa45..35aff8a29a6e 100644 --- a/Include/odictobject.h +++ b/Include/odictobject.h @@ -27,13 +27,13 @@ PyAPI_FUNC(int) PyODict_SetItem(PyObject *od, PyObject *key, PyObject *item); PyAPI_FUNC(int) PyODict_DelItem(PyObject *od, PyObject *key); /* wrappers around PyDict* functions */ -#define PyODict_GetItem(od, key) PyDict_GetItem((PyObject *)od, key) +#define PyODict_GetItem(od, key) PyDict_GetItem(_PyObject_CAST(od), key) #define PyODict_GetItemWithError(od, key) \ - PyDict_GetItemWithError((PyObject *)od, key) -#define PyODict_Contains(od, key) PyDict_Contains((PyObject *)od, key) -#define PyODict_Size(od) PyDict_Size((PyObject *)od) + PyDict_GetItemWithError(_PyObject_CAST(od), key) +#define PyODict_Contains(od, key) PyDict_Contains(_PyObject_CAST(od), key) +#define PyODict_Size(od) PyDict_Size(_PyObject_CAST(od)) #define PyODict_GetItemString(od, key) \ - PyDict_GetItemString((PyObject *)od, key) + PyDict_GetItemString(_PyObject_CAST(od), key) #endif diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h index 0274de6733ab..ffabf0e83197 100644 --- a/Include/unicodeobject.h +++ b/Include/unicodeobject.h @@ -380,7 +380,7 @@ PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type; (assert(PyUnicode_Check(op)), \ (((PyASCIIObject *)(op))->wstr) ? \ PyUnicode_WSTR_LENGTH(op) : \ - ((void)PyUnicode_AsUnicode((PyObject *)(op)), \ + ((void)PyUnicode_AsUnicode(_PyObject_CAST(op)),\ assert(((PyASCIIObject *)(op))->wstr), \ PyUnicode_WSTR_LENGTH(op))) /* Py_DEPRECATED(3.3) */ @@ -397,7 +397,7 @@ PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type; #define PyUnicode_AS_UNICODE(op) \ (assert(PyUnicode_Check(op)), \ (((PyASCIIObject *)(op))->wstr) ? (((PyASCIIObject *)(op))->wstr) : \ - PyUnicode_AsUnicode((PyObject *)(op))) + PyUnicode_AsUnicode(_PyObject_CAST(op))) /* Py_DEPRECATED(3.3) */ #define PyUnicode_AS_DATA(op) \ @@ -549,7 +549,7 @@ enum PyUnicode_Kind { #define PyUnicode_READY(op) \ (assert(PyUnicode_Check(op)), \ (PyUnicode_IS_READY(op) ? \ - 0 : _PyUnicode_Ready((PyObject *)(op)))) + 0 : _PyUnicode_Ready(_PyObject_CAST(op)))) /* Return a maximum character value which is suitable for creating another string based on op. This is always an approximation but more efficient From webhook-mailer at python.org Wed Nov 21 21:37:54 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 22 Nov 2018 02:37:54 -0000 Subject: [Python-checkins] bpo-35059: Cleanup usage of Python macros (GH-10648) Message-ID: https://github.com/python/cpython/commit/b37672daf61740fe1ff9d805f6d74bc5ef04012b commit: b37672daf61740fe1ff9d805f6d74bc5ef04012b branch: master author: Victor Stinner committer: GitHub date: 2018-11-22T03:37:50+01:00 summary: bpo-35059: Cleanup usage of Python macros (GH-10648) Don't pass complex expressions but regular variables to Python macros. * _datetimemodule.c: split single large "if" into two "if" in date_new(), time_new() and datetime_new(). * _pickle.c, load_extension(): flatten complex "if" expression into more regular C code. * _ssl.c: addbool() now uses a temporary bool_obj to only evaluate the value once. * weakrefobject.c: replace "Py_INCREF(result = proxy);" with "result = proxy; Py_INCREF(result);" files: M Modules/_datetimemodule.c M Modules/_pickle.c M Modules/_ssl.c M Objects/weakrefobject.c diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c index 371bfaec3a05..0054ea83c462 100644 --- a/Modules/_datetimemodule.c +++ b/Modules/_datetimemodule.c @@ -2798,20 +2798,22 @@ date_new(PyTypeObject *type, PyObject *args, PyObject *kw) int day; /* Check for invocation from pickle with __getstate__ state */ - if (PyTuple_GET_SIZE(args) == 1 && - PyBytes_Check(state = PyTuple_GET_ITEM(args, 0)) && - PyBytes_GET_SIZE(state) == _PyDateTime_DATE_DATASIZE && - MONTH_IS_SANE(PyBytes_AS_STRING(state)[2])) - { - PyDateTime_Date *me; - - me = (PyDateTime_Date *) (type->tp_alloc(type, 0)); - if (me != NULL) { - char *pdata = PyBytes_AS_STRING(state); - memcpy(me->data, pdata, _PyDateTime_DATE_DATASIZE); - me->hashcode = -1; + if (PyTuple_GET_SIZE(args) == 1) { + state = PyTuple_GET_ITEM(args, 0); + if (PyBytes_Check(state) && + PyBytes_GET_SIZE(state) == _PyDateTime_DATE_DATASIZE && + MONTH_IS_SANE(PyBytes_AS_STRING(state)[2])) + { + PyDateTime_Date *me; + + me = (PyDateTime_Date *) (type->tp_alloc(type, 0)); + if (me != NULL) { + char *pdata = PyBytes_AS_STRING(state); + memcpy(me->data, pdata, _PyDateTime_DATE_DATASIZE); + me->hashcode = -1; + } + return (PyObject *)me; } - return (PyObject *)me; } if (PyArg_ParseTupleAndKeywords(args, kw, "iii", date_kws, @@ -3913,43 +3915,46 @@ time_new(PyTypeObject *type, PyObject *args, PyObject *kw) /* Check for invocation from pickle with __getstate__ state */ if (PyTuple_GET_SIZE(args) >= 1 && - PyTuple_GET_SIZE(args) <= 2 && - PyBytes_Check(state = PyTuple_GET_ITEM(args, 0)) && - PyBytes_GET_SIZE(state) == _PyDateTime_TIME_DATASIZE && - (0x7F & ((unsigned char) (PyBytes_AS_STRING(state)[0]))) < 24) + PyTuple_GET_SIZE(args) <= 2) { - PyDateTime_Time *me; - char aware; - - if (PyTuple_GET_SIZE(args) == 2) { - tzinfo = PyTuple_GET_ITEM(args, 1); - if (check_tzinfo_subclass(tzinfo) < 0) { - PyErr_SetString(PyExc_TypeError, "bad " - "tzinfo state arg"); - return NULL; - } - } - aware = (char)(tzinfo != Py_None); - me = (PyDateTime_Time *) (type->tp_alloc(type, aware)); - if (me != NULL) { - char *pdata = PyBytes_AS_STRING(state); - - memcpy(me->data, pdata, _PyDateTime_TIME_DATASIZE); - me->hashcode = -1; - me->hastzinfo = aware; - if (aware) { - Py_INCREF(tzinfo); - me->tzinfo = tzinfo; - } - if (pdata[0] & (1 << 7)) { - me->data[0] -= 128; - me->fold = 1; + state = PyTuple_GET_ITEM(args, 0); + if (PyBytes_Check(state) && + PyBytes_GET_SIZE(state) == _PyDateTime_TIME_DATASIZE && + (0x7F & ((unsigned char) (PyBytes_AS_STRING(state)[0]))) < 24) + { + PyDateTime_Time *me; + char aware; + + if (PyTuple_GET_SIZE(args) == 2) { + tzinfo = PyTuple_GET_ITEM(args, 1); + if (check_tzinfo_subclass(tzinfo) < 0) { + PyErr_SetString(PyExc_TypeError, "bad " + "tzinfo state arg"); + return NULL; + } } - else { - me->fold = 0; + aware = (char)(tzinfo != Py_None); + me = (PyDateTime_Time *) (type->tp_alloc(type, aware)); + if (me != NULL) { + char *pdata = PyBytes_AS_STRING(state); + + memcpy(me->data, pdata, _PyDateTime_TIME_DATASIZE); + me->hashcode = -1; + me->hastzinfo = aware; + if (aware) { + Py_INCREF(tzinfo); + me->tzinfo = tzinfo; + } + if (pdata[0] & (1 << 7)) { + me->data[0] -= 128; + me->fold = 1; + } + else { + me->fold = 0; + } } + return (PyObject *)me; } - return (PyObject *)me; } if (PyArg_ParseTupleAndKeywords(args, kw, "|iiiiO$i", time_kws, @@ -4552,43 +4557,46 @@ datetime_new(PyTypeObject *type, PyObject *args, PyObject *kw) /* Check for invocation from pickle with __getstate__ state */ if (PyTuple_GET_SIZE(args) >= 1 && - PyTuple_GET_SIZE(args) <= 2 && - PyBytes_Check(state = PyTuple_GET_ITEM(args, 0)) && - PyBytes_GET_SIZE(state) == _PyDateTime_DATETIME_DATASIZE && - MONTH_IS_SANE(PyBytes_AS_STRING(state)[2] & 0x7F)) + PyTuple_GET_SIZE(args) <= 2) { - PyDateTime_DateTime *me; - char aware; - - if (PyTuple_GET_SIZE(args) == 2) { - tzinfo = PyTuple_GET_ITEM(args, 1); - if (check_tzinfo_subclass(tzinfo) < 0) { - PyErr_SetString(PyExc_TypeError, "bad " - "tzinfo state arg"); - return NULL; - } - } - aware = (char)(tzinfo != Py_None); - me = (PyDateTime_DateTime *) (type->tp_alloc(type , aware)); - if (me != NULL) { - char *pdata = PyBytes_AS_STRING(state); - - memcpy(me->data, pdata, _PyDateTime_DATETIME_DATASIZE); - me->hashcode = -1; - me->hastzinfo = aware; - if (aware) { - Py_INCREF(tzinfo); - me->tzinfo = tzinfo; - } - if (pdata[2] & (1 << 7)) { - me->data[2] -= 128; - me->fold = 1; + state = PyTuple_GET_ITEM(args, 0); + if (PyBytes_Check(state) && + PyBytes_GET_SIZE(state) == _PyDateTime_DATETIME_DATASIZE && + MONTH_IS_SANE(PyBytes_AS_STRING(state)[2] & 0x7F)) + { + PyDateTime_DateTime *me; + char aware; + + if (PyTuple_GET_SIZE(args) == 2) { + tzinfo = PyTuple_GET_ITEM(args, 1); + if (check_tzinfo_subclass(tzinfo) < 0) { + PyErr_SetString(PyExc_TypeError, "bad " + "tzinfo state arg"); + return NULL; + } } - else { - me->fold = 0; + aware = (char)(tzinfo != Py_None); + me = (PyDateTime_DateTime *) (type->tp_alloc(type , aware)); + if (me != NULL) { + char *pdata = PyBytes_AS_STRING(state); + + memcpy(me->data, pdata, _PyDateTime_DATETIME_DATASIZE); + me->hashcode = -1; + me->hastzinfo = aware; + if (aware) { + Py_INCREF(tzinfo); + me->tzinfo = tzinfo; + } + if (pdata[2] & (1 << 7)) { + me->data[2] -= 128; + me->fold = 1; + } + else { + me->fold = 0; + } } + return (PyObject *)me; } - return (PyObject *)me; } if (PyArg_ParseTupleAndKeywords(args, kw, "iii|iiiiO$i", datetime_kws, diff --git a/Modules/_pickle.c b/Modules/_pickle.c index 2166d296abe4..3a7700553397 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -5858,14 +5858,20 @@ load_extension(UnpicklerObject *self, int nbytes) /* Since the extension registry is manipulable via Python code, * confirm that pair is really a 2-tuple of strings. */ - if (!PyTuple_Check(pair) || PyTuple_Size(pair) != 2 || - !PyUnicode_Check(module_name = PyTuple_GET_ITEM(pair, 0)) || - !PyUnicode_Check(class_name = PyTuple_GET_ITEM(pair, 1))) { - Py_DECREF(py_code); - PyErr_Format(PyExc_ValueError, "_inverted_registry[%ld] " - "isn't a 2-tuple of strings", code); - return -1; + if (!PyTuple_Check(pair) || PyTuple_Size(pair) != 2) { + goto error; + } + + module_name = PyTuple_GET_ITEM(pair, 0); + if (!PyUnicode_Check(module_name)) { + goto error; + } + + class_name = PyTuple_GET_ITEM(pair, 1); + if (!PyUnicode_Check(class_name)) { + goto error; } + /* Load the object. */ obj = find_class(self, module_name, class_name); if (obj == NULL) { @@ -5881,6 +5887,12 @@ load_extension(UnpicklerObject *self, int nbytes) } PDATA_PUSH(self->stack, obj, -1); return 0; + +error: + Py_DECREF(py_code); + PyErr_Format(PyExc_ValueError, "_inverted_registry[%ld] " + "isn't a 2-tuple of strings", code); + return -1; } static int diff --git a/Modules/_ssl.c b/Modules/_ssl.c index 93498f475609..85819f5b0509 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -5983,9 +5983,12 @@ PyInit__ssl(void) PyModule_AddIntConstant(m, "PROTO_TLSv1_2", PY_PROTO_TLSv1_2); PyModule_AddIntConstant(m, "PROTO_TLSv1_3", PY_PROTO_TLSv1_3); -#define addbool(m, v, b) \ - Py_INCREF((b) ? Py_True : Py_False); \ - PyModule_AddObject((m), (v), (b) ? Py_True : Py_False); +#define addbool(m, key, value) \ + do { \ + PyObject *bool_obj = (value) ? Py_True : Py_False; \ + Py_INCREF(bool_obj); \ + PyModule_AddObject((m), (key), bool_obj); \ + } while (0) #if HAVE_SNI addbool(m, "HAS_SNI", 1); diff --git a/Objects/weakrefobject.c b/Objects/weakrefobject.c index 9f492e4b25e4..9227aa688f47 100644 --- a/Objects/weakrefobject.c +++ b/Objects/weakrefobject.c @@ -833,7 +833,8 @@ PyWeakref_NewProxy(PyObject *ob, PyObject *callback) to avoid violating the invariants of the list of weakrefs for ob. */ Py_DECREF(result); - Py_INCREF(result = proxy); + result = proxy; + Py_INCREF(result); goto skip_insert; } prev = ref; From solipsis at pitrou.net Thu Nov 22 04:09:27 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Thu, 22 Nov 2018 09:09:27 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=4 Message-ID: <20181122090927.1.4FC10A4955B0C57C@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [7, 0, -7] memory blocks, sum=0 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_spawn leaked [0, -2, 2] memory blocks, sum=0 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogweJnXQ', '--timeout', '7200'] From webhook-mailer at python.org Thu Nov 22 04:25:33 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 22 Nov 2018 09:25:33 -0000 Subject: [Python-checkins] bpo-35059: Cast void* to PyObject* (GH-10650) Message-ID: https://github.com/python/cpython/commit/a42de742e7c20eeb64699b5785543fea65b2e8d3 commit: a42de742e7c20eeb64699b5785543fea65b2e8d3 branch: master author: Victor Stinner committer: GitHub date: 2018-11-22T10:25:22+01:00 summary: bpo-35059: Cast void* to PyObject* (GH-10650) Don't pass void* to Python macros: use _PyObject_CAST(). files: M Modules/_threadmodule.c M Modules/gcmodule.c M Objects/unicodeobject.c M Python/hamt.c diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c index 72d044c08a10..a4ddb87e2b7f 100644 --- a/Modules/_threadmodule.c +++ b/Modules/_threadmodule.c @@ -1171,8 +1171,9 @@ This function is meant for internal and specialized purposes only.\n\ In most applications `threading.enumerate()` should be used instead."); static void -release_sentinel(void *wr) +release_sentinel(void *wr_raw) { + PyObject *wr = _PyObject_CAST(wr_raw); /* Tricky: this function is called when the current thread state is being deleted. Therefore, only simple C code can safely execute here. */ diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index 506ae196d0d0..64140c1b8899 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -1847,20 +1847,21 @@ _PyGC_Dump(PyGC_Head *g) functions must always be available */ void -PyObject_GC_Track(void *op) +PyObject_GC_Track(void *op_raw) { - PyObject *obj = (PyObject *)op; + PyObject *op = _PyObject_CAST(op_raw); if (_PyObject_GC_IS_TRACKED(op)) { _PyObject_ASSERT_FAILED_MSG(op, "object already tracked " "by the garbage collector"); } - _PyObject_GC_TRACK(obj); + _PyObject_GC_TRACK(op); } void -PyObject_GC_UnTrack(void *op) +PyObject_GC_UnTrack(void *op_raw) { + PyObject *op = _PyObject_CAST(op_raw); /* Obscure: the Py_TRASHCAN mechanism requires that we be able to * call PyObject_GC_UnTrack twice on an object. */ diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index d22b277a51c8..01049f54e898 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -1171,14 +1171,17 @@ unicode_kind_name(PyObject *unicode) #ifdef Py_DEBUG /* Functions wrapping macros for use in debugger */ -char *_PyUnicode_utf8(void *unicode){ +char *_PyUnicode_utf8(void *unicode_raw){ + PyObject *unicode = _PyObject_CAST(unicode_raw); return PyUnicode_UTF8(unicode); } -void *_PyUnicode_compact_data(void *unicode) { +void *_PyUnicode_compact_data(void *unicode_raw) { + PyObject *unicode = _PyObject_CAST(unicode_raw); return _PyUnicode_COMPACT_DATA(unicode); } -void *_PyUnicode_data(void *unicode){ +void *_PyUnicode_data(void *unicode_raw) { + PyObject *unicode = _PyObject_CAST(unicode_raw); printf("obj %p\n", unicode); printf("compact %d\n", PyUnicode_IS_COMPACT(unicode)); printf("compact ascii %d\n", PyUnicode_IS_COMPACT_ASCII(unicode)); diff --git a/Python/hamt.c b/Python/hamt.c index d734d6ed07fb..aa90d37240a3 100644 --- a/Python/hamt.c +++ b/Python/hamt.c @@ -373,10 +373,11 @@ hamt_node_collision_count(PyHamtNode_Collision *node); #ifdef Py_DEBUG static void -_hamt_node_array_validate(void *o) +_hamt_node_array_validate(void *obj_raw) { - assert(IS_ARRAY_NODE(o)); - PyHamtNode_Array *node = (PyHamtNode_Array*)(o); + PyObject *obj = _PyObject_CAST(obj_raw); + assert(IS_ARRAY_NODE(obj)); + PyHamtNode_Array *node = (PyHamtNode_Array*)obj; Py_ssize_t i = 0, count = 0; for (; i < HAMT_ARRAY_NODE_SIZE; i++) { if (node->a_array[i] != NULL) { From webhook-mailer at python.org Thu Nov 22 04:25:50 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 22 Nov 2018 09:25:50 -0000 Subject: [Python-checkins] cjkcodecs: Fix compiler warning (GH-10651) Message-ID: https://github.com/python/cpython/commit/cdbcb773f5db24e23fa90e644ec620d54bd08127 commit: cdbcb773f5db24e23fa90e644ec620d54bd08127 branch: master author: Victor Stinner committer: GitHub date: 2018-11-22T10:25:46+01:00 summary: cjkcodecs: Fix compiler warning (GH-10651) Fixed the following compiler warning in multibytecodec.c: warning C4244: '=': conversion from 'Py_ssize_t' to 'unsigned char', possible loss of data Cast Py_ssize_t to unsigned char: the maximum value is checked on the previous line. files: M Modules/cjkcodecs/multibytecodec.c diff --git a/Modules/cjkcodecs/multibytecodec.c b/Modules/cjkcodecs/multibytecodec.c index 9409456c0d27..8a0ac870f15e 100644 --- a/Modules/cjkcodecs/multibytecodec.c +++ b/Modules/cjkcodecs/multibytecodec.c @@ -923,8 +923,8 @@ _multibytecodec_MultibyteIncrementalEncoder_getstate_impl(MultibyteIncrementalEn PyErr_SetString(PyExc_UnicodeError, "pending buffer too large"); return NULL; } - statebytes[0] = pendingsize; - memcpy(statebytes+1, pendingbuffer, pendingsize); + statebytes[0] = (unsigned char)pendingsize; + memcpy(statebytes + 1, pendingbuffer, pendingsize); statesize = 1 + pendingsize; } else { statebytes[0] = 0; From webhook-mailer at python.org Thu Nov 22 07:21:49 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 22 Nov 2018 12:21:49 -0000 Subject: [Python-checkins] bpo-9566: Fix compiler warnings in pyexpat.c (GH-10654) Message-ID: https://github.com/python/cpython/commit/28f468cb19e3097079b7ce7850e6048de99022fa commit: 28f468cb19e3097079b7ce7850e6048de99022fa branch: master author: Victor Stinner committer: GitHub date: 2018-11-22T13:21:43+01:00 summary: bpo-9566: Fix compiler warnings in pyexpat.c (GH-10654) Explicit cast a pointer difference (intptr_t) to int to fix two warnings on 64-bit Windows: Modules\pyexpat.c(1181): warning C4244: 'initializing': conversion from '__int64' to 'int', possible loss of data Modules\pyexpat.c(1192): warning C4244: 'initializing': conversion from '__int64' to 'int', possible loss of data files: M Modules/pyexpat.c diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c index 10d5aedf1cdb..9384081f9ffc 100644 --- a/Modules/pyexpat.c +++ b/Modules/pyexpat.c @@ -1178,7 +1178,8 @@ xmlparse_dealloc(xmlparseobject *self) static PyObject * xmlparse_handler_getter(xmlparseobject *self, struct HandlerInfo *hi) { - int handlernum = hi - handler_info; + assert((hi - handler_info) < (Py_ssize_t)Py_ARRAY_LENGTH(handler_info)); + int handlernum = (int)(hi - handler_info); PyObject *result = self->handlers[handlernum]; if (result == NULL) result = Py_None; @@ -1189,7 +1190,8 @@ xmlparse_handler_getter(xmlparseobject *self, struct HandlerInfo *hi) static int xmlparse_handler_setter(xmlparseobject *self, PyObject *v, struct HandlerInfo *hi) { - int handlernum = hi - handler_info; + assert((hi - handler_info) < (Py_ssize_t)Py_ARRAY_LENGTH(handler_info)); + int handlernum = (int)(hi - handler_info); if (v == NULL) { PyErr_SetString(PyExc_RuntimeError, "Cannot delete attribute"); return -1; From webhook-mailer at python.org Thu Nov 22 08:43:14 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 22 Nov 2018 13:43:14 -0000 Subject: [Python-checkins] bpo-18407: win32_urandom() uses PY_DWORD_MAX (GH-10656) Message-ID: https://github.com/python/cpython/commit/c48ff73dd60bec5dcbe64bedeff91e6db26d98bc commit: c48ff73dd60bec5dcbe64bedeff91e6db26d98bc branch: master author: Victor Stinner committer: GitHub date: 2018-11-22T14:43:07+01:00 summary: bpo-18407: win32_urandom() uses PY_DWORD_MAX (GH-10656) CryptGenRandom() maximum size is PY_DWORD_MAX, not INT_MAX. Use DWORD type for the 'chunk' variable Co-Authored-By: Jeremy Kloth files: M Python/bootstrap_hash.c diff --git a/Python/bootstrap_hash.c b/Python/bootstrap_hash.c index 793c646f12ba..eb848c8ff6e3 100644 --- a/Python/bootstrap_hash.c +++ b/Python/bootstrap_hash.c @@ -55,8 +55,6 @@ win32_urandom_init(int raise) static int win32_urandom(unsigned char *buffer, Py_ssize_t size, int raise) { - Py_ssize_t chunk; - if (hCryptProv == 0) { if (win32_urandom_init(raise) == -1) { @@ -66,8 +64,8 @@ win32_urandom(unsigned char *buffer, Py_ssize_t size, int raise) while (size > 0) { - chunk = size > INT_MAX ? INT_MAX : size; - if (!CryptGenRandom(hCryptProv, (DWORD)chunk, buffer)) + DWORD chunk = (DWORD)Py_MIN(size, PY_DWORD_MAX); + if (!CryptGenRandom(hCryptProv, chunk, buffer)) { /* CryptGenRandom() failed */ if (raise) { From webhook-mailer at python.org Thu Nov 22 08:45:20 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 22 Nov 2018 13:45:20 -0000 Subject: [Python-checkins] bpo-18407: ast.c uses Py_ssize_t for asdl_seq_LEN() iterator (GH-10655) Message-ID: https://github.com/python/cpython/commit/4d73ae776140a583fdfe8f016d88cc767791e481 commit: 4d73ae776140a583fdfe8f016d88cc767791e481 branch: master author: Victor Stinner committer: GitHub date: 2018-11-22T14:45:16+01:00 summary: bpo-18407: ast.c uses Py_ssize_t for asdl_seq_LEN() iterator (GH-10655) When iterating using asdl_seq_LEN(), use 'Py_ssize_t' type instead of 'int' for the iterator variable, to avoid downcast on 64-bit platforms. _Py_asdl_int_seq_new() now also ensures that the index is greater than or equal to 0. files: M Include/asdl.h M Python/ast.c diff --git a/Include/asdl.h b/Include/asdl.h index 35e9fa18601b..fc6d22371b63 100644 --- a/Include/asdl.h +++ b/Include/asdl.h @@ -36,7 +36,7 @@ asdl_int_seq *_Py_asdl_int_seq_new(Py_ssize_t size, PyArena *arena); do { \ Py_ssize_t _asdl_i = (I); \ assert((S) != NULL); \ - assert(_asdl_i < (S)->size); \ + assert(0 <= _asdl_i && _asdl_i < (S)->size); \ (S)->elements[_asdl_i] = (V); \ } while (0) #else diff --git a/Python/ast.c b/Python/ast.c index 7f72aa2bd373..0d78cc511641 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -22,7 +22,7 @@ static int validate_expr(expr_ty, expr_context_ty); static int validate_comprehension(asdl_seq *gens) { - int i; + Py_ssize_t i; if (!asdl_seq_LEN(gens)) { PyErr_SetString(PyExc_ValueError, "comprehension with no generators"); return 0; @@ -46,7 +46,7 @@ validate_slice(slice_ty slice) (!slice->v.Slice.upper || validate_expr(slice->v.Slice.upper, Load)) && (!slice->v.Slice.step || validate_expr(slice->v.Slice.step, Load)); case ExtSlice_kind: { - int i; + Py_ssize_t i; if (!validate_nonempty_seq(slice->v.ExtSlice.dims, "dims", "ExtSlice")) return 0; for (i = 0; i < asdl_seq_LEN(slice->v.ExtSlice.dims); i++) @@ -65,7 +65,7 @@ validate_slice(slice_ty slice) static int validate_keywords(asdl_seq *keywords) { - int i; + Py_ssize_t i; for (i = 0; i < asdl_seq_LEN(keywords); i++) if (!validate_expr(((keyword_ty)asdl_seq_GET(keywords, i))->value, Load)) return 0; @@ -75,7 +75,7 @@ validate_keywords(asdl_seq *keywords) static int validate_args(asdl_seq *args) { - int i; + Py_ssize_t i; for (i = 0; i < asdl_seq_LEN(args); i++) { arg_ty arg = asdl_seq_GET(args, i); if (arg->annotation && !validate_expr(arg->annotation, Load)) @@ -348,7 +348,7 @@ validate_body(asdl_seq *body, const char *owner) static int validate_stmt(stmt_ty stmt) { - int i; + Py_ssize_t i; switch (stmt->kind) { case FunctionDef_kind: return validate_body(stmt->v.FunctionDef.body, "FunctionDef") && @@ -490,7 +490,7 @@ validate_stmt(stmt_ty stmt) static int validate_stmts(asdl_seq *seq) { - int i; + Py_ssize_t i; for (i = 0; i < asdl_seq_LEN(seq); i++) { stmt_ty stmt = asdl_seq_GET(seq, i); if (stmt) { @@ -509,7 +509,7 @@ validate_stmts(asdl_seq *seq) static int validate_exprs(asdl_seq *exprs, expr_context_ty ctx, int null_ok) { - int i; + Py_ssize_t i; for (i = 0; i < asdl_seq_LEN(exprs); i++) { expr_ty expr = asdl_seq_GET(exprs, i); if (expr) { @@ -1060,7 +1060,7 @@ set_context(struct compiling *c, expr_ty e, expr_context_ty ctx, const node *n) context for all the contained elements. */ if (s) { - int i; + Py_ssize_t i; for (i = 0; i < asdl_seq_LEN(s); i++) { if (!set_context(c, (expr_ty)asdl_seq_GET(s, i), ctx, n)) @@ -2355,7 +2355,7 @@ ast_for_trailer(struct compiling *c, const node *n, expr_ty left_expr) by treating the sequence as a tuple literal if there are no slice features. */ - int j; + Py_ssize_t j; slice_ty slc; expr_ty e; int simple = 1; From webhook-mailer at python.org Thu Nov 22 09:03:45 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 22 Nov 2018 14:03:45 -0000 Subject: [Python-checkins] bpo-24658: os.read() reuses _PY_READ_MAX (GH-10657) Message-ID: https://github.com/python/cpython/commit/9a0d7a7648547ffb77144bf2480155f6d7940dea commit: 9a0d7a7648547ffb77144bf2480155f6d7940dea branch: master author: Victor Stinner committer: GitHub date: 2018-11-22T15:03:40+01:00 summary: bpo-24658: os.read() reuses _PY_READ_MAX (GH-10657) os_read_impl() now also truncates the size to _PY_READ_MAX on macOS, to avoid to allocate a larger buffer even if _Py_read() is limited to _PY_READ_MAX bytes (ex: INT_MAX on macOS). files: M Modules/posixmodule.c diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index bd97f0abe1b9..44d6009bda71 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -8410,11 +8410,7 @@ os_read_impl(PyObject *module, int fd, Py_ssize_t length) return posix_error(); } -#ifdef MS_WINDOWS - /* On Windows, the count parameter of read() is an int */ - if (length > INT_MAX) - length = INT_MAX; -#endif + length = Py_MIN(length, _PY_READ_MAX); buffer = PyBytes_FromStringAndSize((char *)NULL, length); if (buffer == NULL) From webhook-mailer at python.org Thu Nov 22 09:17:38 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 22 Nov 2018 14:17:38 -0000 Subject: [Python-checkins] bpo-24658: os.read() reuses _PY_READ_MAX (GH-10657) Message-ID: https://github.com/python/cpython/commit/18f3327d9a99163a658697465eb00c31f86535eb commit: 18f3327d9a99163a658697465eb00c31f86535eb branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-22T06:17:34-08:00 summary: bpo-24658: os.read() reuses _PY_READ_MAX (GH-10657) os_read_impl() now also truncates the size to _PY_READ_MAX on macOS, to avoid to allocate a larger buffer even if _Py_read() is limited to _PY_READ_MAX bytes (ex: INT_MAX on macOS). (cherry picked from commit 9a0d7a7648547ffb77144bf2480155f6d7940dea) Co-authored-by: Victor Stinner files: M Modules/posixmodule.c diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 8ff487d8cc1f..dbd534cab06a 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -8021,11 +8021,7 @@ os_read_impl(PyObject *module, int fd, Py_ssize_t length) return posix_error(); } -#ifdef MS_WINDOWS - /* On Windows, the count parameter of read() is an int */ - if (length > INT_MAX) - length = INT_MAX; -#endif + length = Py_MIN(length, _PY_READ_MAX); buffer = PyBytes_FromStringAndSize((char *)NULL, length); if (buffer == NULL) From webhook-mailer at python.org Thu Nov 22 09:25:28 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 22 Nov 2018 14:25:28 -0000 Subject: [Python-checkins] bpo-24658: os.read() reuses _PY_READ_MAX (GH-10657) Message-ID: https://github.com/python/cpython/commit/0c15e508baec7e542933db2b31ea950a646cd968 commit: 0c15e508baec7e542933db2b31ea950a646cd968 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-22T06:25:25-08:00 summary: bpo-24658: os.read() reuses _PY_READ_MAX (GH-10657) os_read_impl() now also truncates the size to _PY_READ_MAX on macOS, to avoid to allocate a larger buffer even if _Py_read() is limited to _PY_READ_MAX bytes (ex: INT_MAX on macOS). (cherry picked from commit 9a0d7a7648547ffb77144bf2480155f6d7940dea) Co-authored-by: Victor Stinner files: M Modules/posixmodule.c diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index f5642d267299..b7091ca4c234 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -7912,11 +7912,7 @@ os_read_impl(PyObject *module, int fd, Py_ssize_t length) return posix_error(); } -#ifdef MS_WINDOWS - /* On Windows, the count parameter of read() is an int */ - if (length > INT_MAX) - length = INT_MAX; -#endif + length = Py_MIN(length, _PY_READ_MAX); buffer = PyBytes_FromStringAndSize((char *)NULL, length); if (buffer == NULL) From webhook-mailer at python.org Thu Nov 22 10:11:20 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 22 Nov 2018 15:11:20 -0000 Subject: [Python-checkins] Revert "bpo-35239: _PySys_EndInit() copies module_search_path (GH-10532)" (GH-10660) Message-ID: https://github.com/python/cpython/commit/a5194115733f6ca8fc1ddbee43eabbde536900e6 commit: a5194115733f6ca8fc1ddbee43eabbde536900e6 branch: 3.7 author: Victor Stinner committer: GitHub date: 2018-11-22T16:11:15+01:00 summary: Revert "bpo-35239: _PySys_EndInit() copies module_search_path (GH-10532)" (GH-10660) This reverts commit d2be9a5c13221fb84c2221bbfd93efac6111e697. files: M Lib/test/test_embed.py M Python/pylifecycle.c M Python/sysmodule.c diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py index 89797d25c844..11f37f06da9c 100644 --- a/Lib/test/test_embed.py +++ b/Lib/test/test_embed.py @@ -301,6 +301,10 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): } # main config + UNTESTED_MAIN_CONFIG = ( + # FIXME: untested main configuration variables + 'module_search_path', + ) COPY_MAIN_CONFIG = ( # Copy core config to main config for expected values 'argv', @@ -311,8 +315,7 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): 'install_signal_handlers', 'prefix', 'warnoptions', - # xoptions is created from core_config in check_main_config(). - # 'module_search_paths' is copied to 'module_search_path'. + # xoptions is created from core_config in check_main_config() ) # global config @@ -386,10 +389,12 @@ def check_main_config(self, config): main_config = config['main_config'] # main config + for key in self.UNTESTED_MAIN_CONFIG: + del main_config[key] + expected_main = {} for key in self.COPY_MAIN_CONFIG: expected_main[key] = core_config[key] - expected_main['module_search_path'] = core_config['module_search_paths'] expected_main['xoptions'] = self.main_xoptions(core_config['xoptions']) self.assertEqual(main_config, expected_main) diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 7eaf376d1a6a..86f95de8336f 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -967,8 +967,8 @@ _Py_InitializeMainInterpreter(PyInterpreterState *interp, } /* Initialize warnings. */ - PyObject *warnoptions = PySys_GetObject("warnoptions"); - if (warnoptions != NULL && PyList_Size(warnoptions) > 0) + if (interp->config.warnoptions != NULL && + PyList_Size(interp->config.warnoptions) > 0) { PyObject *warnings_module = PyImport_ImportModule("warnings"); if (warnings_module == NULL) { diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 48d8fa4c6e04..498fa91fcc3d 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -2464,20 +2464,7 @@ _PySys_EndInit(PyObject *sysdict, _PyMainInterpreterConfig *config) assert(config->exec_prefix != NULL); assert(config->base_exec_prefix != NULL); -#define COPY_LIST(KEY, ATTR) \ - do { \ - assert(PyList_Check(config->ATTR)); \ - PyObject *list = PyList_GetSlice(config->ATTR, \ - 0, PyList_GET_SIZE(config->ATTR)); \ - if (list == NULL) { \ - return -1; \ - } \ - SET_SYS_FROM_STRING_BORROW(KEY, list); \ - Py_DECREF(list); \ - } while (0) - - COPY_LIST("path", module_search_path); - + SET_SYS_FROM_STRING_BORROW("path", config->module_search_path); SET_SYS_FROM_STRING_BORROW("executable", config->executable); SET_SYS_FROM_STRING_BORROW("prefix", config->prefix); SET_SYS_FROM_STRING_BORROW("base_prefix", config->base_prefix); @@ -2488,19 +2475,12 @@ _PySys_EndInit(PyObject *sysdict, _PyMainInterpreterConfig *config) SET_SYS_FROM_STRING_BORROW("argv", config->argv); } if (config->warnoptions != NULL) { - COPY_LIST("warnoptions", warnoptions); + SET_SYS_FROM_STRING_BORROW("warnoptions", config->warnoptions); } if (config->xoptions != NULL) { - PyObject *dict = PyDict_Copy(config->xoptions); - if (dict == NULL) { - return -1; - } - SET_SYS_FROM_STRING_BORROW("_xoptions", dict); - Py_DECREF(dict); + SET_SYS_FROM_STRING_BORROW("_xoptions", config->xoptions); } -#undef COPY_LIST - /* Set flags to their final values */ SET_SYS_FROM_STRING_INT_RESULT("flags", make_flags()); /* prevent user from creating new instances */ From webhook-mailer at python.org Thu Nov 22 10:33:01 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 22 Nov 2018 15:33:01 -0000 Subject: [Python-checkins] bpo-9263: Fix _PyObject_Dump() for freed object (#10661) Message-ID: https://github.com/python/cpython/commit/2cf5d32fd9e61488e8b0be55a2e92a752ba8b06b commit: 2cf5d32fd9e61488e8b0be55a2e92a752ba8b06b branch: master author: Victor Stinner committer: GitHub date: 2018-11-22T16:32:57+01:00 summary: bpo-9263: Fix _PyObject_Dump() for freed object (#10661) If _PyObject_Dump() detects that the object is freed, don't try to dump it (exit immediately). Enhance also _PyObject_IsFreed(): it now detects if the pointer itself looks like freed memory. files: M Objects/object.c diff --git a/Objects/object.c b/Objects/object.c index 9d2614bb6d11..c2d78aa47e65 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -423,6 +423,10 @@ _Py_BreakPoint(void) int _PyObject_IsFreed(PyObject *op) { + uintptr_t ptr = (uintptr_t)op; + if (_PyMem_IsFreed(&ptr, sizeof(ptr))) { + return 1; + } int freed = _PyMem_IsFreed(&op->ob_type, sizeof(op->ob_type)); /* ignore op->ob_ref: the value can have be modified by Py_INCREF() and Py_DECREF(). */ @@ -448,6 +452,7 @@ _PyObject_Dump(PyObject* op) /* It seems like the object memory has been freed: don't access it to prevent a segmentation fault. */ fprintf(stderr, "\n"); + return; } PyGILState_STATE gil; From webhook-mailer at python.org Thu Nov 22 11:15:41 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 22 Nov 2018 16:15:41 -0000 Subject: [Python-checkins] [3.7] bpo-9263: _PyObject_Dump() detects freed memory (GH-10061) (GH-10662) Message-ID: https://github.com/python/cpython/commit/95036ea25d47f0081bda2ba96ea327f3375cb6a4 commit: 95036ea25d47f0081bda2ba96ea327f3375cb6a4 branch: 3.7 author: Victor Stinner committer: GitHub date: 2018-11-22T17:15:37+01:00 summary: [3.7] bpo-9263: _PyObject_Dump() detects freed memory (GH-10061) (GH-10662) * bpo-9263: _PyObject_Dump() detects freed memory (GH-10061) _PyObject_Dump() now uses an heuristic to check if the object memory has been freed: log "" in that case. The heuristic rely on the debug hooks on Python memory allocators which fills the memory with DEADBYTE (0xDB) when memory is deallocated. Use PYTHONMALLOC=debug to always enable these debug hooks. (cherry picked from commit 82af0b63b07aa8d92b50098e382b458143cfc677) * bpo-9263: Fix _PyObject_Dump() for freed object (#10661) If _PyObject_Dump() detects that the object is freed, don't try to dump it (exit immediately). Enhance also _PyObject_IsFreed(): it now detects if the pointer itself looks like freed memory. (cherry picked from commit 2cf5d32fd9e61488e8b0be55a2e92a752ba8b06b) files: M Include/object.h M Include/pymem.h M Objects/object.c M Objects/obmalloc.c diff --git a/Include/object.h b/Include/object.h index c772deaf57db..bcf78afe6bbb 100644 --- a/Include/object.h +++ b/Include/object.h @@ -521,6 +521,7 @@ struct _Py_Identifier; PyAPI_FUNC(int) PyObject_Print(PyObject *, FILE *, int); PyAPI_FUNC(void) _Py_BreakPoint(void); PyAPI_FUNC(void) _PyObject_Dump(PyObject *); +PyAPI_FUNC(int) _PyObject_IsFreed(PyObject *); #endif PyAPI_FUNC(PyObject *) PyObject_Repr(PyObject *); PyAPI_FUNC(PyObject *) PyObject_Str(PyObject *); diff --git a/Include/pymem.h b/Include/pymem.h index 8ee0efddca7d..ef6e0bb5e25f 100644 --- a/Include/pymem.h +++ b/Include/pymem.h @@ -55,7 +55,9 @@ PyAPI_FUNC(int) PyTraceMalloc_Untrack( PyAPI_FUNC(PyObject*) _PyTraceMalloc_GetTraceback( unsigned int domain, uintptr_t ptr); -#endif /* !Py_LIMITED_API */ + +PyAPI_FUNC(int) _PyMem_IsFreed(void *ptr, size_t size); +#endif /* !defined(Py_LIMITED_API) */ /* BEWARE: diff --git a/Objects/object.c b/Objects/object.c index 5535b7ee7eca..138df4488027 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -411,34 +411,71 @@ _Py_BreakPoint(void) } +/* Heuristic checking if the object memory has been deallocated. + Rely on the debug hooks on Python memory allocators which fills the memory + with DEADBYTE (0xDB) when memory is deallocated. + + The function can be used to prevent segmentation fault on dereferencing + pointers like 0xdbdbdbdbdbdbdbdb. Such pointer is very unlikely to be mapped + in memory. */ +int +_PyObject_IsFreed(PyObject *op) +{ + uintptr_t ptr = (uintptr_t)op; + if (_PyMem_IsFreed(&ptr, sizeof(ptr))) { + return 1; + } + int freed = _PyMem_IsFreed(&op->ob_type, sizeof(op->ob_type)); + /* ignore op->ob_ref: the value can have be modified + by Py_INCREF() and Py_DECREF(). */ +#ifdef Py_TRACE_REFS + freed &= _PyMem_IsFreed(&op->_ob_next, sizeof(op->_ob_next)); + freed &= _PyMem_IsFreed(&op->_ob_prev, sizeof(op->_ob_prev)); +#endif + return freed; +} + + /* For debugging convenience. See Misc/gdbinit for some useful gdb hooks */ void _PyObject_Dump(PyObject* op) { - if (op == NULL) - fprintf(stderr, "NULL\n"); - else { - PyGILState_STATE gil; - PyObject *error_type, *error_value, *error_traceback; - - fprintf(stderr, "object : "); - gil = PyGILState_Ensure(); - - PyErr_Fetch(&error_type, &error_value, &error_traceback); - (void)PyObject_Print(op, stderr, 0); - PyErr_Restore(error_type, error_value, error_traceback); - - PyGILState_Release(gil); - /* XXX(twouters) cast refcount to long until %zd is - universally available */ - fprintf(stderr, "\n" - "type : %s\n" - "refcount: %ld\n" - "address : %p\n", - Py_TYPE(op)==NULL ? "NULL" : Py_TYPE(op)->tp_name, - (long)op->ob_refcnt, - op); + if (op == NULL) { + fprintf(stderr, "\n"); + fflush(stderr); + return; + } + + if (_PyObject_IsFreed(op)) { + /* It seems like the object memory has been freed: + don't access it to prevent a segmentation fault. */ + fprintf(stderr, "\n"); + return; } + + PyGILState_STATE gil; + PyObject *error_type, *error_value, *error_traceback; + + fprintf(stderr, "object : "); + fflush(stderr); + gil = PyGILState_Ensure(); + + PyErr_Fetch(&error_type, &error_value, &error_traceback); + (void)PyObject_Print(op, stderr, 0); + fflush(stderr); + PyErr_Restore(error_type, error_value, error_traceback); + + PyGILState_Release(gil); + /* XXX(twouters) cast refcount to long until %zd is + universally available */ + fprintf(stderr, "\n" + "type : %s\n" + "refcount: %ld\n" + "address : %p\n", + Py_TYPE(op)==NULL ? "NULL" : Py_TYPE(op)->tp_name, + (long)op->ob_refcnt, + op); + fflush(stderr); } PyObject * diff --git a/Objects/obmalloc.c b/Objects/obmalloc.c index 1b8b5eefe211..3b0c35bcc941 100644 --- a/Objects/obmalloc.c +++ b/Objects/obmalloc.c @@ -2091,6 +2091,22 @@ _PyMem_DebugRawCalloc(void *ctx, size_t nelem, size_t elsize) } +/* Heuristic checking if the memory has been freed. Rely on the debug hooks on + Python memory allocators which fills the memory with DEADBYTE (0xDB) when + memory is deallocated. */ +int +_PyMem_IsFreed(void *ptr, size_t size) +{ + unsigned char *bytes = ptr; + for (size_t i=0; i < size; i++) { + if (bytes[i] != DEADBYTE) { + return 0; + } + } + return 1; +} + + /* The debug free first checks the 2*SST bytes on each end for sanity (in particular, that the FORBIDDENBYTEs with the api ID are still intact). Then fills the original bytes with DEADBYTE. From webhook-mailer at python.org Thu Nov 22 11:40:58 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 22 Nov 2018 16:40:58 -0000 Subject: [Python-checkins] bpo-9263: _PyObject_Dump() detects freed memory (GH-10061) (GH-10662) (GH-10663) Message-ID: https://github.com/python/cpython/commit/c9b3fc6b59b625c36c31ad437253e7140938af1a commit: c9b3fc6b59b625c36c31ad437253e7140938af1a branch: 3.6 author: Victor Stinner committer: GitHub date: 2018-11-22T17:40:53+01:00 summary: bpo-9263: _PyObject_Dump() detects freed memory (GH-10061) (GH-10662) (GH-10663) * bpo-9263: _PyObject_Dump() detects freed memory (GH-10061) _PyObject_Dump() now uses an heuristic to check if the object memory has been freed: log "" in that case. The heuristic rely on the debug hooks on Python memory allocators which fills the memory with DEADBYTE (0xDB) when memory is deallocated. Use PYTHONMALLOC=debug to always enable these debug hooks. (cherry picked from commit 82af0b63b07aa8d92b50098e382b458143cfc677) * bpo-9263: Fix _PyObject_Dump() for freed object (#10661) If _PyObject_Dump() detects that the object is freed, don't try to dump it (exit immediately). Enhance also _PyObject_IsFreed(): it now detects if the pointer itself looks like freed memory. (cherry picked from commit 2cf5d32fd9e61488e8b0be55a2e92a752ba8b06b) (cherry picked from commit 95036ea25d47f0081bda2ba96ea327f3375cb6a4) files: M Include/object.h M Include/pymem.h M Objects/object.c M Objects/obmalloc.c diff --git a/Include/object.h b/Include/object.h index 63e37b8d33a6..deac94097244 100644 --- a/Include/object.h +++ b/Include/object.h @@ -520,6 +520,7 @@ struct _Py_Identifier; PyAPI_FUNC(int) PyObject_Print(PyObject *, FILE *, int); PyAPI_FUNC(void) _Py_BreakPoint(void); PyAPI_FUNC(void) _PyObject_Dump(PyObject *); +PyAPI_FUNC(int) _PyObject_IsFreed(PyObject *); #endif PyAPI_FUNC(PyObject *) PyObject_Repr(PyObject *); PyAPI_FUNC(PyObject *) PyObject_Str(PyObject *); diff --git a/Include/pymem.h b/Include/pymem.h index a7eb4d2e5943..a9f0186bd972 100644 --- a/Include/pymem.h +++ b/Include/pymem.h @@ -59,7 +59,9 @@ PyAPI_FUNC(int) _PyTraceMalloc_Untrack( PyAPI_FUNC(PyObject*) _PyTraceMalloc_GetTraceback( _PyTraceMalloc_domain_t domain, uintptr_t ptr); -#endif /* !Py_LIMITED_API */ + +PyAPI_FUNC(int) _PyMem_IsFreed(void *ptr, size_t size); +#endif /* !defined(Py_LIMITED_API) */ /* BEWARE: diff --git a/Objects/object.c b/Objects/object.c index fdd41a61681f..e1a0569ab9f1 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -422,40 +422,71 @@ _Py_BreakPoint(void) } +/* Heuristic checking if the object memory has been deallocated. + Rely on the debug hooks on Python memory allocators which fills the memory + with DEADBYTE (0xDB) when memory is deallocated. + + The function can be used to prevent segmentation fault on dereferencing + pointers like 0xdbdbdbdbdbdbdbdb. Such pointer is very unlikely to be mapped + in memory. */ +int +_PyObject_IsFreed(PyObject *op) +{ + uintptr_t ptr = (uintptr_t)op; + if (_PyMem_IsFreed(&ptr, sizeof(ptr))) { + return 1; + } + int freed = _PyMem_IsFreed(&op->ob_type, sizeof(op->ob_type)); + /* ignore op->ob_ref: the value can have be modified + by Py_INCREF() and Py_DECREF(). */ +#ifdef Py_TRACE_REFS + freed &= _PyMem_IsFreed(&op->_ob_next, sizeof(op->_ob_next)); + freed &= _PyMem_IsFreed(&op->_ob_prev, sizeof(op->_ob_prev)); +#endif + return freed; +} + + /* For debugging convenience. See Misc/gdbinit for some useful gdb hooks */ void _PyObject_Dump(PyObject* op) { - if (op == NULL) - fprintf(stderr, "NULL\n"); - else { -#ifdef WITH_THREAD - PyGILState_STATE gil; -#endif - PyObject *error_type, *error_value, *error_traceback; + if (op == NULL) { + fprintf(stderr, "\n"); + fflush(stderr); + return; + } - fprintf(stderr, "object : "); -#ifdef WITH_THREAD - gil = PyGILState_Ensure(); -#endif + if (_PyObject_IsFreed(op)) { + /* It seems like the object memory has been freed: + don't access it to prevent a segmentation fault. */ + fprintf(stderr, "\n"); + return; + } - PyErr_Fetch(&error_type, &error_value, &error_traceback); - (void)PyObject_Print(op, stderr, 0); - PyErr_Restore(error_type, error_value, error_traceback); + PyGILState_STATE gil; + PyObject *error_type, *error_value, *error_traceback; -#ifdef WITH_THREAD - PyGILState_Release(gil); -#endif - /* XXX(twouters) cast refcount to long until %zd is - universally available */ - fprintf(stderr, "\n" - "type : %s\n" - "refcount: %ld\n" - "address : %p\n", - Py_TYPE(op)==NULL ? "NULL" : Py_TYPE(op)->tp_name, - (long)op->ob_refcnt, - op); - } + fprintf(stderr, "object : "); + fflush(stderr); + gil = PyGILState_Ensure(); + + PyErr_Fetch(&error_type, &error_value, &error_traceback); + (void)PyObject_Print(op, stderr, 0); + fflush(stderr); + PyErr_Restore(error_type, error_value, error_traceback); + + PyGILState_Release(gil); + /* XXX(twouters) cast refcount to long until %zd is + universally available */ + fprintf(stderr, "\n" + "type : %s\n" + "refcount: %ld\n" + "address : %p\n", + Py_TYPE(op)==NULL ? "NULL" : Py_TYPE(op)->tp_name, + (long)op->ob_refcnt, + op); + fflush(stderr); } PyObject * diff --git a/Objects/obmalloc.c b/Objects/obmalloc.c index dca186801a6c..d46d14931104 100644 --- a/Objects/obmalloc.c +++ b/Objects/obmalloc.c @@ -1907,6 +1907,23 @@ _PyMem_DebugRawCalloc(void *ctx, size_t nelem, size_t elsize) return _PyMem_DebugRawAlloc(1, ctx, nbytes); } + +/* Heuristic checking if the memory has been freed. Rely on the debug hooks on + Python memory allocators which fills the memory with DEADBYTE (0xDB) when + memory is deallocated. */ +int +_PyMem_IsFreed(void *ptr, size_t size) +{ + unsigned char *bytes = ptr; + for (size_t i=0; i < size; i++) { + if (bytes[i] != DEADBYTE) { + return 0; + } + } + return 1; +} + + /* The debug free first checks the 2*SST bytes on each end for sanity (in particular, that the FORBIDDENBYTEs with the api ID are still intact). Then fills the original bytes with DEADBYTE. From webhook-mailer at python.org Thu Nov 22 12:38:41 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 22 Nov 2018 17:38:41 -0000 Subject: [Python-checkins] bpo-35177, Python-ast.h: Fix "Yield" compiler warning (GH-10664) Message-ID: https://github.com/python/cpython/commit/3bb183d7fb83ad6a84ec13dea90f95d67be35c69 commit: 3bb183d7fb83ad6a84ec13dea90f95d67be35c69 branch: master author: Victor Stinner committer: GitHub date: 2018-11-22T18:38:38+01:00 summary: bpo-35177, Python-ast.h: Fix "Yield" compiler warning (GH-10664) Partially revert commit 5f2df88b63e50d23914e97ec778861a52abdeaad: add "#undef Yield" to .c files after including Python-ast.h. Fix the warning: winbase.h(102): warning C4005: 'Yield': macro redefinition files: M Include/Python-ast.h M Modules/parsermodule.c M Parser/asdl_c.py M Python/bltinmodule.c M Python/import.c M Python/pylifecycle.c M Python/pythonrun.c M Python/symtable.c diff --git a/Include/Python-ast.h b/Include/Python-ast.h index 1b7d9b10b1a5..1a2b8297810c 100644 --- a/Include/Python-ast.h +++ b/Include/Python-ast.h @@ -8,7 +8,7 @@ extern "C" { #include "asdl.h" -#undef Yield /* undefine macro conflicting with winbase.h */ +#undef Yield /* undefine macro conflicting with */ typedef struct _mod *mod_ty; diff --git a/Modules/parsermodule.c b/Modules/parsermodule.c index df239d67b2f7..c8fb3d21771b 100644 --- a/Modules/parsermodule.c +++ b/Modules/parsermodule.c @@ -32,6 +32,7 @@ #include "Python.h" /* general Python API */ #include "Python-ast.h" /* mod_ty */ +#undef Yield /* undefine macro conflicting with */ #include "ast.h" #include "graminit.h" /* symbols defined in the grammar */ #include "node.h" /* internal parser structure */ diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py index 6a8262c73b31..75fb78b9c94e 100644 --- a/Parser/asdl_c.py +++ b/Parser/asdl_c.py @@ -1247,7 +1247,7 @@ def main(srcfile, dump_module=False): f.write('\n') f.write('#include "asdl.h"\n') f.write('\n') - f.write('#undef Yield /* undefine macro conflicting with winbase.h */\n') + f.write('#undef Yield /* undefine macro conflicting with */\n') f.write('\n') c = ChainOfVisitors(TypeDefVisitor(f), StructVisitor(f), diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 14550fd233f4..f0d342ae92d2 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -3,6 +3,7 @@ #include "Python.h" #include #include "ast.h" +#undef Yield /* undefine macro conflicting with */ #include "pycore_pystate.h" _Py_IDENTIFIER(__builtins__); diff --git a/Python/import.c b/Python/import.c index f7c37aa353c8..15637c6a1f31 100644 --- a/Python/import.c +++ b/Python/import.c @@ -3,6 +3,7 @@ #include "Python.h" #include "Python-ast.h" +#undef Yield /* undefine macro conflicting with */ #include "pycore_pyhash.h" #include "pycore_pylifecycle.h" #include "pycore_pymem.h" diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 58e16473100e..af3d5ef055fa 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -3,6 +3,7 @@ #include "Python.h" #include "Python-ast.h" +#undef Yield /* undefine macro conflicting with */ #include "pycore_context.h" #include "pycore_hamt.h" #include "pycore_pathconfig.h" diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 1bf822ceadb4..2d5dc88c5c76 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -11,6 +11,7 @@ #include "Python.h" #include "Python-ast.h" +#undef Yield /* undefine macro conflicting with */ #include "pycore_pystate.h" #include "grammar.h" #include "node.h" diff --git a/Python/symtable.c b/Python/symtable.c index 96f7bcda5e26..677b6043438e 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -1,6 +1,7 @@ #include "Python.h" #include "pycore_pystate.h" #include "symtable.h" +#undef Yield /* undefine macro conflicting with */ #include "structmember.h" /* error strings used for warnings */ From webhook-mailer at python.org Thu Nov 22 17:18:09 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 22 Nov 2018 22:18:09 -0000 Subject: [Python-checkins] [2.7] bpo-35035: Rename email.utils documentation to email.utils.rst (GH-10023) (GH-10667) Message-ID: https://github.com/python/cpython/commit/daa34b84e9f6680a4012d5138068236ccdd2d1bd commit: daa34b84e9f6680a4012d5138068236ccdd2d1bd branch: 2.7 author: Julien Palard committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-11-22T14:18:05-08:00 summary: [2.7] bpo-35035: Rename email.utils documentation to email.utils.rst (GH-10023) (GH-10667) https://bugs.python.org/issue35035 files: A Doc/library/email.utils.rst A Misc/NEWS.d/next/Documentation/2018-10-21-02-20-36.bpo-35035.4zBObK.rst D Doc/library/email.util.rst M Doc/library/email.rst diff --git a/Doc/library/email.rst b/Doc/library/email.rst index 879c38f9aabe..d9bd9edcc3df 100644 --- a/Doc/library/email.rst +++ b/Doc/library/email.rst @@ -61,7 +61,7 @@ Contents of the :mod:`email` package documentation: email.charset.rst email.encoders.rst email.errors.rst - email.util.rst + email.utils.rst email.iterators.rst email-examples.rst diff --git a/Doc/library/email.util.rst b/Doc/library/email.utils.rst similarity index 100% rename from Doc/library/email.util.rst rename to Doc/library/email.utils.rst diff --git a/Misc/NEWS.d/next/Documentation/2018-10-21-02-20-36.bpo-35035.4zBObK.rst b/Misc/NEWS.d/next/Documentation/2018-10-21-02-20-36.bpo-35035.4zBObK.rst new file mode 100644 index 000000000000..46436f1b979b --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2018-10-21-02-20-36.bpo-35035.4zBObK.rst @@ -0,0 +1 @@ +Rename documentation for :mod:`email.utils` to ``email.utils.rst``. From webhook-mailer at python.org Fri Nov 23 06:30:43 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 23 Nov 2018 11:30:43 -0000 Subject: [Python-checkins] bpo-35081: Add new internal headers to Makefile (GH-10670) Message-ID: https://github.com/python/cpython/commit/984061eeb49c54fee901b92e5d3dde1c7a25cfa1 commit: 984061eeb49c54fee901b92e5d3dde1c7a25cfa1 branch: master author: Victor Stinner committer: GitHub date: 2018-11-23T12:30:40+01:00 summary: bpo-35081: Add new internal headers to Makefile (GH-10670) Add pycore_fileutils.h and pycore_object.h to Makefile.pre.in and to the pythoncore project of PCbuild/. files: M Makefile.pre.in M PCbuild/pythoncore.vcxproj M PCbuild/pythoncore.vcxproj.filters diff --git a/Makefile.pre.in b/Makefile.pre.in index 87a84eb68083..2b5afae3762c 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1029,9 +1029,11 @@ PYTHON_HEADERS= \ $(srcdir)/Include/internal/pycore_ceval.h \ $(srcdir)/Include/internal/pycore_condvar.h \ $(srcdir)/Include/internal/pycore_context.h \ + $(srcdir)/Include/internal/pycore_fileutils.h \ $(srcdir)/Include/internal/pycore_getopt.h \ $(srcdir)/Include/internal/pycore_gil.h \ $(srcdir)/Include/internal/pycore_hamt.h \ + $(srcdir)/Include/internal/pycore_object.h \ $(srcdir)/Include/internal/pycore_pathconfig.h \ $(srcdir)/Include/internal/pycore_pyhash.h \ $(srcdir)/Include/internal/pycore_pylifecycle.h \ diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index 0ae24fade13d..885d602b3f0e 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -116,9 +116,11 @@ + + diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters index ef5ef7268a39..2af11c943ae2 100644 --- a/PCbuild/pythoncore.vcxproj.filters +++ b/PCbuild/pythoncore.vcxproj.filters @@ -147,6 +147,9 @@ Include + + Include + Include @@ -156,6 +159,9 @@ Include + + Include + Include From webhook-mailer at python.org Fri Nov 23 06:34:38 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 23 Nov 2018 11:34:38 -0000 Subject: [Python-checkins] bpo-35059: NEWS entry for macros converted to inline funcs (GH-10671) Message-ID: https://github.com/python/cpython/commit/e89607c0fc8d6edbf19c06ba42ff0f00e6c4273f commit: e89607c0fc8d6edbf19c06ba42ff0f00e6c4273f branch: master author: Victor Stinner committer: GitHub date: 2018-11-23T12:34:35+01:00 summary: bpo-35059: NEWS entry for macros converted to inline funcs (GH-10671) files: A Misc/NEWS.d/next/C API/2018-11-23-11-52-34.bpo-35059.BLSp6y.rst diff --git a/Misc/NEWS.d/next/C API/2018-11-23-11-52-34.bpo-35059.BLSp6y.rst b/Misc/NEWS.d/next/C API/2018-11-23-11-52-34.bpo-35059.BLSp6y.rst new file mode 100644 index 000000000000..25120466f7be --- /dev/null +++ b/Misc/NEWS.d/next/C API/2018-11-23-11-52-34.bpo-35059.BLSp6y.rst @@ -0,0 +1,3 @@ +The following C macros have been converted to static inline functions: +:c:func:`Py_INCREF`, :c:func:`Py_DECREF`, :c:func:`Py_XINCREF`, +:c:func:`Py_XDECREF`, :c:func:`PyObject_INIT`, :c:func:`PyObject_INIT_VAR`. From webhook-mailer at python.org Fri Nov 23 07:08:32 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 23 Nov 2018 12:08:32 -0000 Subject: [Python-checkins] bpo-34523: Fix C locale coercion on FreeBSD CURRENT (GH-10672) Message-ID: https://github.com/python/cpython/commit/353933e712b6c7f7ba9a9a50bd5bd472db7c35d0 commit: 353933e712b6c7f7ba9a9a50bd5bd472db7c35d0 branch: master author: Victor Stinner committer: GitHub date: 2018-11-23T13:08:26+01:00 summary: bpo-34523: Fix C locale coercion on FreeBSD CURRENT (GH-10672) bpo-34523, bpo-35290: C locale coercion now resets the Python internal "force ASCII" mode. This change fix the filesystem encoding on FreeBSD CURRENT, which has a new "C.UTF-8" locale, when the UTF-8 mode is disabled. Add _Py_ResetForceASCII(): _Py_SetLocaleFromEnv() now calls it. files: M Include/internal/pycore_fileutils.h M Python/fileutils.c M Python/pylifecycle.c diff --git a/Include/internal/pycore_fileutils.h b/Include/internal/pycore_fileutils.h index 98eb258fe61e..25006653a589 100644 --- a/Include/internal/pycore_fileutils.h +++ b/Include/internal/pycore_fileutils.h @@ -32,6 +32,14 @@ PyAPI_FUNC(wchar_t*) _Py_DecodeUTF8_surrogateescape( PyAPI_FUNC(int) _Py_GetForceASCII(void); +/* Reset "force ASCII" mode (if it was initialized). + + This function should be called when Python changes the LC_CTYPE locale, + so the "force ASCII" mode can be detected again on the new locale + encoding. */ +PyAPI_FUNC(void) _Py_ResetForceASCII(void); + + PyAPI_FUNC(int) _Py_GetLocaleconvNumeric( struct lconv *lc, PyObject **decimal_point, diff --git a/Python/fileutils.c b/Python/fileutils.c index 033c2ff71b91..366bd007e1c9 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -231,6 +231,13 @@ _Py_GetForceASCII(void) } +void +_Py_ResetForceASCII(void) +{ + force_ascii = -1; +} + + static int encode_ascii(const wchar_t *text, char **str, size_t *error_pos, const char **reason, @@ -296,6 +303,12 @@ _Py_GetForceASCII(void) { return 0; } + +void +_Py_ResetForceASCII(void) +{ + /* nothing to do */ +} #endif /* !defined(__APPLE__) && !defined(__ANDROID__) && !defined(MS_WINDOWS) */ diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index af3d5ef055fa..6de32decc5ae 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -5,6 +5,7 @@ #include "Python-ast.h" #undef Yield /* undefine macro conflicting with */ #include "pycore_context.h" +#include "pycore_fileutils.h" #include "pycore_hamt.h" #include "pycore_pathconfig.h" #include "pycore_pylifecycle.h" @@ -394,6 +395,7 @@ defined(HAVE_LANGINFO_H) && defined(CODESET) char * _Py_SetLocaleFromEnv(int category) { + char *res; #ifdef __ANDROID__ const char *locale; const char **pvar; @@ -440,10 +442,12 @@ _Py_SetLocaleFromEnv(int category) } } #endif - return setlocale(category, utf8_locale); -#else /* __ANDROID__ */ - return setlocale(category, ""); -#endif /* __ANDROID__ */ + res = setlocale(category, utf8_locale); +#else /* !defined(__ANDROID__) */ + res = setlocale(category, ""); +#endif + _Py_ResetForceASCII(); + return res; } From webhook-mailer at python.org Fri Nov 23 07:37:46 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 23 Nov 2018 12:37:46 -0000 Subject: [Python-checkins] bpo-34523: Fix C locale coercion on FreeBSD CURRENT (GH-10672) (GH-10673) Message-ID: https://github.com/python/cpython/commit/f6e323ce322cf54b1a9e9252b13f93ebc28b5c24 commit: f6e323ce322cf54b1a9e9252b13f93ebc28b5c24 branch: 3.7 author: Victor Stinner committer: GitHub date: 2018-11-23T13:37:42+01:00 summary: bpo-34523: Fix C locale coercion on FreeBSD CURRENT (GH-10672) (GH-10673) bpo-34523, bpo-35290: C locale coercion now resets the Python internal "force ASCII" mode. This change fix the filesystem encoding on FreeBSD CURRENT, which has a new "C.UTF-8" locale, when the UTF-8 mode is disabled. Add _Py_ResetForceASCII(): _Py_SetLocaleFromEnv() now calls it. (cherry picked from commit 353933e712b6c7f7ba9a9a50bd5bd472db7c35d0) files: M Include/fileutils.h M Python/fileutils.c M Python/pylifecycle.c diff --git a/Include/fileutils.h b/Include/fileutils.h index d75189a95c50..419d49ab75b0 100644 --- a/Include/fileutils.h +++ b/Include/fileutils.h @@ -185,6 +185,13 @@ PyAPI_FUNC(int) _Py_GetLocaleconvNumeric( #ifdef Py_BUILD_CORE PyAPI_FUNC(int) _Py_GetForceASCII(void); + +/* Reset "force ASCII" mode (if it was initialized). + + This function should be called when Python changes the LC_CTYPE locale, + so the "force ASCII" mode can be detected again on the new locale + encoding. */ +PyAPI_FUNC(void) _Py_ResetForceASCII(void); #endif #ifdef __cplusplus diff --git a/Python/fileutils.c b/Python/fileutils.c index b77e490ce236..5e71d375260a 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -191,6 +191,12 @@ _Py_GetForceASCII(void) } +void +_Py_ResetForceASCII(void) +{ + force_ascii = -1; +} + static int encode_ascii(const wchar_t *text, char **str, @@ -252,6 +258,12 @@ _Py_GetForceASCII(void) { return 0; } + +void +_Py_ResetForceASCII(void) +{ + /* nothing to do */ +} #endif /* !defined(__APPLE__) && !defined(__ANDROID__) && !defined(MS_WINDOWS) */ diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 86f95de8336f..4b08c9c2b2ce 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -523,6 +523,7 @@ defined(HAVE_LANGINFO_H) && defined(CODESET) char * _Py_SetLocaleFromEnv(int category) { + char *res; #ifdef __ANDROID__ const char *locale; const char **pvar; @@ -569,10 +570,12 @@ _Py_SetLocaleFromEnv(int category) } } #endif - return setlocale(category, utf8_locale); -#else /* __ANDROID__ */ - return setlocale(category, ""); -#endif /* __ANDROID__ */ + res = setlocale(category, utf8_locale); +#else /* !defined(__ANDROID__) */ + res = setlocale(category, ""); +#endif + _Py_ResetForceASCII(); + return res; } From webhook-mailer at python.org Fri Nov 23 08:27:42 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 23 Nov 2018 13:27:42 -0000 Subject: [Python-checkins] bpo-35059: PyObject_INIT() casts to PyObject* (GH-10674) Message-ID: https://github.com/python/cpython/commit/b509d52083e156f97d6bd36f2f894a052e960f03 commit: b509d52083e156f97d6bd36f2f894a052e960f03 branch: master author: Victor Stinner committer: GitHub date: 2018-11-23T14:27:38+01:00 summary: bpo-35059: PyObject_INIT() casts to PyObject* (GH-10674) PyObject_INIT() and PyObject_INIT_VAR() now cast their first argument to PyObject*, as done in Python 3.7. Revert partially commit b4435e20a92af474f117b78b98ddc6f515363af5. files: M Include/objimpl.h M Objects/bytesobject.c M Objects/classobject.c M Objects/complexobject.c M Objects/floatobject.c M Objects/longobject.c M Objects/methodobject.c M PC/winreg.c diff --git a/Include/objimpl.h b/Include/objimpl.h index 1c50d8bd6c04..aee3fdc3747a 100644 --- a/Include/objimpl.h +++ b/Include/objimpl.h @@ -145,7 +145,7 @@ PyAPI_FUNC(PyVarObject *) _PyObject_NewVar(PyTypeObject *, Py_ssize_t); These inline functions expect non-NULL object pointers. */ static inline PyObject* -PyObject_INIT(PyObject *op, PyTypeObject *typeobj) +_PyObject_INIT(PyObject *op, PyTypeObject *typeobj) { assert(op != NULL); Py_TYPE(op) = typeobj; @@ -153,8 +153,11 @@ PyObject_INIT(PyObject *op, PyTypeObject *typeobj) return op; } +#define PyObject_INIT(op, typeobj) \ + _PyObject_INIT(_PyObject_CAST(op), (typeobj)) + static inline PyVarObject* -PyObject_INIT_VAR(PyVarObject *op, PyTypeObject *typeobj, Py_ssize_t size) +_PyObject_INIT_VAR(PyVarObject *op, PyTypeObject *typeobj, Py_ssize_t size) { assert(op != NULL); Py_SIZE(op) = size; @@ -162,6 +165,9 @@ PyObject_INIT_VAR(PyVarObject *op, PyTypeObject *typeobj, Py_ssize_t size) return op; } +#define PyObject_INIT_VAR(op, typeobj, size) \ + _PyObject_INIT_VAR(_PyVarObject_CAST(op), (typeobj), (size)) + #define _PyObject_SIZE(typeobj) ( (typeobj)->tp_basicsize ) /* _PyObject_VAR_SIZE returns the number of bytes (as size_t) allocated for a diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index bed75ee49e27..e4a49731aba6 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -86,7 +86,7 @@ _PyBytes_FromSize(Py_ssize_t size, int use_calloc) op = (PyBytesObject *)PyObject_Malloc(PyBytesObject_SIZE + size); if (op == NULL) return PyErr_NoMemory(); - (void)PyObject_INIT_VAR((PyVarObject *)op, &PyBytes_Type, size); + (void)PyObject_INIT_VAR(op, &PyBytes_Type, size); op->ob_shash = -1; if (!use_calloc) op->ob_sval[size] = '\0'; @@ -164,7 +164,7 @@ PyBytes_FromString(const char *str) op = (PyBytesObject *)PyObject_MALLOC(PyBytesObject_SIZE + size); if (op == NULL) return PyErr_NoMemory(); - (void)PyObject_INIT_VAR((PyVarObject *)op, &PyBytes_Type, size); + (void)PyObject_INIT_VAR(op, &PyBytes_Type, size); op->ob_shash = -1; memcpy(op->ob_sval, str, size+1); /* share short strings */ @@ -1509,7 +1509,7 @@ bytes_repeat(PyBytesObject *a, Py_ssize_t n) op = (PyBytesObject *)PyObject_MALLOC(PyBytesObject_SIZE + nbytes); if (op == NULL) return PyErr_NoMemory(); - (void)PyObject_INIT_VAR((PyVarObject *)op, &PyBytes_Type, size); + (void)PyObject_INIT_VAR(op, &PyBytes_Type, size); op->ob_shash = -1; op->ob_sval[size] = '\0'; if (Py_SIZE(a) == 1 && n > 0) { diff --git a/Objects/classobject.c b/Objects/classobject.c index 6d1f05ccd3a9..1eed5d36ab03 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@ -56,7 +56,7 @@ PyMethod_New(PyObject *func, PyObject *self) im = free_list; if (im != NULL) { free_list = (PyMethodObject *)(im->im_self); - (void)PyObject_INIT((PyObject *)im, &PyMethod_Type); + (void)PyObject_INIT(im, &PyMethod_Type); numfree--; } else { diff --git a/Objects/complexobject.c b/Objects/complexobject.c index eecdb5250653..6e3d47b62d19 100644 --- a/Objects/complexobject.c +++ b/Objects/complexobject.c @@ -228,7 +228,7 @@ PyComplex_FromCComplex(Py_complex cval) op = (PyComplexObject *) PyObject_MALLOC(sizeof(PyComplexObject)); if (op == NULL) return PyErr_NoMemory(); - (void)PyObject_INIT((PyObject *)op, &PyComplex_Type); + (void)PyObject_INIT(op, &PyComplex_Type); op->cval = cval; return (PyObject *) op; } diff --git a/Objects/floatobject.c b/Objects/floatobject.c index 8d83f00452e5..67f9e5d5b4ef 100644 --- a/Objects/floatobject.c +++ b/Objects/floatobject.c @@ -124,7 +124,7 @@ PyFloat_FromDouble(double fval) return PyErr_NoMemory(); } /* Inline PyObject_New */ - (void)PyObject_INIT((PyObject *)op, &PyFloat_Type); + (void)PyObject_INIT(op, &PyFloat_Type); op->ob_fval = fval; return (PyObject *) op; } diff --git a/Objects/longobject.c b/Objects/longobject.c index 26d6c53fa9ff..f42683e9d024 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -211,7 +211,7 @@ _PyLong_New(Py_ssize_t size) PyErr_NoMemory(); return NULL; } - return (PyLongObject*)PyObject_INIT_VAR((PyVarObject *)result, &PyLong_Type, size); + return (PyLongObject*)PyObject_INIT_VAR(result, &PyLong_Type, size); } PyObject * @@ -5620,7 +5620,7 @@ _PyLong_Init(void) assert(v->ob_digit[0] == (digit)abs(ival)); } else { - (void)PyObject_INIT((PyObject *)v, &PyLong_Type); + (void)PyObject_INIT(v, &PyLong_Type); } Py_SIZE(v) = size; v->ob_digit[0] = (digit)abs(ival); diff --git a/Objects/methodobject.c b/Objects/methodobject.c index 23325e2a1b3e..6dec64276de4 100644 --- a/Objects/methodobject.c +++ b/Objects/methodobject.c @@ -32,7 +32,7 @@ PyCFunction_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module) op = free_list; if (op != NULL) { free_list = (PyCFunctionObject *)(op->m_self); - (void)PyObject_INIT((PyObject *)op, &PyCFunction_Type); + (void)PyObject_INIT(op, &PyCFunction_Type); numfree--; } else { diff --git a/PC/winreg.c b/PC/winreg.c index c6ad7ab64e16..0198097a1c92 100644 --- a/PC/winreg.c +++ b/PC/winreg.c @@ -459,7 +459,7 @@ PyHKEY_FromHKEY(HKEY h) op = (PyHKEYObject *) PyObject_MALLOC(sizeof(PyHKEYObject)); if (op == NULL) return PyErr_NoMemory(); - PyObject_INIT((PyObject *)op, &PyHKEY_Type); + PyObject_INIT(op, &PyHKEY_Type); op->hkey = h; return (PyObject *)op; } From webhook-mailer at python.org Fri Nov 23 09:05:18 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 23 Nov 2018 14:05:18 -0000 Subject: [Python-checkins] bpo-35081: add NEWS entry for new Include/internal/pycore_*.h files (GH-10666) Message-ID: https://github.com/python/cpython/commit/4ac5328affa37bdfc5847dfdb2a41bad772e7270 commit: 4ac5328affa37bdfc5847dfdb2a41bad772e7270 branch: master author: Victor Stinner committer: GitHub date: 2018-11-23T15:05:15+01:00 summary: bpo-35081: add NEWS entry for new Include/internal/pycore_*.h files (GH-10666) files: A Misc/NEWS.d/next/C API/2018-11-22-18-15-46.bpo-35081.FdK9mV.rst diff --git a/Misc/NEWS.d/next/C API/2018-11-22-18-15-46.bpo-35081.FdK9mV.rst b/Misc/NEWS.d/next/C API/2018-11-22-18-15-46.bpo-35081.FdK9mV.rst new file mode 100644 index 000000000000..d1de852b724f --- /dev/null +++ b/Misc/NEWS.d/next/C API/2018-11-22-18-15-46.bpo-35081.FdK9mV.rst @@ -0,0 +1,2 @@ +Internal APIs surrounded by ``#ifdef Py_BUILD_CORE`` have been moved from +``Include/*.h`` headers to new header files ``Include/internal/pycore_*.h``. From webhook-mailer at python.org Fri Nov 23 09:35:11 2018 From: webhook-mailer at python.org (Julien Palard) Date: Fri, 23 Nov 2018 14:35:11 -0000 Subject: [Python-checkins] Doc: Delete "how do I emulate os.kill" section in Windows FAQ (GH-10487) Message-ID: https://github.com/python/cpython/commit/a1c40014085d5cc6c12064577e8c10e7182ee9f9 commit: a1c40014085d5cc6c12064577e8c10e7182ee9f9 branch: master author: Mathieu Dupuy committer: Julien Palard date: 2018-11-23T15:35:07+01:00 summary: Doc: Delete "how do I emulate os.kill" section in Windows FAQ (GH-10487) That section is a tip on how to kill process on Windows for Python prior to 2.7 and 3.2. 3.1 end of support was April 2012 and 2.6 was October 2013, so that hasn't been need for supported versions of Python for more than 5 years. Beside not being needed anymore for a long time, when I read it with the eyes of a Python profane, it makes Python looks bad, like a language from the parts with warts you need to circumvent. Let's delete that :) files: M Doc/faq/windows.rst diff --git a/Doc/faq/windows.rst b/Doc/faq/windows.rst index d063e7c550c0..74aa52ab1a49 100644 --- a/Doc/faq/windows.rst +++ b/Doc/faq/windows.rst @@ -282,26 +282,6 @@ It defines a function ``kbhit()`` which checks whether a keyboard hit is present, and ``getch()`` which gets one character without echoing it. -How do I emulate os.kill() in Windows? --------------------------------------- - -Prior to Python 2.7 and 3.2, to terminate a process, you can use :mod:`ctypes`: - -.. code-block:: python - - import ctypes - - def kill(pid): - """kill function for Win32""" - kernel32 = ctypes.windll.kernel32 - handle = kernel32.OpenProcess(1, 0, pid) - return (0 != kernel32.TerminateProcess(handle, 0)) - -In 2.7 and 3.2, :func:`os.kill` is implemented similar to the above function, -with the additional feature of being able to send :kbd:`Ctrl+C` and :kbd:`Ctrl+Break` -to console subprocesses which are designed to handle those signals. See -:func:`os.kill` for further details. - How do I extract the downloaded documentation on Windows? --------------------------------------------------------- From webhook-mailer at python.org Fri Nov 23 10:30:16 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 23 Nov 2018 15:30:16 -0000 Subject: [Python-checkins] bpo-35296: make install now installs the internal API (GH-10665) Message-ID: https://github.com/python/cpython/commit/f653fd4d950ac092719b6152e38d77c62b443125 commit: f653fd4d950ac092719b6152e38d77c62b443125 branch: master author: Victor Stinner committer: GitHub date: 2018-11-23T16:30:12+01:00 summary: bpo-35296: make install now installs the internal API (GH-10665) make install now also installs the internal API: Include/internal/*.h header files. files: A Misc/NEWS.d/next/C API/2018-11-22-18-34-23.bpo-35296.nxrIQt.rst M Makefile.pre.in diff --git a/Makefile.pre.in b/Makefile.pre.in index 2b5afae3762c..5a21adb7e9b1 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1446,11 +1446,21 @@ inclinstall: else true; \ fi; \ done + @if test ! -d $(DESTDIR)$(INCLUDEPY)/internal; then \ + echo "Creating directory $(DESTDIR)$(INCLUDEPY)/internal"; \ + $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(INCLUDEPY)/internal; \ + else true; \ + fi @for i in $(srcdir)/Include/*.h; \ do \ echo $(INSTALL_DATA) $$i $(INCLUDEPY); \ $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY); \ done + @for i in $(srcdir)/Include/internal/*.h; \ + do \ + echo $(INSTALL_DATA) $$i $(INCLUDEPY)/internal; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY)/internal; \ + done $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h # Install the library and miscellaneous stuff needed for extending/embedding diff --git a/Misc/NEWS.d/next/C API/2018-11-22-18-34-23.bpo-35296.nxrIQt.rst b/Misc/NEWS.d/next/C API/2018-11-22-18-34-23.bpo-35296.nxrIQt.rst new file mode 100644 index 000000000000..c5f877a4e323 --- /dev/null +++ b/Misc/NEWS.d/next/C API/2018-11-22-18-34-23.bpo-35296.nxrIQt.rst @@ -0,0 +1,2 @@ +``make install`` now also installs the internal API: +``Include/internal/*.h`` header files. From webhook-mailer at python.org Fri Nov 23 10:46:15 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 23 Nov 2018 15:46:15 -0000 Subject: [Python-checkins] bpo-35189: Retry fnctl calls on EINTR (GH-10413) Message-ID: https://github.com/python/cpython/commit/b409ffa848b280c1db1b4f450bfae14f263099ac commit: b409ffa848b280c1db1b4f450bfae14f263099ac branch: master author: nierob committer: Victor Stinner date: 2018-11-23T16:46:12+01:00 summary: bpo-35189: Retry fnctl calls on EINTR (GH-10413) Modify the following fnctl function to retry if interrupted by a signal (EINTR): flock, lockf, fnctl. files: A Misc/NEWS.d/next/Library/2018-11-09-13-35-36.bpo-35189.gog-sl.rst M Lib/test/eintrdata/eintr_tester.py M Modules/fcntlmodule.c diff --git a/Lib/test/eintrdata/eintr_tester.py b/Lib/test/eintrdata/eintr_tester.py index 18d9d8451feb..c2eaf0128a5f 100644 --- a/Lib/test/eintrdata/eintr_tester.py +++ b/Lib/test/eintrdata/eintr_tester.py @@ -10,6 +10,7 @@ import contextlib import faulthandler +import fcntl import os import select import signal @@ -486,5 +487,43 @@ def test_devpoll(self): self.assertGreaterEqual(dt, self.sleep_time) +class FNTLEINTRTest(EINTRBaseTest): + def _lock(self, lock_func, lock_name): + self.addCleanup(support.unlink, support.TESTFN) + code = '\n'.join(( + "import fcntl, time", + "with open('%s', 'wb') as f:" % support.TESTFN, + " fcntl.%s(f, fcntl.LOCK_EX)" % lock_name, + " time.sleep(%s)" % self.sleep_time)) + start_time = time.monotonic() + proc = self.subprocess(code) + with kill_on_error(proc): + with open(support.TESTFN, 'wb') as f: + while True: # synchronize the subprocess + dt = time.monotonic() - start_time + if dt > 60.0: + raise Exception("failed to sync child in %.1f sec" % dt) + try: + lock_func(f, fcntl.LOCK_EX | fcntl.LOCK_NB) + lock_func(f, fcntl.LOCK_UN) + time.sleep(0.01) + except BlockingIOError: + break + # the child locked the file just a moment ago for 'sleep_time' seconds + # that means that the lock below will block for 'sleep_time' minus some + # potential context switch delay + lock_func(f, fcntl.LOCK_EX) + dt = time.monotonic() - start_time + self.assertGreaterEqual(dt, self.sleep_time) + self.stop_alarm() + proc.wait() + + def test_lockf(self): + self._lock(fcntl.lockf, "lockf") + + def test_flock(self): + self._lock(fcntl.flock, "flock") + + if __name__ == "__main__": unittest.main() diff --git a/Misc/NEWS.d/next/Library/2018-11-09-13-35-36.bpo-35189.gog-sl.rst b/Misc/NEWS.d/next/Library/2018-11-09-13-35-36.bpo-35189.gog-sl.rst new file mode 100644 index 000000000000..3408ca4eec44 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-11-09-13-35-36.bpo-35189.gog-sl.rst @@ -0,0 +1,2 @@ +Modify the following fnctl function to retry if interrupted by a signal +(EINTR): flock, lockf, fnctl diff --git a/Modules/fcntlmodule.c b/Modules/fcntlmodule.c index 77ddebf3ee0d..a938d9e88bf0 100644 --- a/Modules/fcntlmodule.c +++ b/Modules/fcntlmodule.c @@ -64,6 +64,7 @@ fcntl_fcntl_impl(PyObject *module, int fd, int code, PyObject *arg) char *str; Py_ssize_t len; char buf[1024]; + int async_err = 0; if (arg != NULL) { int parse_result; @@ -75,12 +76,13 @@ fcntl_fcntl_impl(PyObject *module, int fd, int code, PyObject *arg) return NULL; } memcpy(buf, str, len); - Py_BEGIN_ALLOW_THREADS - ret = fcntl(fd, code, buf); - Py_END_ALLOW_THREADS + do { + Py_BEGIN_ALLOW_THREADS + ret = fcntl(fd, code, buf); + Py_END_ALLOW_THREADS + } while (ret == -1 && errno == EINTR && !(async_err = PyErr_CheckSignals())); if (ret < 0) { - PyErr_SetFromErrno(PyExc_OSError); - return NULL; + return !async_err ? PyErr_SetFromErrno(PyExc_OSError) : NULL; } return PyBytes_FromStringAndSize(buf, len); } @@ -95,12 +97,13 @@ fcntl_fcntl_impl(PyObject *module, int fd, int code, PyObject *arg) } } - Py_BEGIN_ALLOW_THREADS - ret = fcntl(fd, code, (int)int_arg); - Py_END_ALLOW_THREADS + do { + Py_BEGIN_ALLOW_THREADS + ret = fcntl(fd, code, (int)int_arg); + Py_END_ALLOW_THREADS + } while (ret == -1 && errno == EINTR && !(async_err = PyErr_CheckSignals())); if (ret < 0) { - PyErr_SetFromErrno(PyExc_OSError); - return NULL; + return !async_err ? PyErr_SetFromErrno(PyExc_OSError) : NULL; } return PyLong_FromLong((long)ret); } @@ -283,11 +286,14 @@ fcntl_flock_impl(PyObject *module, int fd, int code) /*[clinic end generated code: output=84059e2b37d2fc64 input=b70a0a41ca22a8a0]*/ { int ret; + int async_err = 0; #ifdef HAVE_FLOCK - Py_BEGIN_ALLOW_THREADS - ret = flock(fd, code); - Py_END_ALLOW_THREADS + do { + Py_BEGIN_ALLOW_THREADS + ret = flock(fd, code); + Py_END_ALLOW_THREADS + } while (ret == -1 && errno == EINTR && !(async_err = PyErr_CheckSignals())); #else #ifndef LOCK_SH @@ -310,14 +316,15 @@ fcntl_flock_impl(PyObject *module, int fd, int code) return NULL; } l.l_whence = l.l_start = l.l_len = 0; - Py_BEGIN_ALLOW_THREADS - ret = fcntl(fd, (code & LOCK_NB) ? F_SETLK : F_SETLKW, &l); - Py_END_ALLOW_THREADS + do { + Py_BEGIN_ALLOW_THREADS + ret = fcntl(fd, (code & LOCK_NB) ? F_SETLK : F_SETLKW, &l); + Py_END_ALLOW_THREADS + } while (ret == -1 && errno == EINTR && !(async_err = PyErr_CheckSignals())); } #endif /* HAVE_FLOCK */ if (ret < 0) { - PyErr_SetFromErrno(PyExc_OSError); - return NULL; + return !async_err ? PyErr_SetFromErrno(PyExc_OSError) : NULL; } Py_RETURN_NONE; } @@ -363,6 +370,7 @@ fcntl_lockf_impl(PyObject *module, int fd, int code, PyObject *lenobj, /*[clinic end generated code: output=4985e7a172e7461a input=3a5dc01b04371f1a]*/ { int ret; + int async_err = 0; #ifndef LOCK_SH #define LOCK_SH 1 /* shared lock */ @@ -407,13 +415,14 @@ fcntl_lockf_impl(PyObject *module, int fd, int code, PyObject *lenobj, return NULL; } l.l_whence = whence; - Py_BEGIN_ALLOW_THREADS - ret = fcntl(fd, (code & LOCK_NB) ? F_SETLK : F_SETLKW, &l); - Py_END_ALLOW_THREADS + do { + Py_BEGIN_ALLOW_THREADS + ret = fcntl(fd, (code & LOCK_NB) ? F_SETLK : F_SETLKW, &l); + Py_END_ALLOW_THREADS + } while (ret == -1 && errno == EINTR && !(async_err = PyErr_CheckSignals())); } if (ret < 0) { - PyErr_SetFromErrno(PyExc_OSError); - return NULL; + return !async_err ? PyErr_SetFromErrno(PyExc_OSError) : NULL; } Py_RETURN_NONE; } From webhook-mailer at python.org Fri Nov 23 11:00:05 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 23 Nov 2018 16:00:05 -0000 Subject: [Python-checkins] bpo-35134: Create Include/cpython/ subdirectory (GH-10624) Message-ID: https://github.com/python/cpython/commit/e421106b9e4d780c083113e4180d58d68acc69ab commit: e421106b9e4d780c083113e4180d58d68acc69ab branch: master author: Victor Stinner committer: GitHub date: 2018-11-23T17:00:00+01:00 summary: bpo-35134: Create Include/cpython/ subdirectory (GH-10624) Include/*.h should be the "portable Python API", whereas Include/cpython/*.h should be the "CPython API": CPython implementation details. Changes: * Create Include/cpython/ subdirectory * "make install" now creates $prefix/include/cpython and copy Include/cpython/* to $prefix/include/cpython * Create Include/cpython/objimpl.h: move objimpl.h code surrounded by "#ifndef Py_LIMITED_API" to cpython/objimpl.h. * objimpl.h now includes cpython/objimpl.h * Windows installer (MSI) now also install Include/ subdirectories: Include/cpython/ and Include/internal/. files: A Include/cpython/objimpl.h A Misc/NEWS.d/next/C API/2018-11-01-13-58-37.bpo-35134.SbZo0o.rst M Include/objimpl.h M Makefile.pre.in M PCbuild/pythoncore.vcxproj M PCbuild/pythoncore.vcxproj.filters M Tools/msi/dev/dev.wixproj diff --git a/Include/cpython/objimpl.h b/Include/cpython/objimpl.h new file mode 100644 index 000000000000..f121922bc42c --- /dev/null +++ b/Include/cpython/objimpl.h @@ -0,0 +1,113 @@ +#ifndef Py_CPYTHON_OBJIMPL_H +# error "this header file must not be included directly" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* This function returns the number of allocated memory blocks, regardless of size */ +PyAPI_FUNC(Py_ssize_t) _Py_GetAllocatedBlocks(void); + +/* Macros */ +#ifdef WITH_PYMALLOC +PyAPI_FUNC(int) _PyObject_DebugMallocStats(FILE *out); +#endif + + +typedef struct { + /* user context passed as the first argument to the 2 functions */ + void *ctx; + + /* allocate an arena of size bytes */ + void* (*alloc) (void *ctx, size_t size); + + /* free an arena */ + void (*free) (void *ctx, void *ptr, size_t size); +} PyObjectArenaAllocator; + +/* Get the arena allocator. */ +PyAPI_FUNC(void) PyObject_GetArenaAllocator(PyObjectArenaAllocator *allocator); + +/* Set the arena allocator. */ +PyAPI_FUNC(void) PyObject_SetArenaAllocator(PyObjectArenaAllocator *allocator); + + +PyAPI_FUNC(Py_ssize_t) _PyGC_CollectNoFail(void); +PyAPI_FUNC(Py_ssize_t) _PyGC_CollectIfEnabled(void); + + +/* Test if an object has a GC head */ +#define PyObject_IS_GC(o) \ + (PyType_IS_GC(Py_TYPE(o)) \ + && (Py_TYPE(o)->tp_is_gc == NULL || Py_TYPE(o)->tp_is_gc(o))) + +/* GC information is stored BEFORE the object structure. */ +typedef struct { + // Pointer to next object in the list. + // 0 means the object is not tracked + uintptr_t _gc_next; + + // Pointer to previous object in the list. + // Lowest two bits are used for flags documented later. + uintptr_t _gc_prev; +} PyGC_Head; + +#define _Py_AS_GC(o) ((PyGC_Head *)(o)-1) + +/* True if the object is currently tracked by the GC. */ +#define _PyObject_GC_IS_TRACKED(o) (_Py_AS_GC(o)->_gc_next != 0) + +/* True if the object may be tracked by the GC in the future, or already is. + This can be useful to implement some optimizations. */ +#define _PyObject_GC_MAY_BE_TRACKED(obj) \ + (PyObject_IS_GC(obj) && \ + (!PyTuple_CheckExact(obj) || _PyObject_GC_IS_TRACKED(obj))) + + +/* Bit flags for _gc_prev */ +/* Bit 0 is set when tp_finalize is called */ +#define _PyGC_PREV_MASK_FINALIZED (1) +/* Bit 1 is set when the object is in generation which is GCed currently. */ +#define _PyGC_PREV_MASK_COLLECTING (2) +/* The (N-2) most significant bits contain the real address. */ +#define _PyGC_PREV_SHIFT (2) +#define _PyGC_PREV_MASK (((uintptr_t) -1) << _PyGC_PREV_SHIFT) + +// Lowest bit of _gc_next is used for flags only in GC. +// But it is always 0 for normal code. +#define _PyGCHead_NEXT(g) ((PyGC_Head*)(g)->_gc_next) +#define _PyGCHead_SET_NEXT(g, p) ((g)->_gc_next = (uintptr_t)(p)) + +// Lowest two bits of _gc_prev is used for _PyGC_PREV_MASK_* flags. +#define _PyGCHead_PREV(g) ((PyGC_Head*)((g)->_gc_prev & _PyGC_PREV_MASK)) +#define _PyGCHead_SET_PREV(g, p) do { \ + assert(((uintptr_t)p & ~_PyGC_PREV_MASK) == 0); \ + (g)->_gc_prev = ((g)->_gc_prev & ~_PyGC_PREV_MASK) \ + | ((uintptr_t)(p)); \ + } while (0) + +#define _PyGCHead_FINALIZED(g) \ + (((g)->_gc_prev & _PyGC_PREV_MASK_FINALIZED) != 0) +#define _PyGCHead_SET_FINALIZED(g) \ + ((g)->_gc_prev |= _PyGC_PREV_MASK_FINALIZED) + +#define _PyGC_FINALIZED(o) \ + _PyGCHead_FINALIZED(_Py_AS_GC(o)) +#define _PyGC_SET_FINALIZED(o) \ + _PyGCHead_SET_FINALIZED(_Py_AS_GC(o)) + + +PyAPI_FUNC(PyObject *) _PyObject_GC_Malloc(size_t size); +PyAPI_FUNC(PyObject *) _PyObject_GC_Calloc(size_t size); + + +/* Test if a type supports weak references */ +#define PyType_SUPPORTS_WEAKREFS(t) ((t)->tp_weaklistoffset > 0) + +#define PyObject_GET_WEAKREFS_LISTPTR(o) \ + ((PyObject **) (((char *) (o)) + Py_TYPE(o)->tp_weaklistoffset)) + +#ifdef __cplusplus +} +#endif diff --git a/Include/objimpl.h b/Include/objimpl.h index aee3fdc3747a..f475ed001d02 100644 --- a/Include/objimpl.h +++ b/Include/objimpl.h @@ -101,17 +101,6 @@ PyAPI_FUNC(void *) PyObject_Calloc(size_t nelem, size_t elsize); PyAPI_FUNC(void *) PyObject_Realloc(void *ptr, size_t new_size); PyAPI_FUNC(void) PyObject_Free(void *ptr); -#ifndef Py_LIMITED_API -/* This function returns the number of allocated memory blocks, regardless of size */ -PyAPI_FUNC(Py_ssize_t) _Py_GetAllocatedBlocks(void); -#endif /* !Py_LIMITED_API */ - -/* Macros */ -#ifdef WITH_PYMALLOC -#ifndef Py_LIMITED_API -PyAPI_FUNC(int) _PyObject_DebugMallocStats(FILE *out); -#endif /* #ifndef Py_LIMITED_API */ -#endif /* Macros */ #define PyObject_MALLOC PyObject_Malloc @@ -226,24 +215,6 @@ _PyObject_INIT_VAR(PyVarObject *op, PyTypeObject *typeobj, Py_ssize_t size) constructor you would start directly with PyObject_Init/InitVar */ -#ifndef Py_LIMITED_API -typedef struct { - /* user context passed as the first argument to the 2 functions */ - void *ctx; - - /* allocate an arena of size bytes */ - void* (*alloc) (void *ctx, size_t size); - - /* free an arena */ - void (*free) (void *ctx, void *ptr, size_t size); -} PyObjectArenaAllocator; - -/* Get the arena allocator. */ -PyAPI_FUNC(void) PyObject_GetArenaAllocator(PyObjectArenaAllocator *allocator); - -/* Set the arena allocator. */ -PyAPI_FUNC(void) PyObject_SetArenaAllocator(PyObjectArenaAllocator *allocator); -#endif /* @@ -254,11 +225,6 @@ PyAPI_FUNC(void) PyObject_SetArenaAllocator(PyObjectArenaAllocator *allocator); /* C equivalent of gc.collect() which ignores the state of gc.enabled. */ PyAPI_FUNC(Py_ssize_t) PyGC_Collect(void); -#ifndef Py_LIMITED_API -PyAPI_FUNC(Py_ssize_t) _PyGC_CollectNoFail(void); -PyAPI_FUNC(Py_ssize_t) _PyGC_CollectIfEnabled(void); -#endif - /* Test if a type has a GC head */ #define PyType_IS_GC(t) PyType_HasFeature((t), Py_TPFLAGS_HAVE_GC) @@ -267,72 +233,7 @@ PyAPI_FUNC(PyVarObject *) _PyObject_GC_Resize(PyVarObject *, Py_ssize_t); ( (type *) _PyObject_GC_Resize(_PyVarObject_CAST(op), (n)) ) -#ifndef Py_LIMITED_API -/* Test if an object has a GC head */ -#define PyObject_IS_GC(o) \ - (PyType_IS_GC(Py_TYPE(o)) \ - && (Py_TYPE(o)->tp_is_gc == NULL || Py_TYPE(o)->tp_is_gc(o))) - -/* GC information is stored BEFORE the object structure. */ -typedef struct { - // Pointer to next object in the list. - // 0 means the object is not tracked - uintptr_t _gc_next; - - // Pointer to previous object in the list. - // Lowest two bits are used for flags documented later. - uintptr_t _gc_prev; -} PyGC_Head; - -#define _Py_AS_GC(o) ((PyGC_Head *)(o)-1) - -/* True if the object is currently tracked by the GC. */ -#define _PyObject_GC_IS_TRACKED(o) (_Py_AS_GC(o)->_gc_next != 0) - -/* True if the object may be tracked by the GC in the future, or already is. - This can be useful to implement some optimizations. */ -#define _PyObject_GC_MAY_BE_TRACKED(obj) \ - (PyObject_IS_GC(obj) && \ - (!PyTuple_CheckExact(obj) || _PyObject_GC_IS_TRACKED(obj))) - - -/* Bit flags for _gc_prev */ -/* Bit 0 is set when tp_finalize is called */ -#define _PyGC_PREV_MASK_FINALIZED (1) -/* Bit 1 is set when the object is in generation which is GCed currently. */ -#define _PyGC_PREV_MASK_COLLECTING (2) -/* The (N-2) most significant bits contain the real address. */ -#define _PyGC_PREV_SHIFT (2) -#define _PyGC_PREV_MASK (((uintptr_t) -1) << _PyGC_PREV_SHIFT) - -// Lowest bit of _gc_next is used for flags only in GC. -// But it is always 0 for normal code. -#define _PyGCHead_NEXT(g) ((PyGC_Head*)(g)->_gc_next) -#define _PyGCHead_SET_NEXT(g, p) ((g)->_gc_next = (uintptr_t)(p)) - -// Lowest two bits of _gc_prev is used for _PyGC_PREV_MASK_* flags. -#define _PyGCHead_PREV(g) ((PyGC_Head*)((g)->_gc_prev & _PyGC_PREV_MASK)) -#define _PyGCHead_SET_PREV(g, p) do { \ - assert(((uintptr_t)p & ~_PyGC_PREV_MASK) == 0); \ - (g)->_gc_prev = ((g)->_gc_prev & ~_PyGC_PREV_MASK) \ - | ((uintptr_t)(p)); \ - } while (0) - -#define _PyGCHead_FINALIZED(g) \ - (((g)->_gc_prev & _PyGC_PREV_MASK_FINALIZED) != 0) -#define _PyGCHead_SET_FINALIZED(g) \ - ((g)->_gc_prev |= _PyGC_PREV_MASK_FINALIZED) - -#define _PyGC_FINALIZED(o) \ - _PyGCHead_FINALIZED(_Py_AS_GC(o)) -#define _PyGC_SET_FINALIZED(o) \ - _PyGCHead_SET_FINALIZED(_Py_AS_GC(o)) -#endif /* !defined(Py_LIMITED_API) */ -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject *) _PyObject_GC_Malloc(size_t size); -PyAPI_FUNC(PyObject *) _PyObject_GC_Calloc(size_t size); -#endif /* !Py_LIMITED_API */ PyAPI_FUNC(PyObject *) _PyObject_GC_New(PyTypeObject *); PyAPI_FUNC(PyVarObject *) _PyObject_GC_NewVar(PyTypeObject *, Py_ssize_t); @@ -368,13 +269,10 @@ PyAPI_FUNC(void) PyObject_GC_Del(void *); } \ } while (0) - -/* Test if a type supports weak references */ #ifndef Py_LIMITED_API -#define PyType_SUPPORTS_WEAKREFS(t) ((t)->tp_weaklistoffset > 0) - -#define PyObject_GET_WEAKREFS_LISTPTR(o) \ - ((PyObject **) (((char *) (o)) + Py_TYPE(o)->tp_weaklistoffset)) +# define Py_CPYTHON_OBJIMPL_H +# include "cpython/objimpl.h" +# undef Py_CPYTHON_OBJIMPL_H #endif #ifdef __cplusplus diff --git a/Makefile.pre.in b/Makefile.pre.in index 5a21adb7e9b1..d0e915a00ae0 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1021,9 +1021,13 @@ PYTHON_HEADERS= \ $(srcdir)/Include/unicodeobject.h \ $(srcdir)/Include/warnings.h \ $(srcdir)/Include/weakrefobject.h \ + \ pyconfig.h \ $(PARSER_HEADERS) \ $(srcdir)/Include/Python-ast.h \ + \ + $(srcdir)/Include/cpython/objimpl.h \ + \ $(srcdir)/Include/internal/pycore_accu.h \ $(srcdir)/Include/internal/pycore_atomic.h \ $(srcdir)/Include/internal/pycore_ceval.h \ @@ -1446,6 +1450,11 @@ inclinstall: else true; \ fi; \ done + @if test ! -d $(DESTDIR)$(INCLUDEPY)/cpython; then \ + echo "Creating directory $(DESTDIR)$(INCLUDEPY)/cpython"; \ + $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(INCLUDEPY)/cpython; \ + else true; \ + fi @if test ! -d $(DESTDIR)$(INCLUDEPY)/internal; then \ echo "Creating directory $(DESTDIR)$(INCLUDEPY)/internal"; \ $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(INCLUDEPY)/internal; \ @@ -1456,6 +1465,11 @@ inclinstall: echo $(INSTALL_DATA) $$i $(INCLUDEPY); \ $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY); \ done + @for i in $(srcdir)/Include/cpython/*.h; \ + do \ + echo $(INSTALL_DATA) $$i $(INCLUDEPY)/cpython; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY)/cpython; \ + done @for i in $(srcdir)/Include/internal/*.h; \ do \ echo $(INSTALL_DATA) $$i $(INCLUDEPY)/internal; \ diff --git a/Misc/NEWS.d/next/C API/2018-11-01-13-58-37.bpo-35134.SbZo0o.rst b/Misc/NEWS.d/next/C API/2018-11-01-13-58-37.bpo-35134.SbZo0o.rst new file mode 100644 index 000000000000..c486a2951f9a --- /dev/null +++ b/Misc/NEWS.d/next/C API/2018-11-01-13-58-37.bpo-35134.SbZo0o.rst @@ -0,0 +1 @@ +Creation of a new ``Include/cpython/`` subdirectory. diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index 885d602b3f0e..34cd3796888c 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -95,6 +95,7 @@ + diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters index 2af11c943ae2..ebe5e8a169fd 100644 --- a/PCbuild/pythoncore.vcxproj.filters +++ b/PCbuild/pythoncore.vcxproj.filters @@ -84,6 +84,9 @@ Include + + Include + Include diff --git a/Tools/msi/dev/dev.wixproj b/Tools/msi/dev/dev.wixproj index 682b66031f1e..bc3a19ce33ca 100644 --- a/Tools/msi/dev/dev.wixproj +++ b/Tools/msi/dev/dev.wixproj @@ -21,7 +21,7 @@ - + $(PySourcePath) !(bindpath.src) $(PySourcePath) @@ -29,7 +29,7 @@ dev_include - + - \ No newline at end of file + From webhook-mailer at python.org Fri Nov 23 11:53:17 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 23 Nov 2018 16:53:17 -0000 Subject: [Python-checkins] [3.7] bpo-35189: Retry fnctl calls on EINTR (GH-10413) (GH-10678) Message-ID: https://github.com/python/cpython/commit/56742f1eb05401a27499af0ccdcb4e4214859fd1 commit: 56742f1eb05401a27499af0ccdcb4e4214859fd1 branch: 3.7 author: Victor Stinner committer: GitHub date: 2018-11-23T17:53:14+01:00 summary: [3.7] bpo-35189: Retry fnctl calls on EINTR (GH-10413) (GH-10678) * bpo-35189: Fix eintr_tester.py (GH-10637) Call setitimer() before each test method, instead of once per test case, to ensure that signals are sent in each test method. Previously, only the first method of a testcase class got signals. Changes: * Replace setUpClass() with setUp() and replace tearDownClass() with tearDown(). * tearDown() now ensures that at least one signal has been sent. * Replace support.run_unittest() with unittest.main() which has a nicer CLI and automatically discover test cases. (cherry picked from commit aac1f81eef971876ba5b1673db9ce6620311c469) * bpo-35189: Retry fnctl calls on EINTR (GH-10413) Modify the following fnctl function to retry if interrupted by a signal (EINTR): flock, lockf, fnctl. (cherry picked from commit b409ffa848b280c1db1b4f450bfae14f263099ac) Co-Authored-By: nierob files: A Misc/NEWS.d/next/Library/2018-11-09-13-35-36.bpo-35189.gog-sl.rst M Lib/test/eintrdata/eintr_tester.py M Modules/fcntlmodule.c diff --git a/Lib/test/eintrdata/eintr_tester.py b/Lib/test/eintrdata/eintr_tester.py index 1caeafe25d9b..c2eaf0128a5f 100644 --- a/Lib/test/eintrdata/eintr_tester.py +++ b/Lib/test/eintrdata/eintr_tester.py @@ -10,6 +10,7 @@ import contextlib import faulthandler +import fcntl import os import select import signal @@ -44,27 +45,32 @@ class EINTRBaseTest(unittest.TestCase): # sleep_time > signal_period sleep_time = 0.2 - @classmethod - def setUpClass(cls): - cls.orig_handler = signal.signal(signal.SIGALRM, lambda *args: None) - signal.setitimer(signal.ITIMER_REAL, cls.signal_delay, - cls.signal_period) + def sighandler(self, signum, frame): + self.signals += 1 - # Issue #25277: Use faulthandler to try to debug a hang on FreeBSD + def setUp(self): + self.signals = 0 + self.orig_handler = signal.signal(signal.SIGALRM, self.sighandler) + signal.setitimer(signal.ITIMER_REAL, self.signal_delay, + self.signal_period) + + # Use faulthandler as watchdog to debug when a test hangs + # (timeout of 10 minutes) if hasattr(faulthandler, 'dump_traceback_later'): faulthandler.dump_traceback_later(10 * 60, exit=True, file=sys.__stderr__) - @classmethod - def stop_alarm(cls): + @staticmethod + def stop_alarm(): signal.setitimer(signal.ITIMER_REAL, 0, 0) - @classmethod - def tearDownClass(cls): - cls.stop_alarm() - signal.signal(signal.SIGALRM, cls.orig_handler) + def tearDown(self): + self.stop_alarm() + signal.signal(signal.SIGALRM, self.orig_handler) if hasattr(faulthandler, 'cancel_dump_traceback_later'): faulthandler.cancel_dump_traceback_later() + # make sure that at least one signal has been received + self.assertGreater(self.signals, 0) def subprocess(self, *args, **kw): cmd_args = (sys.executable, '-c') + args @@ -481,14 +487,43 @@ def test_devpoll(self): self.assertGreaterEqual(dt, self.sleep_time) -def test_main(): - support.run_unittest( - OSEINTRTest, - SocketEINTRTest, - TimeEINTRTest, - SignalEINTRTest, - SelectEINTRTest) +class FNTLEINTRTest(EINTRBaseTest): + def _lock(self, lock_func, lock_name): + self.addCleanup(support.unlink, support.TESTFN) + code = '\n'.join(( + "import fcntl, time", + "with open('%s', 'wb') as f:" % support.TESTFN, + " fcntl.%s(f, fcntl.LOCK_EX)" % lock_name, + " time.sleep(%s)" % self.sleep_time)) + start_time = time.monotonic() + proc = self.subprocess(code) + with kill_on_error(proc): + with open(support.TESTFN, 'wb') as f: + while True: # synchronize the subprocess + dt = time.monotonic() - start_time + if dt > 60.0: + raise Exception("failed to sync child in %.1f sec" % dt) + try: + lock_func(f, fcntl.LOCK_EX | fcntl.LOCK_NB) + lock_func(f, fcntl.LOCK_UN) + time.sleep(0.01) + except BlockingIOError: + break + # the child locked the file just a moment ago for 'sleep_time' seconds + # that means that the lock below will block for 'sleep_time' minus some + # potential context switch delay + lock_func(f, fcntl.LOCK_EX) + dt = time.monotonic() - start_time + self.assertGreaterEqual(dt, self.sleep_time) + self.stop_alarm() + proc.wait() + + def test_lockf(self): + self._lock(fcntl.lockf, "lockf") + + def test_flock(self): + self._lock(fcntl.flock, "flock") if __name__ == "__main__": - test_main() + unittest.main() diff --git a/Misc/NEWS.d/next/Library/2018-11-09-13-35-36.bpo-35189.gog-sl.rst b/Misc/NEWS.d/next/Library/2018-11-09-13-35-36.bpo-35189.gog-sl.rst new file mode 100644 index 000000000000..3408ca4eec44 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-11-09-13-35-36.bpo-35189.gog-sl.rst @@ -0,0 +1,2 @@ +Modify the following fnctl function to retry if interrupted by a signal +(EINTR): flock, lockf, fnctl diff --git a/Modules/fcntlmodule.c b/Modules/fcntlmodule.c index 0baaa83d2aca..163805634baf 100644 --- a/Modules/fcntlmodule.c +++ b/Modules/fcntlmodule.c @@ -64,6 +64,7 @@ fcntl_fcntl_impl(PyObject *module, int fd, int code, PyObject *arg) char *str; Py_ssize_t len; char buf[1024]; + int async_err = 0; if (arg != NULL) { int parse_result; @@ -75,12 +76,13 @@ fcntl_fcntl_impl(PyObject *module, int fd, int code, PyObject *arg) return NULL; } memcpy(buf, str, len); - Py_BEGIN_ALLOW_THREADS - ret = fcntl(fd, code, buf); - Py_END_ALLOW_THREADS + do { + Py_BEGIN_ALLOW_THREADS + ret = fcntl(fd, code, buf); + Py_END_ALLOW_THREADS + } while (ret == -1 && errno == EINTR && !(async_err = PyErr_CheckSignals())); if (ret < 0) { - PyErr_SetFromErrno(PyExc_OSError); - return NULL; + return !async_err ? PyErr_SetFromErrno(PyExc_OSError) : NULL; } return PyBytes_FromStringAndSize(buf, len); } @@ -95,12 +97,13 @@ fcntl_fcntl_impl(PyObject *module, int fd, int code, PyObject *arg) } } - Py_BEGIN_ALLOW_THREADS - ret = fcntl(fd, code, (int)int_arg); - Py_END_ALLOW_THREADS + do { + Py_BEGIN_ALLOW_THREADS + ret = fcntl(fd, code, (int)int_arg); + Py_END_ALLOW_THREADS + } while (ret == -1 && errno == EINTR && !(async_err = PyErr_CheckSignals())); if (ret < 0) { - PyErr_SetFromErrno(PyExc_OSError); - return NULL; + return !async_err ? PyErr_SetFromErrno(PyExc_OSError) : NULL; } return PyLong_FromLong((long)ret); } @@ -283,11 +286,14 @@ fcntl_flock_impl(PyObject *module, int fd, int code) /*[clinic end generated code: output=84059e2b37d2fc64 input=b70a0a41ca22a8a0]*/ { int ret; + int async_err = 0; #ifdef HAVE_FLOCK - Py_BEGIN_ALLOW_THREADS - ret = flock(fd, code); - Py_END_ALLOW_THREADS + do { + Py_BEGIN_ALLOW_THREADS + ret = flock(fd, code); + Py_END_ALLOW_THREADS + } while (ret == -1 && errno == EINTR && !(async_err = PyErr_CheckSignals())); #else #ifndef LOCK_SH @@ -310,14 +316,15 @@ fcntl_flock_impl(PyObject *module, int fd, int code) return NULL; } l.l_whence = l.l_start = l.l_len = 0; - Py_BEGIN_ALLOW_THREADS - ret = fcntl(fd, (code & LOCK_NB) ? F_SETLK : F_SETLKW, &l); - Py_END_ALLOW_THREADS + do { + Py_BEGIN_ALLOW_THREADS + ret = fcntl(fd, (code & LOCK_NB) ? F_SETLK : F_SETLKW, &l); + Py_END_ALLOW_THREADS + } while (ret == -1 && errno == EINTR && !(async_err = PyErr_CheckSignals())); } #endif /* HAVE_FLOCK */ if (ret < 0) { - PyErr_SetFromErrno(PyExc_OSError); - return NULL; + return !async_err ? PyErr_SetFromErrno(PyExc_OSError) : NULL; } Py_RETURN_NONE; } @@ -363,6 +370,7 @@ fcntl_lockf_impl(PyObject *module, int fd, int code, PyObject *lenobj, /*[clinic end generated code: output=4985e7a172e7461a input=3a5dc01b04371f1a]*/ { int ret; + int async_err = 0; #ifndef LOCK_SH #define LOCK_SH 1 /* shared lock */ @@ -407,13 +415,14 @@ fcntl_lockf_impl(PyObject *module, int fd, int code, PyObject *lenobj, return NULL; } l.l_whence = whence; - Py_BEGIN_ALLOW_THREADS - ret = fcntl(fd, (code & LOCK_NB) ? F_SETLK : F_SETLKW, &l); - Py_END_ALLOW_THREADS + do { + Py_BEGIN_ALLOW_THREADS + ret = fcntl(fd, (code & LOCK_NB) ? F_SETLK : F_SETLKW, &l); + Py_END_ALLOW_THREADS + } while (ret == -1 && errno == EINTR && !(async_err = PyErr_CheckSignals())); } if (ret < 0) { - PyErr_SetFromErrno(PyExc_OSError); - return NULL; + return !async_err ? PyErr_SetFromErrno(PyExc_OSError) : NULL; } Py_RETURN_NONE; } From webhook-mailer at python.org Fri Nov 23 11:53:27 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 23 Nov 2018 16:53:27 -0000 Subject: [Python-checkins] Linkify SMTP.quit() in smtplib documentation. (GH-9785) Message-ID: https://github.com/python/cpython/commit/ba57963a95a994947b8bec6869e810a74a751278 commit: ba57963a95a994947b8bec6869e810a74a751278 branch: master author: takey committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-11-23T08:53:24-08:00 summary: Linkify SMTP.quit() in smtplib documentation. (GH-9785) files: M Doc/library/smtplib.rst diff --git a/Doc/library/smtplib.rst b/Doc/library/smtplib.rst index 6fb0934218a6..f59c18409411 100644 --- a/Doc/library/smtplib.rst +++ b/Doc/library/smtplib.rst @@ -41,7 +41,7 @@ Protocol) and :rfc:`1869` (SMTP Service Extensions). the OS default behavior will be used. For normal use, you should only require the initialization/connect, - :meth:`sendmail`, and :meth:`~smtplib.quit` methods. + :meth:`sendmail`, and :meth:`SMTP.quit` methods. An example is included below. The :class:`SMTP` class supports the :keyword:`with` statement. When used From webhook-mailer at python.org Fri Nov 23 11:54:23 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 23 Nov 2018 16:54:23 -0000 Subject: [Python-checkins] bpo-34812: subprocess._args_from_interpreter_flags(): add isolated (GH-10675) Message-ID: https://github.com/python/cpython/commit/9de363271519e0616f4a7b59427057c4810d3acc commit: 9de363271519e0616f4a7b59427057c4810d3acc branch: master author: Victor Stinner committer: GitHub date: 2018-11-23T17:54:20+01:00 summary: bpo-34812: subprocess._args_from_interpreter_flags(): add isolated (GH-10675) The "-I" command line option (run Python in isolated mode) is now also copied by the multiprocessing and distutils modules when spawning child processes. Previously, only -E and -s options (enabled by -I) were copied. subprocess._args_from_interpreter_flags() now copies the -I flag. files: A Misc/NEWS.d/next/Security/2018-11-23-15-00-23.bpo-34812.84VQnb.rst M Lib/subprocess.py M Lib/test/test_support.py diff --git a/Lib/subprocess.py b/Lib/subprocess.py index 5db6f0cc24ba..696617697047 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -262,9 +262,7 @@ def _args_from_interpreter_flags(): # 'inspect': 'i', # 'interactive': 'i', 'dont_write_bytecode': 'B', - 'no_user_site': 's', 'no_site': 'S', - 'ignore_environment': 'E', 'verbose': 'v', 'bytes_warning': 'b', 'quiet': 'q', @@ -276,6 +274,14 @@ def _args_from_interpreter_flags(): if v > 0: args.append('-' + opt * v) + if sys.flags.isolated: + args.append('-I') + else: + if sys.flags.ignore_environment: + args.append('-E') + if sys.flags.no_user_site: + args.append('-s') + # -W options warnopts = sys.warnoptions[:] bytes_warning = sys.flags.bytes_warning diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index 171e28aaa802..4a8f3c581872 100644 --- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -456,7 +456,7 @@ def test_reap_children(self): # pending child process support.reap_children() - def check_options(self, args, func): + def check_options(self, args, func, expected=None): code = f'from test.support import {func}; print(repr({func}()))' cmd = [sys.executable, *args, '-c', code] env = {key: value for key, value in os.environ.items() @@ -466,7 +466,9 @@ def check_options(self, args, func): stderr=subprocess.DEVNULL, universal_newlines=True, env=env) - self.assertEqual(proc.stdout.rstrip(), repr(args)) + if expected is None: + expected = args + self.assertEqual(proc.stdout.rstrip(), repr(expected)) self.assertEqual(proc.returncode, 0) def test_args_from_interpreter_flags(self): @@ -482,6 +484,7 @@ def test_args_from_interpreter_flags(self): ['-v'], ['-b'], ['-q'], + ['-I'], # same option multiple times ['-bb'], ['-vvv'], @@ -500,6 +503,9 @@ def test_args_from_interpreter_flags(self): with self.subTest(opts=opts): self.check_options(opts, 'args_from_interpreter_flags') + self.check_options(['-I', '-E', '-s'], 'args_from_interpreter_flags', + ['-I']) + def test_optim_args_from_interpreter_flags(self): # Test test.support.optim_args_from_interpreter_flags() for opts in ( diff --git a/Misc/NEWS.d/next/Security/2018-11-23-15-00-23.bpo-34812.84VQnb.rst b/Misc/NEWS.d/next/Security/2018-11-23-15-00-23.bpo-34812.84VQnb.rst new file mode 100644 index 000000000000..860404f019d2 --- /dev/null +++ b/Misc/NEWS.d/next/Security/2018-11-23-15-00-23.bpo-34812.84VQnb.rst @@ -0,0 +1,4 @@ +The :option:`-I` command line option (run Python in isolated mode) is now +also copied by the :mod:`multiprocessing` and :mod:`distutils` modules when +spawning child processes. Previously, only :option:`-E` and :option:`-s` options +(enabled by :option:`-I`) were copied. From webhook-mailer at python.org Fri Nov 23 11:59:08 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 23 Nov 2018 16:59:08 -0000 Subject: [Python-checkins] Linkify SMTP.quit() in smtplib documentation. (GH-9785) Message-ID: https://github.com/python/cpython/commit/70cc0923404e37dfd3395200d8040f2a334bacab commit: 70cc0923404e37dfd3395200d8040f2a334bacab branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-23T08:59:05-08:00 summary: Linkify SMTP.quit() in smtplib documentation. (GH-9785) (cherry picked from commit ba57963a95a994947b8bec6869e810a74a751278) Co-authored-by: takey files: M Doc/library/smtplib.rst diff --git a/Doc/library/smtplib.rst b/Doc/library/smtplib.rst index 6fb0934218a6..f59c18409411 100644 --- a/Doc/library/smtplib.rst +++ b/Doc/library/smtplib.rst @@ -41,7 +41,7 @@ Protocol) and :rfc:`1869` (SMTP Service Extensions). the OS default behavior will be used. For normal use, you should only require the initialization/connect, - :meth:`sendmail`, and :meth:`~smtplib.quit` methods. + :meth:`sendmail`, and :meth:`SMTP.quit` methods. An example is included below. The :class:`SMTP` class supports the :keyword:`with` statement. When used From webhook-mailer at python.org Fri Nov 23 12:00:23 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 23 Nov 2018 17:00:23 -0000 Subject: [Python-checkins] Linkify SMTP.quit() in smtplib documentation. (GH-9785) Message-ID: https://github.com/python/cpython/commit/832da879a62a2cbda758edf1a357da63aad94276 commit: 832da879a62a2cbda758edf1a357da63aad94276 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-23T09:00:20-08:00 summary: Linkify SMTP.quit() in smtplib documentation. (GH-9785) (cherry picked from commit ba57963a95a994947b8bec6869e810a74a751278) Co-authored-by: takey files: M Doc/library/smtplib.rst diff --git a/Doc/library/smtplib.rst b/Doc/library/smtplib.rst index 6fb0934218a6..f59c18409411 100644 --- a/Doc/library/smtplib.rst +++ b/Doc/library/smtplib.rst @@ -41,7 +41,7 @@ Protocol) and :rfc:`1869` (SMTP Service Extensions). the OS default behavior will be used. For normal use, you should only require the initialization/connect, - :meth:`sendmail`, and :meth:`~smtplib.quit` methods. + :meth:`sendmail`, and :meth:`SMTP.quit` methods. An example is included below. The :class:`SMTP` class supports the :keyword:`with` statement. When used From webhook-mailer at python.org Fri Nov 23 12:01:34 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 23 Nov 2018 17:01:34 -0000 Subject: [Python-checkins] Linkify SMTP.quit() in smtplib documentation. (GH-9785) Message-ID: https://github.com/python/cpython/commit/0ef0398dcfcbf0ddde13625149ba7065fd1b3833 commit: 0ef0398dcfcbf0ddde13625149ba7065fd1b3833 branch: 2.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-23T09:01:31-08:00 summary: Linkify SMTP.quit() in smtplib documentation. (GH-9785) (cherry picked from commit ba57963a95a994947b8bec6869e810a74a751278) Co-authored-by: takey files: M Doc/library/smtplib.rst diff --git a/Doc/library/smtplib.rst b/Doc/library/smtplib.rst index b6e76895dd93..2cc519e7dc97 100644 --- a/Doc/library/smtplib.rst +++ b/Doc/library/smtplib.rst @@ -36,7 +36,7 @@ Protocol) and :rfc:`1869` (SMTP Service Extensions). is raised. For normal use, you should only require the initialization/connect, - :meth:`sendmail`, and :meth:`~smtplib.quit` methods. + :meth:`sendmail`, and :meth:`SMTP.quit` methods. An example is included below. .. versionchanged:: 2.6 From webhook-mailer at python.org Fri Nov 23 12:06:58 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 23 Nov 2018 17:06:58 -0000 Subject: [Python-checkins] bpo-29877: compileall: import ProcessPoolExecutor only when needed (GH-4856) Message-ID: https://github.com/python/cpython/commit/1d817e4c8259f49602eefe9729743f6d9d748e8d commit: 1d817e4c8259f49602eefe9729743f6d9d748e8d branch: master author: Dustin Spicuzza committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-11-23T09:06:55-08:00 summary: bpo-29877: compileall: import ProcessPoolExecutor only when needed (GH-4856) Importing ProcessPoolExecutor may hang or cause an error when the import accesses urandom on a low resource platform https://bugs.python.org/issue29877 files: A Misc/NEWS.d/next/Library/2017-12-16-11-40-52.bpo-29877.SfWhmz.rst M Lib/compileall.py M Lib/test/test_compileall.py diff --git a/Lib/compileall.py b/Lib/compileall.py index 7be23a67c054..aa65c6b904e7 100644 --- a/Lib/compileall.py +++ b/Lib/compileall.py @@ -16,10 +16,6 @@ import py_compile import struct -try: - from concurrent.futures import ProcessPoolExecutor -except ImportError: - ProcessPoolExecutor = None from functools import partial __all__ = ["compile_dir","compile_file","compile_path"] @@ -70,9 +66,17 @@ def compile_dir(dir, maxlevels=10, ddir=None, force=False, rx=None, workers: maximum number of parallel workers invalidation_mode: how the up-to-dateness of the pyc will be checked """ - if workers is not None and workers < 0: - raise ValueError('workers must be greater or equal to 0') - + ProcessPoolExecutor = None + if workers is not None: + if workers < 0: + raise ValueError('workers must be greater or equal to 0') + elif workers != 1: + try: + # Only import when needed, as low resource platforms may + # fail to import it + from concurrent.futures import ProcessPoolExecutor + except ImportError: + workers = 1 files = _walk_dir(dir, quiet=quiet, maxlevels=maxlevels, ddir=ddir) success = True diff --git a/Lib/test/test_compileall.py b/Lib/test/test_compileall.py index bf2a2c4f0ab1..2e2552303f8d 100644 --- a/Lib/test/test_compileall.py +++ b/Lib/test/test_compileall.py @@ -167,7 +167,7 @@ def test_compile_dir_pathlike(self): self.assertRegex(line, r'Listing ([^WindowsPath|PosixPath].*)') self.assertTrue(os.path.isfile(self.bc_path)) - @mock.patch('compileall.ProcessPoolExecutor') + @mock.patch('concurrent.futures.ProcessPoolExecutor') def test_compile_pool_called(self, pool_mock): compileall.compile_dir(self.directory, quiet=True, workers=5) self.assertTrue(pool_mock.called) @@ -177,19 +177,19 @@ def test_compile_workers_non_positive(self): "workers must be greater or equal to 0"): compileall.compile_dir(self.directory, workers=-1) - @mock.patch('compileall.ProcessPoolExecutor') + @mock.patch('concurrent.futures.ProcessPoolExecutor') def test_compile_workers_cpu_count(self, pool_mock): compileall.compile_dir(self.directory, quiet=True, workers=0) self.assertEqual(pool_mock.call_args[1]['max_workers'], None) - @mock.patch('compileall.ProcessPoolExecutor') + @mock.patch('concurrent.futures.ProcessPoolExecutor') @mock.patch('compileall.compile_file') def test_compile_one_worker(self, compile_file_mock, pool_mock): compileall.compile_dir(self.directory, quiet=True) self.assertFalse(pool_mock.called) self.assertTrue(compile_file_mock.called) - @mock.patch('compileall.ProcessPoolExecutor', new=None) + @mock.patch('concurrent.futures.ProcessPoolExecutor', new=None) @mock.patch('compileall.compile_file') def test_compile_missing_multiprocessing(self, compile_file_mock): compileall.compile_dir(self.directory, quiet=True, workers=5) diff --git a/Misc/NEWS.d/next/Library/2017-12-16-11-40-52.bpo-29877.SfWhmz.rst b/Misc/NEWS.d/next/Library/2017-12-16-11-40-52.bpo-29877.SfWhmz.rst new file mode 100644 index 000000000000..cc09533b7124 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2017-12-16-11-40-52.bpo-29877.SfWhmz.rst @@ -0,0 +1,2 @@ +compileall: import ProcessPoolExecutor only when needed, preventing hangs on +low resource platforms From webhook-mailer at python.org Fri Nov 23 12:13:36 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 23 Nov 2018 17:13:36 -0000 Subject: [Python-checkins] bpo-34812: subprocess._args_from_interpreter_flags(): add isolated (GH-10675) Message-ID: https://github.com/python/cpython/commit/01e579949ab546cd4cdd0d6d18e3ef41ce94f46e commit: 01e579949ab546cd4cdd0d6d18e3ef41ce94f46e branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-23T09:13:32-08:00 summary: bpo-34812: subprocess._args_from_interpreter_flags(): add isolated (GH-10675) The "-I" command line option (run Python in isolated mode) is now also copied by the multiprocessing and distutils modules when spawning child processes. Previously, only -E and -s options (enabled by -I) were copied. subprocess._args_from_interpreter_flags() now copies the -I flag. (cherry picked from commit 9de363271519e0616f4a7b59427057c4810d3acc) Co-authored-by: Victor Stinner files: A Misc/NEWS.d/next/Security/2018-11-23-15-00-23.bpo-34812.84VQnb.rst M Lib/subprocess.py M Lib/test/test_support.py diff --git a/Lib/subprocess.py b/Lib/subprocess.py index 00844bce229a..3c1abb74c26d 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -261,9 +261,7 @@ def _args_from_interpreter_flags(): # 'inspect': 'i', # 'interactive': 'i', 'dont_write_bytecode': 'B', - 'no_user_site': 's', 'no_site': 'S', - 'ignore_environment': 'E', 'verbose': 'v', 'bytes_warning': 'b', 'quiet': 'q', @@ -275,6 +273,14 @@ def _args_from_interpreter_flags(): if v > 0: args.append('-' + opt * v) + if sys.flags.isolated: + args.append('-I') + else: + if sys.flags.ignore_environment: + args.append('-E') + if sys.flags.no_user_site: + args.append('-s') + # -W options warnopts = sys.warnoptions[:] bytes_warning = sys.flags.bytes_warning diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index 7870e940a46e..e29846efe554 100644 --- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -456,7 +456,7 @@ def test_reap_children(self): # pending child process support.reap_children() - def check_options(self, args, func): + def check_options(self, args, func, expected=None): code = f'from test.support import {func}; print(repr({func}()))' cmd = [sys.executable, *args, '-c', code] env = {key: value for key, value in os.environ.items() @@ -466,7 +466,9 @@ def check_options(self, args, func): stderr=subprocess.DEVNULL, universal_newlines=True, env=env) - self.assertEqual(proc.stdout.rstrip(), repr(args)) + if expected is None: + expected = args + self.assertEqual(proc.stdout.rstrip(), repr(expected)) self.assertEqual(proc.returncode, 0) def test_args_from_interpreter_flags(self): @@ -482,6 +484,7 @@ def test_args_from_interpreter_flags(self): ['-v'], ['-b'], ['-q'], + ['-I'], # same option multiple times ['-bb'], ['-vvv'], @@ -500,6 +503,9 @@ def test_args_from_interpreter_flags(self): with self.subTest(opts=opts): self.check_options(opts, 'args_from_interpreter_flags') + self.check_options(['-I', '-E', '-s'], 'args_from_interpreter_flags', + ['-I']) + def test_optim_args_from_interpreter_flags(self): # Test test.support.optim_args_from_interpreter_flags() for opts in ( diff --git a/Misc/NEWS.d/next/Security/2018-11-23-15-00-23.bpo-34812.84VQnb.rst b/Misc/NEWS.d/next/Security/2018-11-23-15-00-23.bpo-34812.84VQnb.rst new file mode 100644 index 000000000000..860404f019d2 --- /dev/null +++ b/Misc/NEWS.d/next/Security/2018-11-23-15-00-23.bpo-34812.84VQnb.rst @@ -0,0 +1,4 @@ +The :option:`-I` command line option (run Python in isolated mode) is now +also copied by the :mod:`multiprocessing` and :mod:`distutils` modules when +spawning child processes. Previously, only :option:`-E` and :option:`-s` options +(enabled by :option:`-I`) were copied. From webhook-mailer at python.org Fri Nov 23 12:41:59 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 23 Nov 2018 17:41:59 -0000 Subject: [Python-checkins] bpo-29877: compileall: import ProcessPoolExecutor only when needed (GH-4856) Message-ID: https://github.com/python/cpython/commit/903a3e8d67b61594c0fa17fb201769ca924b38f8 commit: 903a3e8d67b61594c0fa17fb201769ca924b38f8 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-23T09:41:54-08:00 summary: bpo-29877: compileall: import ProcessPoolExecutor only when needed (GH-4856) Importing ProcessPoolExecutor may hang or cause an error when the import accesses urandom on a low resource platform https://bugs.python.org/issue29877 (cherry picked from commit 1d817e4c8259f49602eefe9729743f6d9d748e8d) Co-authored-by: Dustin Spicuzza files: A Misc/NEWS.d/next/Library/2017-12-16-11-40-52.bpo-29877.SfWhmz.rst M Lib/compileall.py M Lib/test/test_compileall.py diff --git a/Lib/compileall.py b/Lib/compileall.py index 72592126d74c..40b148d2017e 100644 --- a/Lib/compileall.py +++ b/Lib/compileall.py @@ -16,10 +16,6 @@ import py_compile import struct -try: - from concurrent.futures import ProcessPoolExecutor -except ImportError: - ProcessPoolExecutor = None from functools import partial __all__ = ["compile_dir","compile_file","compile_path"] @@ -70,9 +66,17 @@ def compile_dir(dir, maxlevels=10, ddir=None, force=False, rx=None, workers: maximum number of parallel workers invalidation_mode: how the up-to-dateness of the pyc will be checked """ - if workers is not None and workers < 0: - raise ValueError('workers must be greater or equal to 0') - + ProcessPoolExecutor = None + if workers is not None: + if workers < 0: + raise ValueError('workers must be greater or equal to 0') + elif workers != 1: + try: + # Only import when needed, as low resource platforms may + # fail to import it + from concurrent.futures import ProcessPoolExecutor + except ImportError: + workers = 1 files = _walk_dir(dir, quiet=quiet, maxlevels=maxlevels, ddir=ddir) success = True diff --git a/Lib/test/test_compileall.py b/Lib/test/test_compileall.py index 38d7b996c7c2..2995e08aa8b5 100644 --- a/Lib/test/test_compileall.py +++ b/Lib/test/test_compileall.py @@ -161,7 +161,7 @@ def test_compile_dir_pathlike(self): self.assertRegex(line, r'Listing ([^WindowsPath|PosixPath].*)') self.assertTrue(os.path.isfile(self.bc_path)) - @mock.patch('compileall.ProcessPoolExecutor') + @mock.patch('concurrent.futures.ProcessPoolExecutor') def test_compile_pool_called(self, pool_mock): compileall.compile_dir(self.directory, quiet=True, workers=5) self.assertTrue(pool_mock.called) @@ -171,19 +171,19 @@ def test_compile_workers_non_positive(self): "workers must be greater or equal to 0"): compileall.compile_dir(self.directory, workers=-1) - @mock.patch('compileall.ProcessPoolExecutor') + @mock.patch('concurrent.futures.ProcessPoolExecutor') def test_compile_workers_cpu_count(self, pool_mock): compileall.compile_dir(self.directory, quiet=True, workers=0) self.assertEqual(pool_mock.call_args[1]['max_workers'], None) - @mock.patch('compileall.ProcessPoolExecutor') + @mock.patch('concurrent.futures.ProcessPoolExecutor') @mock.patch('compileall.compile_file') def test_compile_one_worker(self, compile_file_mock, pool_mock): compileall.compile_dir(self.directory, quiet=True) self.assertFalse(pool_mock.called) self.assertTrue(compile_file_mock.called) - @mock.patch('compileall.ProcessPoolExecutor', new=None) + @mock.patch('concurrent.futures.ProcessPoolExecutor', new=None) @mock.patch('compileall.compile_file') def test_compile_missing_multiprocessing(self, compile_file_mock): compileall.compile_dir(self.directory, quiet=True, workers=5) diff --git a/Misc/NEWS.d/next/Library/2017-12-16-11-40-52.bpo-29877.SfWhmz.rst b/Misc/NEWS.d/next/Library/2017-12-16-11-40-52.bpo-29877.SfWhmz.rst new file mode 100644 index 000000000000..cc09533b7124 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2017-12-16-11-40-52.bpo-29877.SfWhmz.rst @@ -0,0 +1,2 @@ +compileall: import ProcessPoolExecutor only when needed, preventing hangs on +low resource platforms From webhook-mailer at python.org Fri Nov 23 12:53:21 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 23 Nov 2018 17:53:21 -0000 Subject: [Python-checkins] bpo-29877: compileall: import ProcessPoolExecutor only when needed (GH-4856) Message-ID: https://github.com/python/cpython/commit/879f5f3d9c1f5b66e2a080c712e2323e9c03d558 commit: 879f5f3d9c1f5b66e2a080c712e2323e9c03d558 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-23T09:53:17-08:00 summary: bpo-29877: compileall: import ProcessPoolExecutor only when needed (GH-4856) Importing ProcessPoolExecutor may hang or cause an error when the import accesses urandom on a low resource platform https://bugs.python.org/issue29877 (cherry picked from commit 1d817e4c8259f49602eefe9729743f6d9d748e8d) Co-authored-by: Dustin Spicuzza files: A Misc/NEWS.d/next/Library/2017-12-16-11-40-52.bpo-29877.SfWhmz.rst M Lib/compileall.py M Lib/test/test_compileall.py diff --git a/Lib/compileall.py b/Lib/compileall.py index 1c9ceb693096..39210464b342 100644 --- a/Lib/compileall.py +++ b/Lib/compileall.py @@ -16,10 +16,6 @@ import py_compile import struct -try: - from concurrent.futures import ProcessPoolExecutor -except ImportError: - ProcessPoolExecutor = None from functools import partial __all__ = ["compile_dir","compile_file","compile_path"] @@ -68,9 +64,17 @@ def compile_dir(dir, maxlevels=10, ddir=None, force=False, rx=None, optimize: optimization level or -1 for level of the interpreter workers: maximum number of parallel workers """ - if workers is not None and workers < 0: - raise ValueError('workers must be greater or equal to 0') - + ProcessPoolExecutor = None + if workers is not None: + if workers < 0: + raise ValueError('workers must be greater or equal to 0') + elif workers != 1: + try: + # Only import when needed, as low resource platforms may + # fail to import it + from concurrent.futures import ProcessPoolExecutor + except ImportError: + workers = 1 files = _walk_dir(dir, quiet=quiet, maxlevels=maxlevels, ddir=ddir) success = True diff --git a/Lib/test/test_compileall.py b/Lib/test/test_compileall.py index 2356efcaec78..66a2004833fb 100644 --- a/Lib/test/test_compileall.py +++ b/Lib/test/test_compileall.py @@ -161,7 +161,7 @@ def test_compile_dir_pathlike(self): self.assertRegex(line, r'Listing ([^WindowsPath|PosixPath].*)') self.assertTrue(os.path.isfile(self.bc_path)) - @mock.patch('compileall.ProcessPoolExecutor') + @mock.patch('concurrent.futures.ProcessPoolExecutor') def test_compile_pool_called(self, pool_mock): compileall.compile_dir(self.directory, quiet=True, workers=5) self.assertTrue(pool_mock.called) @@ -171,19 +171,19 @@ def test_compile_workers_non_positive(self): "workers must be greater or equal to 0"): compileall.compile_dir(self.directory, workers=-1) - @mock.patch('compileall.ProcessPoolExecutor') + @mock.patch('concurrent.futures.ProcessPoolExecutor') def test_compile_workers_cpu_count(self, pool_mock): compileall.compile_dir(self.directory, quiet=True, workers=0) self.assertEqual(pool_mock.call_args[1]['max_workers'], None) - @mock.patch('compileall.ProcessPoolExecutor') + @mock.patch('concurrent.futures.ProcessPoolExecutor') @mock.patch('compileall.compile_file') def test_compile_one_worker(self, compile_file_mock, pool_mock): compileall.compile_dir(self.directory, quiet=True) self.assertFalse(pool_mock.called) self.assertTrue(compile_file_mock.called) - @mock.patch('compileall.ProcessPoolExecutor', new=None) + @mock.patch('concurrent.futures.ProcessPoolExecutor', new=None) @mock.patch('compileall.compile_file') def test_compile_missing_multiprocessing(self, compile_file_mock): compileall.compile_dir(self.directory, quiet=True, workers=5) diff --git a/Misc/NEWS.d/next/Library/2017-12-16-11-40-52.bpo-29877.SfWhmz.rst b/Misc/NEWS.d/next/Library/2017-12-16-11-40-52.bpo-29877.SfWhmz.rst new file mode 100644 index 000000000000..cc09533b7124 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2017-12-16-11-40-52.bpo-29877.SfWhmz.rst @@ -0,0 +1,2 @@ +compileall: import ProcessPoolExecutor only when needed, preventing hangs on +low resource platforms From webhook-mailer at python.org Fri Nov 23 13:00:19 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 23 Nov 2018 18:00:19 -0000 Subject: [Python-checkins] [3.7] bpo-35189: Retry fnctl calls on EINTR (GH-10413) (GH-10678) (GH-10685) Message-ID: https://github.com/python/cpython/commit/eef813b1091f4baaaa7411aa58d2746a9761ee99 commit: eef813b1091f4baaaa7411aa58d2746a9761ee99 branch: 3.6 author: Victor Stinner committer: GitHub date: 2018-11-23T19:00:16+01:00 summary: [3.7] bpo-35189: Retry fnctl calls on EINTR (GH-10413) (GH-10678) (GH-10685) * bpo-35189: Fix eintr_tester.py (GH-10637) Call setitimer() before each test method, instead of once per test case, to ensure that signals are sent in each test method. Previously, only the first method of a testcase class got signals. Changes: * Replace setUpClass() with setUp() and replace tearDownClass() with tearDown(). * tearDown() now ensures that at least one signal has been sent. * Replace support.run_unittest() with unittest.main() which has a nicer CLI and automatically discover test cases. (cherry picked from commit aac1f81eef971876ba5b1673db9ce6620311c469) * bpo-35189: Retry fnctl calls on EINTR (GH-10413) Modify the following fnctl function to retry if interrupted by a signal (EINTR): flock, lockf, fnctl. (cherry picked from commit b409ffa848b280c1db1b4f450bfae14f263099ac) Co-Authored-By: nierob (cherry picked from commit 56742f1eb05401a27499af0ccdcb4e4214859fd1) files: A Misc/NEWS.d/next/Library/2018-11-09-13-35-36.bpo-35189.gog-sl.rst M Lib/test/eintrdata/eintr_tester.py M Modules/fcntlmodule.c diff --git a/Lib/test/eintrdata/eintr_tester.py b/Lib/test/eintrdata/eintr_tester.py index 1caeafe25d9b..c2eaf0128a5f 100644 --- a/Lib/test/eintrdata/eintr_tester.py +++ b/Lib/test/eintrdata/eintr_tester.py @@ -10,6 +10,7 @@ import contextlib import faulthandler +import fcntl import os import select import signal @@ -44,27 +45,32 @@ class EINTRBaseTest(unittest.TestCase): # sleep_time > signal_period sleep_time = 0.2 - @classmethod - def setUpClass(cls): - cls.orig_handler = signal.signal(signal.SIGALRM, lambda *args: None) - signal.setitimer(signal.ITIMER_REAL, cls.signal_delay, - cls.signal_period) + def sighandler(self, signum, frame): + self.signals += 1 - # Issue #25277: Use faulthandler to try to debug a hang on FreeBSD + def setUp(self): + self.signals = 0 + self.orig_handler = signal.signal(signal.SIGALRM, self.sighandler) + signal.setitimer(signal.ITIMER_REAL, self.signal_delay, + self.signal_period) + + # Use faulthandler as watchdog to debug when a test hangs + # (timeout of 10 minutes) if hasattr(faulthandler, 'dump_traceback_later'): faulthandler.dump_traceback_later(10 * 60, exit=True, file=sys.__stderr__) - @classmethod - def stop_alarm(cls): + @staticmethod + def stop_alarm(): signal.setitimer(signal.ITIMER_REAL, 0, 0) - @classmethod - def tearDownClass(cls): - cls.stop_alarm() - signal.signal(signal.SIGALRM, cls.orig_handler) + def tearDown(self): + self.stop_alarm() + signal.signal(signal.SIGALRM, self.orig_handler) if hasattr(faulthandler, 'cancel_dump_traceback_later'): faulthandler.cancel_dump_traceback_later() + # make sure that at least one signal has been received + self.assertGreater(self.signals, 0) def subprocess(self, *args, **kw): cmd_args = (sys.executable, '-c') + args @@ -481,14 +487,43 @@ def test_devpoll(self): self.assertGreaterEqual(dt, self.sleep_time) -def test_main(): - support.run_unittest( - OSEINTRTest, - SocketEINTRTest, - TimeEINTRTest, - SignalEINTRTest, - SelectEINTRTest) +class FNTLEINTRTest(EINTRBaseTest): + def _lock(self, lock_func, lock_name): + self.addCleanup(support.unlink, support.TESTFN) + code = '\n'.join(( + "import fcntl, time", + "with open('%s', 'wb') as f:" % support.TESTFN, + " fcntl.%s(f, fcntl.LOCK_EX)" % lock_name, + " time.sleep(%s)" % self.sleep_time)) + start_time = time.monotonic() + proc = self.subprocess(code) + with kill_on_error(proc): + with open(support.TESTFN, 'wb') as f: + while True: # synchronize the subprocess + dt = time.monotonic() - start_time + if dt > 60.0: + raise Exception("failed to sync child in %.1f sec" % dt) + try: + lock_func(f, fcntl.LOCK_EX | fcntl.LOCK_NB) + lock_func(f, fcntl.LOCK_UN) + time.sleep(0.01) + except BlockingIOError: + break + # the child locked the file just a moment ago for 'sleep_time' seconds + # that means that the lock below will block for 'sleep_time' minus some + # potential context switch delay + lock_func(f, fcntl.LOCK_EX) + dt = time.monotonic() - start_time + self.assertGreaterEqual(dt, self.sleep_time) + self.stop_alarm() + proc.wait() + + def test_lockf(self): + self._lock(fcntl.lockf, "lockf") + + def test_flock(self): + self._lock(fcntl.flock, "flock") if __name__ == "__main__": - test_main() + unittest.main() diff --git a/Misc/NEWS.d/next/Library/2018-11-09-13-35-36.bpo-35189.gog-sl.rst b/Misc/NEWS.d/next/Library/2018-11-09-13-35-36.bpo-35189.gog-sl.rst new file mode 100644 index 000000000000..3408ca4eec44 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-11-09-13-35-36.bpo-35189.gog-sl.rst @@ -0,0 +1,2 @@ +Modify the following fnctl function to retry if interrupted by a signal +(EINTR): flock, lockf, fnctl diff --git a/Modules/fcntlmodule.c b/Modules/fcntlmodule.c index 8875b264b507..b5eea4986e0a 100644 --- a/Modules/fcntlmodule.c +++ b/Modules/fcntlmodule.c @@ -64,6 +64,7 @@ fcntl_fcntl_impl(PyObject *module, int fd, int code, PyObject *arg) char *str; Py_ssize_t len; char buf[1024]; + int async_err = 0; if (arg != NULL) { int parse_result; @@ -75,12 +76,13 @@ fcntl_fcntl_impl(PyObject *module, int fd, int code, PyObject *arg) return NULL; } memcpy(buf, str, len); - Py_BEGIN_ALLOW_THREADS - ret = fcntl(fd, code, buf); - Py_END_ALLOW_THREADS + do { + Py_BEGIN_ALLOW_THREADS + ret = fcntl(fd, code, buf); + Py_END_ALLOW_THREADS + } while (ret == -1 && errno == EINTR && !(async_err = PyErr_CheckSignals())); if (ret < 0) { - PyErr_SetFromErrno(PyExc_IOError); - return NULL; + return !async_err ? PyErr_SetFromErrno(PyExc_IOError) : NULL; } return PyBytes_FromStringAndSize(buf, len); } @@ -95,12 +97,13 @@ fcntl_fcntl_impl(PyObject *module, int fd, int code, PyObject *arg) } } - Py_BEGIN_ALLOW_THREADS - ret = fcntl(fd, code, (int)int_arg); - Py_END_ALLOW_THREADS + do { + Py_BEGIN_ALLOW_THREADS + ret = fcntl(fd, code, (int)int_arg); + Py_END_ALLOW_THREADS + } while (ret == -1 && errno == EINTR && !(async_err = PyErr_CheckSignals())); if (ret < 0) { - PyErr_SetFromErrno(PyExc_IOError); - return NULL; + return !async_err ? PyErr_SetFromErrno(PyExc_IOError) : NULL; } return PyLong_FromLong((long)ret); } @@ -283,11 +286,14 @@ fcntl_flock_impl(PyObject *module, int fd, int code) /*[clinic end generated code: output=84059e2b37d2fc64 input=b70a0a41ca22a8a0]*/ { int ret; + int async_err = 0; #ifdef HAVE_FLOCK - Py_BEGIN_ALLOW_THREADS - ret = flock(fd, code); - Py_END_ALLOW_THREADS + do { + Py_BEGIN_ALLOW_THREADS + ret = flock(fd, code); + Py_END_ALLOW_THREADS + } while (ret == -1 && errno == EINTR && !(async_err = PyErr_CheckSignals())); #else #ifndef LOCK_SH @@ -310,14 +316,15 @@ fcntl_flock_impl(PyObject *module, int fd, int code) return NULL; } l.l_whence = l.l_start = l.l_len = 0; - Py_BEGIN_ALLOW_THREADS - ret = fcntl(fd, (code & LOCK_NB) ? F_SETLK : F_SETLKW, &l); - Py_END_ALLOW_THREADS + do { + Py_BEGIN_ALLOW_THREADS + ret = fcntl(fd, (code & LOCK_NB) ? F_SETLK : F_SETLKW, &l); + Py_END_ALLOW_THREADS + } while (ret == -1 && errno == EINTR && !(async_err = PyErr_CheckSignals())); } #endif /* HAVE_FLOCK */ if (ret < 0) { - PyErr_SetFromErrno(PyExc_IOError); - return NULL; + return !async_err ? PyErr_SetFromErrno(PyExc_IOError) : NULL; } Py_RETURN_NONE; } @@ -363,6 +370,7 @@ fcntl_lockf_impl(PyObject *module, int fd, int code, PyObject *lenobj, /*[clinic end generated code: output=4985e7a172e7461a input=3a5dc01b04371f1a]*/ { int ret; + int async_err = 0; #ifndef LOCK_SH #define LOCK_SH 1 /* shared lock */ @@ -407,13 +415,14 @@ fcntl_lockf_impl(PyObject *module, int fd, int code, PyObject *lenobj, return NULL; } l.l_whence = whence; - Py_BEGIN_ALLOW_THREADS - ret = fcntl(fd, (code & LOCK_NB) ? F_SETLK : F_SETLKW, &l); - Py_END_ALLOW_THREADS + do { + Py_BEGIN_ALLOW_THREADS + ret = fcntl(fd, (code & LOCK_NB) ? F_SETLK : F_SETLKW, &l); + Py_END_ALLOW_THREADS + } while (ret == -1 && errno == EINTR && !(async_err = PyErr_CheckSignals())); } if (ret < 0) { - PyErr_SetFromErrno(PyExc_IOError); - return NULL; + return !async_err ? PyErr_SetFromErrno(PyExc_IOError) : NULL; } Py_RETURN_NONE; } From webhook-mailer at python.org Fri Nov 23 13:02:29 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 23 Nov 2018 18:02:29 -0000 Subject: [Python-checkins] bpo-34812: subprocess._args_from_interpreter_flags(): add isolated (GH-10675) (GH-10688) Message-ID: https://github.com/python/cpython/commit/cc0e0a2214d6515cf6ba4c7b164902a87e321b45 commit: cc0e0a2214d6515cf6ba4c7b164902a87e321b45 branch: 3.6 author: Victor Stinner committer: GitHub date: 2018-11-23T19:02:26+01:00 summary: bpo-34812: subprocess._args_from_interpreter_flags(): add isolated (GH-10675) (GH-10688) The "-I" command line option (run Python in isolated mode) and -X options (like -X faulthandler) are now also copied by the multiprocessing and distutils modules when spawning child processes. Previously, only -E and -s options (enabled by -I) were copied. subprocess._args_from_interpreter_flags() now copies the -I flag and options from sys._xoptions like -X dev. (cherry picked from commit 9de363271519e0616f4a7b59427057c4810d3acc) files: A Misc/NEWS.d/next/Security/2018-11-23-15-00-23.bpo-34812.84VQnb.rst M Lib/subprocess.py M Lib/test/test_support.py diff --git a/Lib/subprocess.py b/Lib/subprocess.py index 290ae44f03d7..8c3fa1bf9c8e 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -232,15 +232,13 @@ def _optim_args_from_interpreter_flags(): def _args_from_interpreter_flags(): """Return a list of command-line arguments reproducing the current - settings in sys.flags and sys.warnoptions.""" + settings in sys.flags, sys.warnoptions and sys._xoptions.""" flag_opt_map = { 'debug': 'd', # 'inspect': 'i', # 'interactive': 'i', 'dont_write_bytecode': 'B', - 'no_user_site': 's', 'no_site': 'S', - 'ignore_environment': 'E', 'verbose': 'v', 'bytes_warning': 'b', 'quiet': 'q', @@ -251,8 +249,30 @@ def _args_from_interpreter_flags(): v = getattr(sys.flags, flag) if v > 0: args.append('-' + opt * v) + + if sys.flags.isolated: + args.append('-I') + else: + if sys.flags.ignore_environment: + args.append('-E') + if sys.flags.no_user_site: + args.append('-s') + for opt in sys.warnoptions: args.append('-W' + opt) + + # -X options + xoptions = getattr(sys, '_xoptions', {}) + for opt in ('faulthandler', 'tracemalloc', + 'showalloccount', 'showrefcount', 'utf8'): + if opt in xoptions: + value = xoptions[opt] + if value is True: + arg = opt + else: + arg = '%s=%s' % (opt, value) + args.extend(('-X', arg)) + return args diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index 45cdc94393eb..adc59b622998 100644 --- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -1,13 +1,14 @@ +import errno import importlib +import os import shutil +import socket import stat +import subprocess import sys -import os -import unittest -import socket import tempfile import textwrap -import errno +import unittest from test import support from test.support import script_helper @@ -394,6 +395,65 @@ def test_check__all__(self): self.assertRaises(AssertionError, support.check__all__, self, unittest) + def check_options(self, args, func, expected=None): + code = f'from test.support import {func}; print(repr({func}()))' + cmd = [sys.executable, *args, '-c', code] + env = {key: value for key, value in os.environ.items() + if not key.startswith('PYTHON')} + proc = subprocess.run(cmd, + stdout=subprocess.PIPE, + stderr=subprocess.DEVNULL, + universal_newlines=True, + env=env) + if expected is None: + expected = args + self.assertEqual(proc.stdout.rstrip(), repr(expected)) + self.assertEqual(proc.returncode, 0) + + def test_args_from_interpreter_flags(self): + # Test test.support.args_from_interpreter_flags() + for opts in ( + # no option + [], + # single option + ['-B'], + ['-s'], + ['-S'], + ['-E'], + ['-v'], + ['-b'], + ['-q'], + ['-I'], + # same option multiple times + ['-bb'], + ['-vvv'], + # -W options + ['-Wignore'], + # -X options + ['-X', 'faulthandler'], + ['-X', 'showalloccount'], + ['-X', 'showrefcount'], + ['-X', 'tracemalloc'], + ['-X', 'tracemalloc=3'], + ): + with self.subTest(opts=opts): + self.check_options(opts, 'args_from_interpreter_flags') + + self.check_options(['-I', '-E', '-s'], 'args_from_interpreter_flags', + ['-I']) + + def test_optim_args_from_interpreter_flags(self): + # Test test.support.optim_args_from_interpreter_flags() + for opts in ( + # no option + [], + ['-O'], + ['-OO'], + ['-OOOO'], + ): + with self.subTest(opts=opts): + self.check_options(opts, 'optim_args_from_interpreter_flags') + def test_match_test(self): class Test: def __init__(self, test_id): @@ -485,7 +545,6 @@ def test_fd_count(self): # reap_threads # reap_children # strip_python_stderr - # args_from_interpreter_flags # can_symlink # skip_unless_symlink # SuppressCrashReport diff --git a/Misc/NEWS.d/next/Security/2018-11-23-15-00-23.bpo-34812.84VQnb.rst b/Misc/NEWS.d/next/Security/2018-11-23-15-00-23.bpo-34812.84VQnb.rst new file mode 100644 index 000000000000..860404f019d2 --- /dev/null +++ b/Misc/NEWS.d/next/Security/2018-11-23-15-00-23.bpo-34812.84VQnb.rst @@ -0,0 +1,4 @@ +The :option:`-I` command line option (run Python in isolated mode) is now +also copied by the :mod:`multiprocessing` and :mod:`distutils` modules when +spawning child processes. Previously, only :option:`-E` and :option:`-s` options +(enabled by :option:`-I`) were copied. From webhook-mailer at python.org Fri Nov 23 14:26:55 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Fri, 23 Nov 2018 19:26:55 -0000 Subject: [Python-checkins] bpo-35303: Fix a reference leak in _operator.c's methodcaller_repr(). (GH-10689) Message-ID: https://github.com/python/cpython/commit/5b83ef71d3060e1651d3680e805f13a1049c7d6d commit: 5b83ef71d3060e1651d3680e805f13a1049c7d6d branch: master author: Zackery Spytz committer: Serhiy Storchaka date: 2018-11-23T21:26:46+02:00 summary: bpo-35303: Fix a reference leak in _operator.c's methodcaller_repr(). (GH-10689) files: M Modules/_operator.c diff --git a/Modules/_operator.c b/Modules/_operator.c index dc678209ad3d..3bf8c1276d7b 100644 --- a/Modules/_operator.c +++ b/Modules/_operator.c @@ -1583,6 +1583,7 @@ methodcaller_repr(methodcallerobject *mc) goto done; if (i >= numtotalargs) { i = -1; + Py_DECREF(onerepr); break; } PyTuple_SET_ITEM(argreprs, i, onerepr); From webhook-mailer at python.org Fri Nov 23 14:58:12 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 23 Nov 2018 19:58:12 -0000 Subject: [Python-checkins] bpo-35303: Fix a reference leak in _operator.c's methodcaller_repr(). (GH-10689) Message-ID: https://github.com/python/cpython/commit/bc665b42ba3a372bc60451583bfaff41d8e1993d commit: bc665b42ba3a372bc60451583bfaff41d8e1993d branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-23T11:58:08-08:00 summary: bpo-35303: Fix a reference leak in _operator.c's methodcaller_repr(). (GH-10689) (cherry picked from commit 5b83ef71d3060e1651d3680e805f13a1049c7d6d) Co-authored-by: Zackery Spytz files: M Modules/_operator.c diff --git a/Modules/_operator.c b/Modules/_operator.c index f2fd65695f2e..51daa1ff6cfb 100644 --- a/Modules/_operator.c +++ b/Modules/_operator.c @@ -1583,6 +1583,7 @@ methodcaller_repr(methodcallerobject *mc) goto done; if (i >= numtotalargs) { i = -1; + Py_DECREF(onerepr); break; } PyTuple_SET_ITEM(argreprs, i, onerepr); From webhook-mailer at python.org Fri Nov 23 14:58:28 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 23 Nov 2018 19:58:28 -0000 Subject: [Python-checkins] bpo-35303: Fix a reference leak in _operator.c's methodcaller_repr(). (GH-10689) Message-ID: https://github.com/python/cpython/commit/8c70c08f0fb5795904442e95a2987ea18aed2899 commit: 8c70c08f0fb5795904442e95a2987ea18aed2899 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-23T11:58:25-08:00 summary: bpo-35303: Fix a reference leak in _operator.c's methodcaller_repr(). (GH-10689) (cherry picked from commit 5b83ef71d3060e1651d3680e805f13a1049c7d6d) Co-authored-by: Zackery Spytz files: M Modules/_operator.c diff --git a/Modules/_operator.c b/Modules/_operator.c index fb8eafc6793d..af05f1c296bd 100644 --- a/Modules/_operator.c +++ b/Modules/_operator.c @@ -1057,6 +1057,7 @@ methodcaller_repr(methodcallerobject *mc) goto done; if (i >= numtotalargs) { i = -1; + Py_DECREF(onerepr); break; } PyTuple_SET_ITEM(argreprs, i, onerepr); From solipsis at pitrou.net Sat Nov 24 04:11:37 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Sat, 24 Nov 2018 09:11:37 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=5 Message-ID: <20181124091137.1.55E9FF3D5AF718E9@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_fork leaked [-2, 1, 0] memory blocks, sum=-1 test_multiprocessing_spawn leaked [2, -1, 1] memory blocks, sum=2 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogC1D_fL', '--timeout', '7200'] From webhook-mailer at python.org Sat Nov 24 05:35:24 2018 From: webhook-mailer at python.org (Julien Palard) Date: Sat, 24 Nov 2018 10:35:24 -0000 Subject: [Python-checkins] Doc: Bump sphinx. (GH-10676) Message-ID: https://github.com/python/cpython/commit/7f4ba4afd47f21f61de9035544809fc67d136f35 commit: 7f4ba4afd47f21f61de9035544809fc67d136f35 branch: master author: Julien Palard committer: GitHub date: 2018-11-24T11:35:21+01:00 summary: Doc: Bump sphinx. (GH-10676) files: M .azure-pipelines/docs-steps.yml M .travis.yml diff --git a/.azure-pipelines/docs-steps.yml b/.azure-pipelines/docs-steps.yml index 460576cbc955..492e4e34bb2d 100644 --- a/.azure-pipelines/docs-steps.yml +++ b/.azure-pipelines/docs-steps.yml @@ -12,7 +12,7 @@ steps: inputs: versionSpec: '>=3.6' -- script: python -m pip install sphinx==1.8.1 blurb python-docs-theme +- script: python -m pip install sphinx==1.8.2 blurb python-docs-theme displayName: 'Install build dependencies' - ${{ if ne(parameters.latex, 'true') }}: diff --git a/.travis.yml b/.travis.yml index 41c0e0fd6aa1..ef3c2be5e580 100644 --- a/.travis.yml +++ b/.travis.yml @@ -54,7 +54,7 @@ matrix: # Sphinx is pinned so that new versions that introduce new warnings won't suddenly cause build failures. # (Updating the version is fine as long as no warnings are raised by doing so.) # The theme used by the docs is stored separately, so we need to install that as well. - - python -m pip install sphinx==1.8.1 blurb python-docs-theme + - python -m pip install sphinx==1.8.2 blurb python-docs-theme script: - make check suspicious html SPHINXOPTS="-q -W -j4" - os: osx From webhook-mailer at python.org Sun Nov 25 02:51:22 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sun, 25 Nov 2018 07:51:22 -0000 Subject: [Python-checkins] bpo-32035: Fix words about strings and bytes in zipfile documentation. (GH-10592) Message-ID: https://github.com/python/cpython/commit/4bb186d7e253ad4def875305e06690181e923dfd commit: 4bb186d7e253ad4def875305e06690181e923dfd branch: master author: Serhiy Storchaka committer: GitHub date: 2018-11-25T09:51:14+02:00 summary: bpo-32035: Fix words about strings and bytes in zipfile documentation. (GH-10592) files: M Doc/library/zipfile.rst M Lib/zipfile.py diff --git a/Doc/library/zipfile.rst b/Doc/library/zipfile.rst index 8d8612afa39b..1437730087a7 100644 --- a/Doc/library/zipfile.rst +++ b/Doc/library/zipfile.rst @@ -387,13 +387,6 @@ ZipFile Objects given. The archive must be open with mode ``'w'``, ``'x'`` or ``'a'``. - .. note:: - - There is no official file name encoding for ZIP files. If you have unicode file - names, you must convert them to byte strings in your desired encoding before - passing them to :meth:`write`. WinZip interprets all file names as encoded in - CP437, also known as DOS Latin. - .. note:: Archive names should be relative to the archive root, that is, they should not @@ -413,7 +406,9 @@ ZipFile Objects .. method:: ZipFile.writestr(zinfo_or_arcname, data, compress_type=None, \ compresslevel=None) - Write the string *data* to the archive; *zinfo_or_arcname* is either the file + Write a file into the archive. The contents is *data*, which may be either + a :class:`str` or a :class:`bytes` instance; if it is a :class:`str`, + it is encoded as UTF-8 first. *zinfo_or_arcname* is either the file name it will be given in the archive, or a :class:`ZipInfo` instance. If it's an instance, at least the filename, date, and time must be given. If it's a name, the date and time is set to the current date and time. @@ -454,11 +449,11 @@ The following data attributes are also available: .. attribute:: ZipFile.comment - The comment text associated with the ZIP file. If assigning a comment to a + The comment associated with the ZIP file as a :class:`bytes` object. + If assigning a comment to a :class:`ZipFile` instance created with mode ``'w'``, ``'x'`` or ``'a'``, - this should be a - string no longer than 65535 bytes. Comments longer than this will be - truncated in the written archive when :meth:`close` is called. + it should be no longer than 65535 bytes. Comments longer than this will be + truncated. .. _pyzipfile-objects: @@ -625,13 +620,14 @@ Instances have the following methods and attributes: .. attribute:: ZipInfo.comment - Comment for the individual archive member. + Comment for the individual archive member as a :class:`bytes` object. .. attribute:: ZipInfo.extra Expansion field data. The `PKZIP Application Note`_ contains - some comments on the internal structure of the data contained in this string. + some comments on the internal structure of the data contained in this + :class:`bytes` object. .. attribute:: ZipInfo.create_system diff --git a/Lib/zipfile.py b/Lib/zipfile.py index 4a6b40ee441c..dc16f6d464fd 100644 --- a/Lib/zipfile.py +++ b/Lib/zipfile.py @@ -402,7 +402,7 @@ def __repr__(self): return ''.join(result) def FileHeader(self, zip64=None): - """Return the per-file header as a string.""" + """Return the per-file header as a bytes object.""" dt = self.date_time dosdate = (dt[0] - 1980) << 9 | dt[1] << 5 | dt[2] dostime = dt[3] << 11 | dt[4] << 5 | (dt[5] // 2) @@ -1429,7 +1429,7 @@ def comment(self, comment): self._didModify = True def read(self, name, pwd=None): - """Return file bytes (as a string) for name.""" + """Return file bytes for name.""" with self.open(name, "r", pwd) as fp: return fp.read() From solipsis at pitrou.net Sun Nov 25 04:06:39 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Sun, 25 Nov 2018 09:06:39 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=-2 Message-ID: <20181125090639.1.62FE9C10E4BA2100@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [-7, 1, 0] memory blocks, sum=-6 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_forkserver leaked [-2, 2, 0] memory blocks, sum=0 test_multiprocessing_spawn leaked [0, -2, 2] memory blocks, sum=0 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflog9N0uMw', '--timeout', '7200'] From webhook-mailer at python.org Sun Nov 25 04:30:50 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sun, 25 Nov 2018 09:30:50 -0000 Subject: [Python-checkins] bpo-32035: Fix words about strings and bytes in zipfile documentation. (GH-10592) Message-ID: https://github.com/python/cpython/commit/af009fbcdb00fffced653792eb7af6b72f2521e3 commit: af009fbcdb00fffced653792eb7af6b72f2521e3 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-25T01:30:45-08:00 summary: bpo-32035: Fix words about strings and bytes in zipfile documentation. (GH-10592) (cherry picked from commit 4bb186d7e253ad4def875305e06690181e923dfd) Co-authored-by: Serhiy Storchaka files: M Doc/library/zipfile.rst M Lib/zipfile.py diff --git a/Doc/library/zipfile.rst b/Doc/library/zipfile.rst index b7563f662ddb..b65b61d8dad8 100644 --- a/Doc/library/zipfile.rst +++ b/Doc/library/zipfile.rst @@ -360,13 +360,6 @@ ZipFile Objects the new entry. The archive must be open with mode ``'w'``, ``'x'`` or ``'a'``. - .. note:: - - There is no official file name encoding for ZIP files. If you have unicode file - names, you must convert them to byte strings in your desired encoding before - passing them to :meth:`write`. WinZip interprets all file names as encoded in - CP437, also known as DOS Latin. - .. note:: Archive names should be relative to the archive root, that is, they should not @@ -385,7 +378,9 @@ ZipFile Objects .. method:: ZipFile.writestr(zinfo_or_arcname, data[, compress_type]) - Write the string *data* to the archive; *zinfo_or_arcname* is either the file + Write a file into the archive. The contents is *data*, which may be either + a :class:`str` or a :class:`bytes` instance; if it is a :class:`str`, + it is encoded as UTF-8 first. *zinfo_or_arcname* is either the file name it will be given in the archive, or a :class:`ZipInfo` instance. If it's an instance, at least the filename, date, and time must be given. If it's a name, the date and time is set to the current date and time. @@ -425,11 +420,11 @@ The following data attributes are also available: .. attribute:: ZipFile.comment - The comment text associated with the ZIP file. If assigning a comment to a + The comment associated with the ZIP file as a :class:`bytes` object. + If assigning a comment to a :class:`ZipFile` instance created with mode ``'w'``, ``'x'`` or ``'a'``, - this should be a - string no longer than 65535 bytes. Comments longer than this will be - truncated in the written archive when :meth:`close` is called. + it should be no longer than 65535 bytes. Comments longer than this will be + truncated. .. _pyzipfile-objects: @@ -583,13 +578,14 @@ Instances have the following methods and attributes: .. attribute:: ZipInfo.comment - Comment for the individual archive member. + Comment for the individual archive member as a :class:`bytes` object. .. attribute:: ZipInfo.extra Expansion field data. The `PKZIP Application Note`_ contains - some comments on the internal structure of the data contained in this string. + some comments on the internal structure of the data contained in this + :class:`bytes` object. .. attribute:: ZipInfo.create_system diff --git a/Lib/zipfile.py b/Lib/zipfile.py index 5bb35870a689..edde0c5fd4a5 100644 --- a/Lib/zipfile.py +++ b/Lib/zipfile.py @@ -405,7 +405,7 @@ def __repr__(self): return ''.join(result) def FileHeader(self, zip64=None): - """Return the per-file header as a string.""" + """Return the per-file header as a bytes object.""" dt = self.date_time dosdate = (dt[0] - 1980) << 9 | dt[1] << 5 | dt[2] dostime = dt[3] << 11 | dt[4] << 5 | (dt[5] // 2) @@ -1333,7 +1333,7 @@ def comment(self, comment): self._didModify = True def read(self, name, pwd=None): - """Return file bytes (as a string) for name.""" + """Return file bytes for name.""" with self.open(name, "r", pwd) as fp: return fp.read() From webhook-mailer at python.org Sun Nov 25 04:30:50 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sun, 25 Nov 2018 09:30:50 -0000 Subject: [Python-checkins] bpo-32035: Fix words about strings and bytes in zipfile documentation. (GH-10592) Message-ID: https://github.com/python/cpython/commit/89a3087d40feed3ca78033319389437bb4b5bcd7 commit: 89a3087d40feed3ca78033319389437bb4b5bcd7 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-25T01:30:37-08:00 summary: bpo-32035: Fix words about strings and bytes in zipfile documentation. (GH-10592) (cherry picked from commit 4bb186d7e253ad4def875305e06690181e923dfd) Co-authored-by: Serhiy Storchaka files: M Doc/library/zipfile.rst M Lib/zipfile.py diff --git a/Doc/library/zipfile.rst b/Doc/library/zipfile.rst index 7804e92e5374..e1f8b9a4a32a 100644 --- a/Doc/library/zipfile.rst +++ b/Doc/library/zipfile.rst @@ -378,13 +378,6 @@ ZipFile Objects given. The archive must be open with mode ``'w'``, ``'x'`` or ``'a'``. - .. note:: - - There is no official file name encoding for ZIP files. If you have unicode file - names, you must convert them to byte strings in your desired encoding before - passing them to :meth:`write`. WinZip interprets all file names as encoded in - CP437, also known as DOS Latin. - .. note:: Archive names should be relative to the archive root, that is, they should not @@ -404,7 +397,9 @@ ZipFile Objects .. method:: ZipFile.writestr(zinfo_or_arcname, data, compress_type=None, \ compresslevel=None) - Write the string *data* to the archive; *zinfo_or_arcname* is either the file + Write a file into the archive. The contents is *data*, which may be either + a :class:`str` or a :class:`bytes` instance; if it is a :class:`str`, + it is encoded as UTF-8 first. *zinfo_or_arcname* is either the file name it will be given in the archive, or a :class:`ZipInfo` instance. If it's an instance, at least the filename, date, and time must be given. If it's a name, the date and time is set to the current date and time. @@ -445,11 +440,11 @@ The following data attributes are also available: .. attribute:: ZipFile.comment - The comment text associated with the ZIP file. If assigning a comment to a + The comment associated with the ZIP file as a :class:`bytes` object. + If assigning a comment to a :class:`ZipFile` instance created with mode ``'w'``, ``'x'`` or ``'a'``, - this should be a - string no longer than 65535 bytes. Comments longer than this will be - truncated in the written archive when :meth:`close` is called. + it should be no longer than 65535 bytes. Comments longer than this will be + truncated. .. _pyzipfile-objects: @@ -606,13 +601,14 @@ Instances have the following methods and attributes: .. attribute:: ZipInfo.comment - Comment for the individual archive member. + Comment for the individual archive member as a :class:`bytes` object. .. attribute:: ZipInfo.extra Expansion field data. The `PKZIP Application Note`_ contains - some comments on the internal structure of the data contained in this string. + some comments on the internal structure of the data contained in this + :class:`bytes` object. .. attribute:: ZipInfo.create_system diff --git a/Lib/zipfile.py b/Lib/zipfile.py index a43878575db8..d2d3b693282d 100644 --- a/Lib/zipfile.py +++ b/Lib/zipfile.py @@ -402,7 +402,7 @@ def __repr__(self): return ''.join(result) def FileHeader(self, zip64=None): - """Return the per-file header as a string.""" + """Return the per-file header as a bytes object.""" dt = self.date_time dosdate = (dt[0] - 1980) << 9 | dt[1] << 5 | dt[2] dostime = dt[3] << 11 | dt[4] << 5 | (dt[5] // 2) @@ -1424,7 +1424,7 @@ def comment(self, comment): self._didModify = True def read(self, name, pwd=None): - """Return file bytes (as a string) for name.""" + """Return file bytes for name.""" with self.open(name, "r", pwd) as fp: return fp.read() From webhook-mailer at python.org Sun Nov 25 13:32:53 2018 From: webhook-mailer at python.org (Benjamin Peterson) Date: Sun, 25 Nov 2018 18:32:53 -0000 Subject: [Python-checkins] closes bpo-35309: cpath should be capath (GH-10699) Message-ID: https://github.com/python/cpython/commit/158695817d736df8b18682866033c87e46252309 commit: 158695817d736df8b18682866033c87e46252309 branch: master author: Bo?tjan Mejak committer: Benjamin Peterson date: 2018-11-25T12:32:50-06:00 summary: closes bpo-35309: cpath should be capath (GH-10699) files: M Lib/urllib/request.py diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index 9d50b688a3a5..9a3d399f0189 100644 --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -198,7 +198,7 @@ def urlopen(url, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT, global _opener if cafile or capath or cadefault: import warnings - warnings.warn("cafile, cpath and cadefault are deprecated, use a " + warnings.warn("cafile, capath and cadefault are deprecated, use a " "custom context instead.", DeprecationWarning, 2) if context is not None: raise ValueError( From webhook-mailer at python.org Sun Nov 25 15:50:51 2018 From: webhook-mailer at python.org (Benjamin Peterson) Date: Sun, 25 Nov 2018 20:50:51 -0000 Subject: [Python-checkins] closes bpo-35309: cpath should be capath (GH-10702) Message-ID: https://github.com/python/cpython/commit/8c1592e53a8981451f59050198da34a584160b4e commit: 8c1592e53a8981451f59050198da34a584160b4e branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Benjamin Peterson date: 2018-11-25T14:50:46-06:00 summary: closes bpo-35309: cpath should be capath (GH-10702) (cherry picked from commit 158695817d736df8b18682866033c87e46252309) Co-authored-by: Bo?tjan Mejak files: M Lib/urllib/request.py diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index 96921440edea..d28f2f8369c7 100644 --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -199,7 +199,7 @@ def urlopen(url, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT, global _opener if cafile or capath or cadefault: import warnings - warnings.warn("cafile, cpath and cadefault are deprecated, use a " + warnings.warn("cafile, capath and cadefault are deprecated, use a " "custom context instead.", DeprecationWarning, 2) if context is not None: raise ValueError( From webhook-mailer at python.org Sun Nov 25 15:51:05 2018 From: webhook-mailer at python.org (Benjamin Peterson) Date: Sun, 25 Nov 2018 20:51:05 -0000 Subject: [Python-checkins] closes bpo-35309: cpath should be capath (GH-10701) Message-ID: https://github.com/python/cpython/commit/6a528ccb4c09933c434be1011b2f5e148170d3a1 commit: 6a528ccb4c09933c434be1011b2f5e148170d3a1 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Benjamin Peterson date: 2018-11-25T14:51:02-06:00 summary: closes bpo-35309: cpath should be capath (GH-10701) (cherry picked from commit 158695817d736df8b18682866033c87e46252309) Co-authored-by: Bo?tjan Mejak files: M Lib/urllib/request.py diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index 5b962f7dc20b..d38f725d8e9f 100644 --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -198,7 +198,7 @@ def urlopen(url, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT, global _opener if cafile or capath or cadefault: import warnings - warnings.warn("cafile, cpath and cadefault are deprecated, use a " + warnings.warn("cafile, capath and cadefault are deprecated, use a " "custom context instead.", DeprecationWarning, 2) if context is not None: raise ValueError( From webhook-mailer at python.org Sun Nov 25 17:30:35 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Sun, 25 Nov 2018 22:30:35 -0000 Subject: [Python-checkins] bpo-35081: Add _PyTuple_CAST() (GH-10704) Message-ID: https://github.com/python/cpython/commit/8ac6539d85b481fc6b5e9145446b07e591b2caba commit: 8ac6539d85b481fc6b5e9145446b07e591b2caba branch: master author: Victor Stinner committer: GitHub date: 2018-11-25T23:30:32+01:00 summary: bpo-35081: Add _PyTuple_CAST() (GH-10704) files: M Include/tupleobject.h diff --git a/Include/tupleobject.h b/Include/tupleobject.h index 257e05aeae8f..a150d07d3e0a 100644 --- a/Include/tupleobject.h +++ b/Include/tupleobject.h @@ -55,15 +55,18 @@ PyAPI_FUNC(void) _PyTuple_MaybeUntrack(PyObject *); /* Macro, trading safety for speed */ #ifndef Py_LIMITED_API -#define PyTuple_GET_ITEM(op, i) (((PyTupleObject *)(op))->ob_item[i]) -#define PyTuple_GET_SIZE(op) (assert(PyTuple_Check(op)),Py_SIZE(op)) +/* Cast argument to PyTupleObject* type. */ +#define _PyTuple_CAST(op) ((PyTupleObject *)(op)) + +#define PyTuple_GET_ITEM(op, i) (_PyTuple_CAST(op)->ob_item[i]) +#define PyTuple_GET_SIZE(op) (assert(PyTuple_Check(op)), Py_SIZE(op)) #ifdef Py_BUILD_CORE -# define _PyTuple_ITEMS(op) ((((PyTupleObject *)(op))->ob_item)) +# define _PyTuple_ITEMS(op) (_PyTuple_CAST(op)->ob_item) #endif /* Macro, *only* to be used to fill in brand new tuples */ -#define PyTuple_SET_ITEM(op, i, v) (((PyTupleObject *)(op))->ob_item[i] = v) +#define PyTuple_SET_ITEM(op, i, v) (_PyTuple_CAST(op)->ob_item[i] = v) #endif PyAPI_FUNC(int) PyTuple_ClearFreeList(void); From webhook-mailer at python.org Sun Nov 25 17:56:21 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Sun, 25 Nov 2018 22:56:21 -0000 Subject: [Python-checkins] bpo-35081: Add Include/internal/pycore_tupleobject.h (GH-10705) Message-ID: https://github.com/python/cpython/commit/ec13b9322d95a651606219469fc7b7e9c977f248 commit: ec13b9322d95a651606219469fc7b7e9c977f248 branch: master author: Victor Stinner committer: GitHub date: 2018-11-25T23:56:17+01:00 summary: bpo-35081: Add Include/internal/pycore_tupleobject.h (GH-10705) Move _PyTuple_ITEMS() to a new header file: Include/internal/pycore_tupleobject.h files: A Include/internal/pycore_tupleobject.h M Include/tupleobject.h M Makefile.pre.in M Modules/_functoolsmodule.c M Objects/call.c M Objects/codeobject.c M Objects/descrobject.c M Objects/funcobject.c M PCbuild/pythoncore.vcxproj M PCbuild/pythoncore.vcxproj.filters M Python/ceval.c M Python/getargs.c diff --git a/Include/internal/pycore_tupleobject.h b/Include/internal/pycore_tupleobject.h new file mode 100644 index 000000000000..fdd741467665 --- /dev/null +++ b/Include/internal/pycore_tupleobject.h @@ -0,0 +1,18 @@ +#ifndef Py_INTERNAL_TUPLEOBJECT_H +#define Py_INTERNAL_TUPLEOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN) +# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN define" +#endif + +#include "tupleobject.h" + +#define _PyTuple_ITEMS(op) (_PyTuple_CAST(op)->ob_item) + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_TUPLEOBJECT_H */ diff --git a/Include/tupleobject.h b/Include/tupleobject.h index a150d07d3e0a..eec2d98f2d95 100644 --- a/Include/tupleobject.h +++ b/Include/tupleobject.h @@ -61,10 +61,6 @@ PyAPI_FUNC(void) _PyTuple_MaybeUntrack(PyObject *); #define PyTuple_GET_ITEM(op, i) (_PyTuple_CAST(op)->ob_item[i]) #define PyTuple_GET_SIZE(op) (assert(PyTuple_Check(op)), Py_SIZE(op)) -#ifdef Py_BUILD_CORE -# define _PyTuple_ITEMS(op) (_PyTuple_CAST(op)->ob_item) -#endif - /* Macro, *only* to be used to fill in brand new tuples */ #define PyTuple_SET_ITEM(op, i, v) (_PyTuple_CAST(op)->ob_item[i] = v) #endif diff --git a/Makefile.pre.in b/Makefile.pre.in index d0e915a00ae0..2c92db23489e 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1043,6 +1043,7 @@ PYTHON_HEADERS= \ $(srcdir)/Include/internal/pycore_pylifecycle.h \ $(srcdir)/Include/internal/pycore_pymem.h \ $(srcdir)/Include/internal/pycore_pystate.h \ + $(srcdir)/Include/internal/pycore_tupleobject.h \ $(srcdir)/Include/internal/pycore_warnings.h \ $(DTRACE_HEADERS) diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c index 773102bb5900..8701f6c89d71 100644 --- a/Modules/_functoolsmodule.c +++ b/Modules/_functoolsmodule.c @@ -1,7 +1,7 @@ - #include "Python.h" #include "pycore_pymem.h" #include "pycore_pystate.h" +#include "pycore_tupleobject.h" #include "structmember.h" /* _functools module written and maintained diff --git a/Objects/call.c b/Objects/call.c index ce346c293486..ba2ddcb35b9b 100644 --- a/Objects/call.c +++ b/Objects/call.c @@ -1,6 +1,7 @@ #include "Python.h" #include "pycore_object.h" #include "pycore_pystate.h" +#include "pycore_tupleobject.h" #include "frameobject.h" diff --git a/Objects/codeobject.c b/Objects/codeobject.c index a2efa7ed03f5..09182d61c244 100644 --- a/Objects/codeobject.c +++ b/Objects/codeobject.c @@ -4,6 +4,7 @@ #include "code.h" #include "structmember.h" #include "pycore_pystate.h" +#include "pycore_tupleobject.h" /* Holder for co_extra information */ typedef struct { diff --git a/Objects/descrobject.c b/Objects/descrobject.c index dd3c5014aea7..23d4b1a29e6f 100644 --- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -3,6 +3,7 @@ #include "Python.h" #include "pycore_object.h" #include "pycore_pystate.h" +#include "pycore_tupleobject.h" #include "structmember.h" /* Why is this not included in Python.h? */ /*[clinic input] diff --git a/Objects/funcobject.c b/Objects/funcobject.c index 982df5434d25..c77e4e9f4e89 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c @@ -5,6 +5,7 @@ #include "pycore_object.h" #include "pycore_pymem.h" #include "pycore_pystate.h" +#include "pycore_tupleobject.h" #include "code.h" #include "structmember.h" diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index 34cd3796888c..8aa4c0610f60 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -127,6 +127,7 @@ + diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters index ebe5e8a169fd..021a67efccbc 100644 --- a/PCbuild/pythoncore.vcxproj.filters +++ b/PCbuild/pythoncore.vcxproj.filters @@ -180,6 +180,9 @@ Include + + Include + Include diff --git a/Python/ceval.c b/Python/ceval.c index 7b2465592a4b..a4273adee48d 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -12,6 +12,7 @@ #include "Python.h" #include "pycore_object.h" #include "pycore_pystate.h" +#include "pycore_tupleobject.h" #include "code.h" #include "dictobject.h" diff --git a/Python/getargs.c b/Python/getargs.c index 89df29e31527..ac8bac3bf50b 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -2,6 +2,7 @@ /* New getargs implementation */ #include "Python.h" +#include "pycore_tupleobject.h" #include #include From webhook-mailer at python.org Sun Nov 25 19:24:55 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 26 Nov 2018 00:24:55 -0000 Subject: [Python-checkins] bpo-35300: Add usage note to the lru_cache() docs (GH-10707) Message-ID: https://github.com/python/cpython/commit/f0e0f2008d160cdd7e5bc02ea61c43f8c7b2b82f commit: f0e0f2008d160cdd7e5bc02ea61c43f8c7b2b82f branch: master author: Raymond Hettinger committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-11-25T16:24:52-08:00 summary: bpo-35300: Add usage note to the lru_cache() docs (GH-10707) https://bugs.python.org/issue35300 files: M Doc/library/functools.rst diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst index 40abdc24883c..cd59e5bebfd5 100644 --- a/Doc/library/functools.rst +++ b/Doc/library/functools.rst @@ -118,6 +118,11 @@ The :mod:`functools` module defines the following functions: The cache's size limit assures that the cache does not grow without bound on long-running processes such as web servers. + In general, the LRU cache should only be used when you want to reuse + previously computed values. Accordingly, it doesn't make sense to cache + functions with side-effects, functions that need to create distinct mutable + objects on each call, or impure functions such as time() or random(). + Example of an LRU cache for static web content:: @lru_cache(maxsize=32) From webhook-mailer at python.org Sun Nov 25 20:00:45 2018 From: webhook-mailer at python.org (Raymond Hettinger) Date: Mon, 26 Nov 2018 01:00:45 -0000 Subject: [Python-checkins] bpo-35300: Add usage note to the lru_cache() docs (GH-10707) (GH-10708) Message-ID: https://github.com/python/cpython/commit/c7074007272f257a0efab76f03e6b400c30a51b4 commit: c7074007272f257a0efab76f03e6b400c30a51b4 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Raymond Hettinger date: 2018-11-25T17:00:37-08:00 summary: bpo-35300: Add usage note to the lru_cache() docs (GH-10707) (GH-10708) files: M Doc/library/functools.rst diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst index 8924593464f9..d19373bb493d 100644 --- a/Doc/library/functools.rst +++ b/Doc/library/functools.rst @@ -85,6 +85,11 @@ The :mod:`functools` module defines the following functions: The cache's size limit assures that the cache does not grow without bound on long-running processes such as web servers. + In general, the LRU cache should only be used when you want to reuse + previously computed values. Accordingly, it doesn't make sense to cache + functions with side-effects, functions that need to create distinct mutable + objects on each call, or impure functions such as time() or random(). + Example of an LRU cache for static web content:: @lru_cache(maxsize=32) From webhook-mailer at python.org Sun Nov 25 20:01:12 2018 From: webhook-mailer at python.org (Raymond Hettinger) Date: Mon, 26 Nov 2018 01:01:12 -0000 Subject: [Python-checkins] bpo-35300: Add usage note to the lru_cache() docs (GH-10707) (GH-10709) Message-ID: https://github.com/python/cpython/commit/6c12091ca67e8ec2960652ef7a763d0de772f799 commit: 6c12091ca67e8ec2960652ef7a763d0de772f799 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Raymond Hettinger date: 2018-11-25T17:01:09-08:00 summary: bpo-35300: Add usage note to the lru_cache() docs (GH-10707) (GH-10709) files: M Doc/library/functools.rst diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst index b221a8584a12..41c06c647b78 100644 --- a/Doc/library/functools.rst +++ b/Doc/library/functools.rst @@ -80,6 +80,11 @@ The :mod:`functools` module defines the following functions: The cache's size limit assures that the cache does not grow without bound on long-running processes such as web servers. + In general, the LRU cache should only be used when you want to reuse + previously computed values. Accordingly, it doesn't make sense to cache + functions with side-effects, functions that need to create distinct mutable + objects on each call, or impure functions such as time() or random(). + Example of an LRU cache for static web content:: @lru_cache(maxsize=32) From solipsis at pitrou.net Mon Nov 26 04:06:51 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Mon, 26 Nov 2018 09:06:51 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=-4 Message-ID: <20181126090651.1.2D853472CE71BC6D@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [-7, 8, -7] memory blocks, sum=-6 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_spawn leaked [0, 0, -2] memory blocks, sum=-2 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflog52Er_A', '--timeout', '7200'] From webhook-mailer at python.org Mon Nov 26 05:54:17 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 26 Nov 2018 10:54:17 -0000 Subject: [Python-checkins] bpo-35313: Fix test_embed when run from venv (GH-10713) Message-ID: https://github.com/python/cpython/commit/a6537fb7c2f7a007b4ab616c4617afd56d18347d commit: a6537fb7c2f7a007b4ab616c4617afd56d18347d branch: master author: Victor Stinner committer: GitHub date: 2018-11-26T11:54:12+01:00 summary: bpo-35313: Fix test_embed when run from venv (GH-10713) test_embed.InitConfigTests now gets the expected configuration from a child process run with -S to not run the site module. files: M Lib/test/test_embed.py diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py index 3f383d7fd50c..b6c25e3f7eda 100644 --- a/Lib/test/test_embed.py +++ b/Lib/test/test_embed.py @@ -9,6 +9,7 @@ import re import subprocess import sys +import textwrap MS_WINDOWS = (os.name == 'nt') @@ -265,6 +266,8 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): 'executable', 'module_search_paths', ) + # Mark config which should be get by get_default_config() + GET_DEFAULT_CONFIG = object() DEFAULT_CORE_CONFIG = { 'install_signal_handlers': 1, 'use_environment': 1, @@ -280,9 +283,8 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): 'dump_refs': 0, 'malloc_stats': 0, - # None means that the value is get by get_locale_encoding() - 'filesystem_encoding': None, - 'filesystem_errors': None, + 'filesystem_encoding': GET_DEFAULT_CONFIG, + 'filesystem_errors': GET_DEFAULT_CONFIG, 'utf8_mode': 0, 'coerce_c_locale': 0, @@ -298,10 +300,11 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): 'module_search_path_env': None, 'home': None, - 'prefix': sys.prefix, - 'base_prefix': sys.base_prefix, - 'exec_prefix': sys.exec_prefix, - 'base_exec_prefix': sys.base_exec_prefix, + + 'prefix': GET_DEFAULT_CONFIG, + 'base_prefix': GET_DEFAULT_CONFIG, + 'exec_prefix': GET_DEFAULT_CONFIG, + 'base_exec_prefix': GET_DEFAULT_CONFIG, 'isolated': 0, 'site_import': 1, @@ -316,9 +319,8 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): 'user_site_directory': 1, 'buffered_stdio': 1, - # None means that the value is get by get_stdio_encoding() - 'stdio_encoding': None, - 'stdio_errors': None, + 'stdio_encoding': GET_DEFAULT_CONFIG, + 'stdio_errors': GET_DEFAULT_CONFIG, '_install_importlib': 1, '_check_hash_pycs_mode': 'default', @@ -379,35 +381,6 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): ('Py_LegacyWindowsStdioFlag', 'legacy_windows_stdio'), )) - def get_stdio_encoding(self, env): - code = 'import sys; print(sys.stdout.encoding, sys.stdout.errors)' - args = (sys.executable, '-c', code) - proc = subprocess.run(args, env=env, text=True, - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) - if proc.returncode: - raise Exception(f"failed to get the stdio encoding: stdout={proc.stdout!r}") - out = proc.stdout.rstrip() - return out.split() - - def get_filesystem_encoding(self, isolated, env): - code = ('import codecs, locale, sys; ' - 'print(sys.getfilesystemencoding(), ' - 'sys.getfilesystemencodeerrors())') - args = (sys.executable, '-c', code) - env = dict(env) - if not isolated: - env['PYTHONCOERCECLOCALE'] = '0' - env['PYTHONUTF8'] = '0' - proc = subprocess.run(args, text=True, env=env, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - if proc.returncode: - raise Exception(f"failed to get the locale encoding: " - f"stdout={proc.stdout!r} stderr={proc.stderr!r}") - out = proc.stdout.rstrip() - return out.split() - def main_xoptions(self, xoptions_list): xoptions = {} for opt in xoptions_list: @@ -423,27 +396,61 @@ def check_main_config(self, config): main_config = config['main_config'] # main config - expected_main = {} + expected = {} for key in self.COPY_MAIN_CONFIG: - expected_main[key] = core_config[key] - expected_main['module_search_path'] = core_config['module_search_paths'] - expected_main['xoptions'] = self.main_xoptions(core_config['xoptions']) - self.assertEqual(main_config, expected_main) + expected[key] = core_config[key] + expected['module_search_path'] = core_config['module_search_paths'] + expected['xoptions'] = self.main_xoptions(core_config['xoptions']) + self.assertEqual(main_config, expected) - def check_core_config(self, config, expected, env): - if expected['stdio_encoding'] is None or expected['stdio_errors'] is None: - res = self.get_stdio_encoding(env) - if expected['stdio_encoding'] is None: - expected['stdio_encoding'] = res[0] - if expected['stdio_errors'] is None: - expected['stdio_errors'] = res[1] - if expected['filesystem_encoding'] is None or expected['filesystem_errors'] is None: - res = self.get_filesystem_encoding(expected['isolated'], env) - if expected['filesystem_encoding'] is None: - expected['filesystem_encoding'] = res[0] - if expected['filesystem_errors'] is None: - expected['filesystem_errors'] = res[1] + def get_expected_config(self, expected, env): + expected = dict(self.DEFAULT_CORE_CONFIG, **expected) + code = textwrap.dedent(''' + import json + import locale + import sys + + data = { + 'stdio_encoding': sys.stdout.encoding, + 'stdio_errors': sys.stdout.errors, + 'prefix': sys.prefix, + 'base_prefix': sys.base_prefix, + 'exec_prefix': sys.exec_prefix, + 'base_exec_prefix': sys.base_exec_prefix, + 'filesystem_encoding': sys.getfilesystemencoding(), + 'filesystem_errors': sys.getfilesystemencodeerrors(), + } + + data = json.dumps(data) + data = data.encode('utf-8') + sys.stdout.buffer.write(data) + sys.stdout.buffer.flush() + ''') + + # Use -S to not import the site module: get the proper configuration + # when test_embed is run from a venv (bpo-35313) + args = (sys.executable, '-S', '-c', code) + env = dict(env) + if not expected['isolated']: + env['PYTHONCOERCECLOCALE'] = '0' + env['PYTHONUTF8'] = '0' + proc = subprocess.run(args, env=env, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT) + if proc.returncode: + raise Exception(f"failed to get the default config: " + f"stdout={proc.stdout!r} stderr={proc.stderr!r}") + stdout = proc.stdout.decode('utf-8') + config = json.loads(stdout) + + for key, value in expected.items(): + if value is self.GET_DEFAULT_CONFIG: + expected[key] = config[key] + return expected + + def check_core_config(self, config, expected, env): + expected = self.get_expected_config(expected, env) core_config = dict(config['core_config']) for key in self.UNTESTED_CORE_CONFIG: core_config.pop(key, None) @@ -452,20 +459,18 @@ def check_core_config(self, config, expected, env): def check_global_config(self, config): core_config = config['core_config'] - expected_global = dict(self.DEFAULT_GLOBAL_CONFIG) + expected = dict(self.DEFAULT_GLOBAL_CONFIG) for item in self.COPY_GLOBAL_CONFIG: if len(item) == 3: global_key, core_key, opposite = item - expected_global[global_key] = 0 if core_config[core_key] else 1 + expected[global_key] = 0 if core_config[core_key] else 1 else: global_key, core_key = item - expected_global[global_key] = core_config[core_key] + expected[global_key] = core_config[core_key] - self.assertEqual(config['global_config'], expected_global) + self.assertEqual(config['global_config'], expected) def check_config(self, testname, expected): - expected = dict(self.DEFAULT_CORE_CONFIG, **expected) - env = dict(os.environ) # Remove PYTHON* environment variables to get deterministic environment for key in list(env): From webhook-mailer at python.org Mon Nov 26 06:37:38 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 26 Nov 2018 11:37:38 -0000 Subject: [Python-checkins] bpo-35313: Cleanup test_embed.py (GH-10716) Message-ID: https://github.com/python/cpython/commit/f0b366a8d7e0f12d4448f570e990de414f4afca7 commit: f0b366a8d7e0f12d4448f570e990de414f4afca7 branch: master author: Victor Stinner committer: GitHub date: 2018-11-26T12:37:34+01:00 summary: bpo-35313: Cleanup test_embed.py (GH-10716) * Remove an unused import. * Move get_expected_config() call to check_config() to ease backport to Python 3.7. files: M Lib/test/test_embed.py diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py index b6c25e3f7eda..d35b9f4d5a2f 100644 --- a/Lib/test/test_embed.py +++ b/Lib/test/test_embed.py @@ -408,7 +408,6 @@ def get_expected_config(self, expected, env): code = textwrap.dedent(''' import json - import locale import sys data = { @@ -449,8 +448,7 @@ def get_expected_config(self, expected, env): expected[key] = config[key] return expected - def check_core_config(self, config, expected, env): - expected = self.get_expected_config(expected, env) + def check_core_config(self, config, expected): core_config = dict(config['core_config']) for key in self.UNTESTED_CORE_CONFIG: core_config.pop(key, None) @@ -485,7 +483,8 @@ def check_config(self, testname, expected): # Ignore err config = json.loads(out) - self.check_core_config(config, expected, env) + expected = self.get_expected_config(expected, env) + self.check_core_config(config, expected) self.check_main_config(config) self.check_global_config(config) From webhook-mailer at python.org Mon Nov 26 06:42:09 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 26 Nov 2018 11:42:09 -0000 Subject: [Python-checkins] bpo-35313: Fix test_embed when run from venv (GH-10713) (GH-10715) Message-ID: https://github.com/python/cpython/commit/e88553c3742507ba83590ecca44ae7f134f38410 commit: e88553c3742507ba83590ecca44ae7f134f38410 branch: 3.7 author: Victor Stinner committer: GitHub date: 2018-11-26T12:42:06+01:00 summary: bpo-35313: Fix test_embed when run from venv (GH-10713) (GH-10715) test_embed.InitConfigTests now gets the expected configuration from a child process run with -S to not run the site module. (cherry picked from commit a6537fb7c2f7a007b4ab616c4617afd56d18347d) files: M Lib/test/test_embed.py diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py index 11f37f06da9c..de3c30340c6d 100644 --- a/Lib/test/test_embed.py +++ b/Lib/test/test_embed.py @@ -8,6 +8,7 @@ import re import subprocess import sys +import textwrap MS_WINDOWS = (os.name == 'nt') @@ -264,6 +265,8 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): 'executable', 'module_search_paths', ) + # Mark config which should be get by get_default_config() + GET_DEFAULT_CONFIG = object() DEFAULT_CORE_CONFIG = { 'install_signal_handlers': 1, 'ignore_environment': 0, @@ -292,10 +295,11 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): 'module_search_path_env': None, 'home': None, - 'prefix': sys.prefix, - 'base_prefix': sys.base_prefix, - 'exec_prefix': sys.exec_prefix, - 'base_exec_prefix': sys.base_exec_prefix, + + 'prefix': GET_DEFAULT_CONFIG, + 'base_prefix': GET_DEFAULT_CONFIG, + 'exec_prefix': GET_DEFAULT_CONFIG, + 'base_exec_prefix': GET_DEFAULT_CONFIG, '_disable_importlib': 0, } @@ -329,9 +333,8 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): 'Py_BytesWarningFlag': 0, 'Py_DebugFlag': 0, 'Py_DontWriteBytecodeFlag': 0, - # None means that the value is get by get_filesystem_encoding() - 'Py_FileSystemDefaultEncodeErrors': None, - 'Py_FileSystemDefaultEncoding': None, + 'Py_FileSystemDefaultEncodeErrors': GET_DEFAULT_CONFIG, + 'Py_FileSystemDefaultEncoding': GET_DEFAULT_CONFIG, 'Py_FrozenFlag': 0, 'Py_HashRandomizationFlag': 1, 'Py_InspectFlag': 0, @@ -356,24 +359,6 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): ('Py_UTF8Mode', 'utf8_mode'), ] - def get_filesystem_encoding(self, isolated, env): - code = ('import codecs, locale, sys; ' - 'print(sys.getfilesystemencoding(), ' - 'sys.getfilesystemencodeerrors())') - args = (sys.executable, '-c', code) - env = dict(env) - if not isolated: - env['PYTHONCOERCECLOCALE'] = '0' - env['PYTHONUTF8'] = '0' - proc = subprocess.run(args, text=True, env=env, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - if proc.returncode: - raise Exception(f"failed to get the locale encoding: " - f"stdout={proc.stdout!r} stderr={proc.stderr!r}") - out = proc.stdout.rstrip() - return out.split() - def main_xoptions(self, xoptions_list): xoptions = {} for opt in xoptions_list: @@ -392,29 +377,66 @@ def check_main_config(self, config): for key in self.UNTESTED_MAIN_CONFIG: del main_config[key] - expected_main = {} + expected = {} for key in self.COPY_MAIN_CONFIG: - expected_main[key] = core_config[key] - expected_main['xoptions'] = self.main_xoptions(core_config['xoptions']) - self.assertEqual(main_config, expected_main) + expected[key] = core_config[key] + expected['xoptions'] = self.main_xoptions(core_config['xoptions']) + self.assertEqual(main_config, expected) + + def get_expected_config(self, expected_core, expected_global, env): + expected_core = dict(self.DEFAULT_CORE_CONFIG, **expected_core) + expected_global = dict(self.DEFAULT_GLOBAL_CONFIG, **expected_global) + + code = textwrap.dedent(''' + import json + import sys + + data = { + 'prefix': sys.prefix, + 'base_prefix': sys.base_prefix, + 'exec_prefix': sys.exec_prefix, + 'base_exec_prefix': sys.base_exec_prefix, + 'Py_FileSystemDefaultEncoding': sys.getfilesystemencoding(), + 'Py_FileSystemDefaultEncodeErrors': sys.getfilesystemencodeerrors(), + } + + data = json.dumps(data) + data = data.encode('utf-8') + sys.stdout.buffer.write(data) + sys.stdout.buffer.flush() + ''') + + # Use -S to not import the site module: get the proper configuration + # when test_embed is run from a venv (bpo-35313) + args = (sys.executable, '-S', '-c', code) + env = dict(env) + if not expected_global['Py_IsolatedFlag']: + env['PYTHONCOERCECLOCALE'] = '0' + env['PYTHONUTF8'] = '0' + proc = subprocess.run(args, env=env, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT) + if proc.returncode: + raise Exception(f"failed to get the default config: " + f"stdout={proc.stdout!r} stderr={proc.stderr!r}") + stdout = proc.stdout.decode('utf-8') + config = json.loads(stdout) + + for key, value in expected_core.items(): + if value is self.GET_DEFAULT_CONFIG: + expected_core[key] = config[key] + for key, value in expected_global.items(): + if value is self.GET_DEFAULT_CONFIG: + expected_global[key] = config[key] + return (expected_core, expected_global) def check_core_config(self, config, expected): - expected = dict(self.DEFAULT_CORE_CONFIG, **expected) core_config = dict(config['core_config']) for key in self.UNTESTED_CORE_CONFIG: core_config.pop(key, None) self.assertEqual(core_config, expected) def check_global_config(self, config, expected, env): - expected = dict(self.DEFAULT_GLOBAL_CONFIG, **expected) - - if expected['Py_FileSystemDefaultEncoding'] is None or expected['Py_FileSystemDefaultEncodeErrors'] is None: - res = self.get_filesystem_encoding(expected['Py_IsolatedFlag'], env) - if expected['Py_FileSystemDefaultEncoding'] is None: - expected['Py_FileSystemDefaultEncoding'] = res[0] - if expected['Py_FileSystemDefaultEncodeErrors'] is None: - expected['Py_FileSystemDefaultEncodeErrors'] = res[1] - core_config = config['core_config'] for item in self.COPY_GLOBAL_CONFIG: @@ -445,6 +467,7 @@ def check_config(self, testname, expected_core, expected_global): # Ignore err config = json.loads(out) + expected_core, expected_global = self.get_expected_config(expected_core, expected_global, env) self.check_core_config(config, expected_core) self.check_main_config(config) self.check_global_config(config, expected_global, env) From webhook-mailer at python.org Mon Nov 26 07:23:34 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 26 Nov 2018 12:23:34 -0000 Subject: [Python-checkins] bpo-34100: Merge constants recursively (GH-8341) Message-ID: https://github.com/python/cpython/commit/c2e1607a51d7a17f143b5a34e8cff7c6fc58a091 commit: c2e1607a51d7a17f143b5a34e8cff7c6fc58a091 branch: master author: INADA Naoki committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-11-26T04:23:22-08:00 summary: bpo-34100: Merge constants recursively (GH-8341) There are some same consts in a module. This commit merges them into single instance. It reduces number of objects in memory after loading modules. https://bugs.python.org/issue34100 files: A Misc/NEWS.d/next/Core and Builtins/2018-07-27-20-04-52.bpo-34100.ypJQX1.rst M Lib/test/test_compile.py M Python/compile.c M Python/importlib.h M Python/importlib_external.h M Python/importlib_zipimport.h diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index a086ef65b44a..58bd9b5e4c7a 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -615,6 +615,16 @@ def check_same_constant(const): self.check_constant(f1, Ellipsis) self.assertEqual(repr(f1()), repr(Ellipsis)) + # Merge constants in tuple or frozenset + # NOTE: frozenset can't reuse previous const, but frozenset + # item can be reused later. + f3 = lambda x: x in {("not a name",)} + f1, f2 = lambda: "not a name", lambda: ("not a name",) + self.assertIs(next(iter(f3.__code__.co_consts[1])), + f2.__code__.co_consts[1]) + self.assertIs(f1.__code__.co_consts[1], + f2.__code__.co_consts[1][0]) + # {0} is converted to a constant frozenset({0}) by the peephole # optimizer f1, f2 = lambda x: x in {0}, lambda x: x in {0} diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-07-27-20-04-52.bpo-34100.ypJQX1.rst b/Misc/NEWS.d/next/Core and Builtins/2018-07-27-20-04-52.bpo-34100.ypJQX1.rst new file mode 100644 index 000000000000..dae318ded493 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-07-27-20-04-52.bpo-34100.ypJQX1.rst @@ -0,0 +1,2 @@ +Compiler now merges constants in tuples and frozensets recursively. Code +attributes like ``co_names`` are merged too. diff --git a/Python/compile.c b/Python/compile.c index beceeea86b12..acb5cfe29b42 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -160,6 +160,8 @@ struct compiler { int c_interactive; /* true if in interactive mode */ int c_nestlevel; + PyObject *c_const_cache; /* Python dict holding all constants, + including names tuple */ struct compiler_unit *u; /* compiler state for current block */ PyObject *c_stack; /* Python list holding compiler_unit ptrs */ PyArena *c_arena; /* pointer to memory allocation arena */ @@ -285,9 +287,16 @@ compiler_init(struct compiler *c) { memset(c, 0, sizeof(struct compiler)); + c->c_const_cache = PyDict_New(); + if (!c->c_const_cache) { + return 0; + } + c->c_stack = PyList_New(0); - if (!c->c_stack) + if (!c->c_stack) { + Py_CLEAR(c->c_const_cache); return 0; + } return 1; } @@ -387,6 +396,7 @@ compiler_free(struct compiler *c) if (c->c_future) PyObject_Free(c->c_future); Py_XDECREF(c->c_filename); + Py_DECREF(c->c_const_cache); Py_DECREF(c->c_stack); } @@ -1179,18 +1189,121 @@ compiler_add_o(struct compiler *c, PyObject *dict, PyObject *o) return arg; } +// Merge const *o* recursively and return constant key object. +static PyObject* +merge_consts_recursive(struct compiler *c, PyObject *o) +{ + // None and Ellipsis are singleton, and key is the singleton. + // No need to merge object and key. + if (o == Py_None || o == Py_Ellipsis) { + Py_INCREF(o); + return o; + } + + PyObject *key = _PyCode_ConstantKey(o); + if (key == NULL) { + return NULL; + } + + // t is borrowed reference + PyObject *t = PyDict_SetDefault(c->c_const_cache, key, key); + if (t != key) { + Py_INCREF(t); + Py_DECREF(key); + return t; + } + + if (PyTuple_CheckExact(o)) { + Py_ssize_t i, len = PyTuple_GET_SIZE(o); + for (i = 0; i < len; i++) { + PyObject *item = PyTuple_GET_ITEM(o, i); + PyObject *u = merge_consts_recursive(c, item); + if (u == NULL) { + Py_DECREF(key); + return NULL; + } + + // See _PyCode_ConstantKey() + PyObject *v; // borrowed + if (PyTuple_CheckExact(u)) { + v = PyTuple_GET_ITEM(u, 1); + } + else { + v = u; + } + if (v != item) { + Py_INCREF(v); + PyTuple_SET_ITEM(o, i, v); + Py_DECREF(item); + } + + Py_DECREF(u); + } + } + else if (PyFrozenSet_CheckExact(o)) { + // We register items in the frozenset, but don't rewrite + // the frozenset when the item is already registered + // because frozenset is rare and difficult. + + // *key* is tuple. And it's first item is frozenset of + // constant keys. + // See _PyCode_ConstantKey() for detail. + assert(PyTuple_CheckExact(key)); + assert(PyTuple_GET_SIZE(key) == 2); + + Py_ssize_t len = PySet_GET_SIZE(o); + if (len == 0) { + return key; + } + PyObject *tuple = PyTuple_New(len); + if (tuple == NULL) { + Py_DECREF(key); + return NULL; + } + Py_ssize_t i = 0, pos = 0; + PyObject *item; + Py_hash_t hash; + while (_PySet_NextEntry(o, &pos, &item, &hash)) { + PyObject *k = merge_consts_recursive(c, item); + if (k == NULL) { + Py_DECREF(tuple); + Py_DECREF(key); + return NULL; + } + PyObject *u; + if (PyTuple_CheckExact(k)) { + u = PyTuple_GET_ITEM(k, 1); + } + else { + u = k; + } + Py_INCREF(u); + PyTuple_SET_ITEM(tuple, i, u); + i++; + } + + PyObject *new = PyFrozenSet_New(tuple); + Py_DECREF(tuple); + if (new == NULL) { + Py_DECREF(key); + return NULL; + } + PyTuple_SET_ITEM(key, 1, new); + } + + return key; +} + static Py_ssize_t compiler_add_const(struct compiler *c, PyObject *o) { - PyObject *t; - Py_ssize_t arg; - - t = _PyCode_ConstantKey(o); - if (t == NULL) + PyObject *key = merge_consts_recursive(c, o); + if (key == NULL) { return -1; + } - arg = compiler_add_o(c, c->u->u_consts, t); - Py_DECREF(t); + Py_ssize_t arg = compiler_add_o(c, c->u->u_consts, key); + Py_DECREF(key); return arg; } @@ -5380,6 +5493,35 @@ compute_code_flags(struct compiler *c) return flags; } +// Merge *tuple* with constant cache. +// Unlike merge_consts_recursive(), this function doesn't work recursively. +static int +merge_const_tuple(struct compiler *c, PyObject **tuple) +{ + assert(PyTuple_CheckExact(*tuple)); + + PyObject *key = _PyCode_ConstantKey(*tuple); + if (key == NULL) { + return 0; + } + + // t is borrowed reference + PyObject *t = PyDict_SetDefault(c->c_const_cache, key, key); + Py_DECREF(key); + if (t == NULL) { + return 0; + } + if (t == key) { // tuple is new constant. + return 1; + } + + PyObject *u = PyTuple_GET_ITEM(t, 1); + Py_INCREF(u); + Py_DECREF(*tuple); + *tuple = u; + return 1; +} + static PyCodeObject * makecode(struct compiler *c, struct assembler *a) { @@ -5410,6 +5552,14 @@ makecode(struct compiler *c, struct assembler *a) if (!freevars) goto error; + if (!merge_const_tuple(c, &names) || + !merge_const_tuple(c, &varnames) || + !merge_const_tuple(c, &cellvars) || + !merge_const_tuple(c, &freevars)) + { + goto error; + } + nlocals = PyDict_GET_SIZE(c->u->u_varnames); assert(nlocals < INT_MAX); nlocals_int = Py_SAFE_DOWNCAST(nlocals, Py_ssize_t, int); @@ -5427,6 +5577,9 @@ makecode(struct compiler *c, struct assembler *a) goto error; Py_DECREF(consts); consts = tmp; + if (!merge_const_tuple(c, &consts)) { + goto error; + } argcount = Py_SAFE_DOWNCAST(c->u->u_argcount, Py_ssize_t, int); kwonlyargcount = Py_SAFE_DOWNCAST(c->u->u_kwonlyargcount, Py_ssize_t, int); diff --git a/Python/importlib.h b/Python/importlib.h index f38e7bb85110..5c38196c7c85 100644 --- a/Python/importlib.h +++ b/Python/importlib.h @@ -73,18 +73,18 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 0,115,8,0,0,0,0,2,8,1,10,1,20,1,114,12, 0,0,0,99,1,0,0,0,0,0,0,0,1,0,0,0, 2,0,0,0,67,0,0,0,115,12,0,0,0,116,0,116, - 1,131,1,124,0,131,1,83,0,41,1,78,41,2,218,4, - 116,121,112,101,218,3,115,121,115,41,1,218,4,110,97,109, + 1,131,1,124,0,131,1,83,0,169,1,78,41,2,218,4, + 116,121,112,101,218,3,115,121,115,169,1,218,4,110,97,109, 101,114,10,0,0,0,114,10,0,0,0,114,11,0,0,0, 218,11,95,110,101,119,95,109,111,100,117,108,101,35,0,0, - 0,115,2,0,0,0,0,1,114,16,0,0,0,99,0,0, + 0,115,2,0,0,0,0,1,114,18,0,0,0,99,0,0, 0,0,0,0,0,0,0,0,0,0,1,0,0,0,64,0, 0,0,115,12,0,0,0,101,0,90,1,100,0,90,2,100, 1,83,0,41,2,218,14,95,68,101,97,100,108,111,99,107, 69,114,114,111,114,78,41,3,114,1,0,0,0,114,0,0, 0,0,114,2,0,0,0,114,10,0,0,0,114,10,0,0, - 0,114,10,0,0,0,114,11,0,0,0,114,17,0,0,0, - 48,0,0,0,115,2,0,0,0,8,1,114,17,0,0,0, + 0,114,10,0,0,0,114,11,0,0,0,114,19,0,0,0, + 48,0,0,0,115,2,0,0,0,8,1,114,19,0,0,0, 99,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0, 0,64,0,0,0,115,56,0,0,0,101,0,90,1,100,0, 90,2,100,1,90,3,100,2,100,3,132,0,90,4,100,4, @@ -106,12 +106,12 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 0,115,48,0,0,0,116,0,160,1,161,0,124,0,95,2, 116,0,160,1,161,0,124,0,95,3,124,1,124,0,95,4, 100,0,124,0,95,5,100,1,124,0,95,6,100,1,124,0, - 95,7,100,0,83,0,41,2,78,233,0,0,0,0,41,8, + 95,7,100,0,83,0,169,2,78,233,0,0,0,0,41,8, 218,7,95,116,104,114,101,97,100,90,13,97,108,108,111,99, 97,116,101,95,108,111,99,107,218,4,108,111,99,107,218,6, - 119,97,107,101,117,112,114,15,0,0,0,218,5,111,119,110, + 119,97,107,101,117,112,114,17,0,0,0,218,5,111,119,110, 101,114,218,5,99,111,117,110,116,218,7,119,97,105,116,101, - 114,115,41,2,218,4,115,101,108,102,114,15,0,0,0,114, + 114,115,169,2,218,4,115,101,108,102,114,17,0,0,0,114, 10,0,0,0,114,10,0,0,0,114,11,0,0,0,218,8, 95,95,105,110,105,116,95,95,58,0,0,0,115,12,0,0, 0,0,1,10,1,10,1,6,1,6,1,6,1,122,20,95, @@ -122,10 +122,10 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 2,161,1,125,3,124,3,100,0,107,8,114,36,100,1,83, 0,124,3,106,2,125,2,124,2,124,1,107,2,114,14,100, 2,83,0,113,14,100,0,83,0,41,3,78,70,84,41,5, - 114,20,0,0,0,218,9,103,101,116,95,105,100,101,110,116, - 114,23,0,0,0,218,12,95,98,108,111,99,107,105,110,103, - 95,111,110,218,3,103,101,116,41,4,114,26,0,0,0,90, - 2,109,101,218,3,116,105,100,114,21,0,0,0,114,10,0, + 114,23,0,0,0,218,9,103,101,116,95,105,100,101,110,116, + 114,26,0,0,0,218,12,95,98,108,111,99,107,105,110,103, + 95,111,110,218,3,103,101,116,41,4,114,30,0,0,0,90, + 2,109,101,218,3,116,105,100,114,24,0,0,0,114,10,0, 0,0,114,10,0,0,0,114,11,0,0,0,218,12,104,97, 115,95,100,101,97,100,108,111,99,107,66,0,0,0,115,16, 0,0,0,0,2,8,1,6,2,10,1,8,1,4,1,6, @@ -155,15 +155,15 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 108,111,99,107,32,105,115,32,97,108,119,97,121,115,32,97, 99,113,117,105,114,101,100,32,97,110,100,32,84,114,117,101, 32,105,115,32,114,101,116,117,114,110,101,100,46,10,32,32, - 32,32,32,32,32,32,114,19,0,0,0,233,1,0,0,0, + 32,32,32,32,32,32,114,22,0,0,0,233,1,0,0,0, 84,122,23,100,101,97,100,108,111,99,107,32,100,101,116,101, - 99,116,101,100,32,98,121,32,37,114,70,78,41,12,114,20, - 0,0,0,114,28,0,0,0,114,29,0,0,0,114,21,0, - 0,0,114,24,0,0,0,114,23,0,0,0,114,32,0,0, - 0,114,17,0,0,0,114,22,0,0,0,218,7,97,99,113, - 117,105,114,101,114,25,0,0,0,218,7,114,101,108,101,97, - 115,101,41,2,114,26,0,0,0,114,31,0,0,0,114,10, - 0,0,0,114,10,0,0,0,114,11,0,0,0,114,34,0, + 99,116,101,100,32,98,121,32,37,114,70,78,41,12,114,23, + 0,0,0,114,32,0,0,0,114,33,0,0,0,114,24,0, + 0,0,114,27,0,0,0,114,26,0,0,0,114,36,0,0, + 0,114,19,0,0,0,114,25,0,0,0,218,7,97,99,113, + 117,105,114,101,114,28,0,0,0,218,7,114,101,108,101,97, + 115,101,169,2,114,30,0,0,0,114,35,0,0,0,114,10, + 0,0,0,114,10,0,0,0,114,11,0,0,0,114,38,0, 0,0,78,0,0,0,115,30,0,0,0,0,6,8,1,8, 1,2,2,8,1,20,1,6,1,14,1,18,1,8,1,12, 1,12,1,24,2,10,1,16,2,122,19,95,77,111,100,117, @@ -177,169 +177,165 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 100,0,124,0,95,3,124,0,106,7,114,108,124,0,4,0, 106,7,100,3,56,0,2,0,95,7,124,0,106,8,160,9, 161,0,1,0,87,0,53,0,81,0,82,0,88,0,100,0, - 83,0,41,4,78,122,31,99,97,110,110,111,116,32,114,101, + 83,0,41,4,78,250,31,99,97,110,110,111,116,32,114,101, 108,101,97,115,101,32,117,110,45,97,99,113,117,105,114,101, - 100,32,108,111,99,107,114,19,0,0,0,114,33,0,0,0, - 41,10,114,20,0,0,0,114,28,0,0,0,114,21,0,0, - 0,114,23,0,0,0,218,12,82,117,110,116,105,109,101,69, - 114,114,111,114,114,24,0,0,0,218,14,65,115,115,101,114, - 116,105,111,110,69,114,114,111,114,114,25,0,0,0,114,22, - 0,0,0,114,35,0,0,0,41,2,114,26,0,0,0,114, - 31,0,0,0,114,10,0,0,0,114,10,0,0,0,114,11, - 0,0,0,114,35,0,0,0,103,0,0,0,115,22,0,0, - 0,0,1,8,1,8,1,10,1,8,1,14,1,14,1,10, - 1,6,1,6,1,14,1,122,19,95,77,111,100,117,108,101, - 76,111,99,107,46,114,101,108,101,97,115,101,99,1,0,0, - 0,0,0,0,0,1,0,0,0,5,0,0,0,67,0,0, - 0,115,18,0,0,0,100,1,160,0,124,0,106,1,116,2, - 124,0,131,1,161,2,83,0,41,2,78,122,23,95,77,111, - 100,117,108,101,76,111,99,107,40,123,33,114,125,41,32,97, - 116,32,123,125,41,3,218,6,102,111,114,109,97,116,114,15, - 0,0,0,218,2,105,100,41,1,114,26,0,0,0,114,10, - 0,0,0,114,10,0,0,0,114,11,0,0,0,218,8,95, - 95,114,101,112,114,95,95,116,0,0,0,115,2,0,0,0, - 0,1,122,20,95,77,111,100,117,108,101,76,111,99,107,46, - 95,95,114,101,112,114,95,95,78,41,9,114,1,0,0,0, - 114,0,0,0,0,114,2,0,0,0,114,3,0,0,0,114, - 27,0,0,0,114,32,0,0,0,114,34,0,0,0,114,35, - 0,0,0,114,40,0,0,0,114,10,0,0,0,114,10,0, - 0,0,114,10,0,0,0,114,11,0,0,0,114,18,0,0, - 0,52,0,0,0,115,12,0,0,0,8,4,4,2,8,8, - 8,12,8,25,8,13,114,18,0,0,0,99,0,0,0,0, - 0,0,0,0,0,0,0,0,2,0,0,0,64,0,0,0, - 115,48,0,0,0,101,0,90,1,100,0,90,2,100,1,90, - 3,100,2,100,3,132,0,90,4,100,4,100,5,132,0,90, - 5,100,6,100,7,132,0,90,6,100,8,100,9,132,0,90, - 7,100,10,83,0,41,11,218,16,95,68,117,109,109,121,77, - 111,100,117,108,101,76,111,99,107,122,86,65,32,115,105,109, - 112,108,101,32,95,77,111,100,117,108,101,76,111,99,107,32, - 101,113,117,105,118,97,108,101,110,116,32,102,111,114,32,80, - 121,116,104,111,110,32,98,117,105,108,100,115,32,119,105,116, - 104,111,117,116,10,32,32,32,32,109,117,108,116,105,45,116, - 104,114,101,97,100,105,110,103,32,115,117,112,112,111,114,116, - 46,99,2,0,0,0,0,0,0,0,2,0,0,0,2,0, - 0,0,67,0,0,0,115,16,0,0,0,124,1,124,0,95, - 0,100,1,124,0,95,1,100,0,83,0,41,2,78,114,19, - 0,0,0,41,2,114,15,0,0,0,114,24,0,0,0,41, - 2,114,26,0,0,0,114,15,0,0,0,114,10,0,0,0, - 114,10,0,0,0,114,11,0,0,0,114,27,0,0,0,124, - 0,0,0,115,4,0,0,0,0,1,6,1,122,25,95,68, - 117,109,109,121,77,111,100,117,108,101,76,111,99,107,46,95, - 95,105,110,105,116,95,95,99,1,0,0,0,0,0,0,0, - 1,0,0,0,3,0,0,0,67,0,0,0,115,18,0,0, - 0,124,0,4,0,106,0,100,1,55,0,2,0,95,0,100, - 2,83,0,41,3,78,114,33,0,0,0,84,41,1,114,24, - 0,0,0,41,1,114,26,0,0,0,114,10,0,0,0,114, - 10,0,0,0,114,11,0,0,0,114,34,0,0,0,128,0, - 0,0,115,4,0,0,0,0,1,14,1,122,24,95,68,117, - 109,109,121,77,111,100,117,108,101,76,111,99,107,46,97,99, - 113,117,105,114,101,99,1,0,0,0,0,0,0,0,1,0, - 0,0,3,0,0,0,67,0,0,0,115,36,0,0,0,124, - 0,106,0,100,1,107,2,114,18,116,1,100,2,131,1,130, - 1,124,0,4,0,106,0,100,3,56,0,2,0,95,0,100, - 0,83,0,41,4,78,114,19,0,0,0,122,31,99,97,110, - 110,111,116,32,114,101,108,101,97,115,101,32,117,110,45,97, - 99,113,117,105,114,101,100,32,108,111,99,107,114,33,0,0, - 0,41,2,114,24,0,0,0,114,36,0,0,0,41,1,114, - 26,0,0,0,114,10,0,0,0,114,10,0,0,0,114,11, - 0,0,0,114,35,0,0,0,132,0,0,0,115,6,0,0, - 0,0,1,10,1,8,1,122,24,95,68,117,109,109,121,77, - 111,100,117,108,101,76,111,99,107,46,114,101,108,101,97,115, - 101,99,1,0,0,0,0,0,0,0,1,0,0,0,5,0, - 0,0,67,0,0,0,115,18,0,0,0,100,1,160,0,124, - 0,106,1,116,2,124,0,131,1,161,2,83,0,41,2,78, - 122,28,95,68,117,109,109,121,77,111,100,117,108,101,76,111, - 99,107,40,123,33,114,125,41,32,97,116,32,123,125,41,3, - 114,38,0,0,0,114,15,0,0,0,114,39,0,0,0,41, - 1,114,26,0,0,0,114,10,0,0,0,114,10,0,0,0, - 114,11,0,0,0,114,40,0,0,0,137,0,0,0,115,2, - 0,0,0,0,1,122,25,95,68,117,109,109,121,77,111,100, - 117,108,101,76,111,99,107,46,95,95,114,101,112,114,95,95, - 78,41,8,114,1,0,0,0,114,0,0,0,0,114,2,0, - 0,0,114,3,0,0,0,114,27,0,0,0,114,34,0,0, - 0,114,35,0,0,0,114,40,0,0,0,114,10,0,0,0, - 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,114, - 41,0,0,0,120,0,0,0,115,10,0,0,0,8,2,4, - 2,8,4,8,4,8,5,114,41,0,0,0,99,0,0,0, - 0,0,0,0,0,0,0,0,0,2,0,0,0,64,0,0, - 0,115,36,0,0,0,101,0,90,1,100,0,90,2,100,1, - 100,2,132,0,90,3,100,3,100,4,132,0,90,4,100,5, - 100,6,132,0,90,5,100,7,83,0,41,8,218,18,95,77, - 111,100,117,108,101,76,111,99,107,77,97,110,97,103,101,114, - 99,2,0,0,0,0,0,0,0,2,0,0,0,2,0,0, - 0,67,0,0,0,115,16,0,0,0,124,1,124,0,95,0, - 100,0,124,0,95,1,100,0,83,0,41,1,78,41,2,218, - 5,95,110,97,109,101,218,5,95,108,111,99,107,41,2,114, - 26,0,0,0,114,15,0,0,0,114,10,0,0,0,114,10, - 0,0,0,114,11,0,0,0,114,27,0,0,0,143,0,0, - 0,115,4,0,0,0,0,1,6,1,122,27,95,77,111,100, - 117,108,101,76,111,99,107,77,97,110,97,103,101,114,46,95, - 95,105,110,105,116,95,95,99,1,0,0,0,0,0,0,0, - 1,0,0,0,2,0,0,0,67,0,0,0,115,26,0,0, - 0,116,0,124,0,106,1,131,1,124,0,95,2,124,0,106, - 2,160,3,161,0,1,0,100,0,83,0,41,1,78,41,4, - 218,16,95,103,101,116,95,109,111,100,117,108,101,95,108,111, - 99,107,114,43,0,0,0,114,44,0,0,0,114,34,0,0, - 0,41,1,114,26,0,0,0,114,10,0,0,0,114,10,0, - 0,0,114,11,0,0,0,218,9,95,95,101,110,116,101,114, - 95,95,147,0,0,0,115,4,0,0,0,0,1,12,1,122, - 28,95,77,111,100,117,108,101,76,111,99,107,77,97,110,97, - 103,101,114,46,95,95,101,110,116,101,114,95,95,99,1,0, - 0,0,0,0,0,0,3,0,0,0,2,0,0,0,79,0, - 0,0,115,14,0,0,0,124,0,106,0,160,1,161,0,1, - 0,100,0,83,0,41,1,78,41,2,114,44,0,0,0,114, - 35,0,0,0,41,3,114,26,0,0,0,218,4,97,114,103, - 115,90,6,107,119,97,114,103,115,114,10,0,0,0,114,10, - 0,0,0,114,11,0,0,0,218,8,95,95,101,120,105,116, - 95,95,151,0,0,0,115,2,0,0,0,0,1,122,27,95, + 100,32,108,111,99,107,114,22,0,0,0,114,37,0,0,0, + 41,10,114,23,0,0,0,114,32,0,0,0,114,24,0,0, + 0,114,26,0,0,0,218,12,82,117,110,116,105,109,101,69, + 114,114,111,114,114,27,0,0,0,218,14,65,115,115,101,114, + 116,105,111,110,69,114,114,111,114,114,28,0,0,0,114,25, + 0,0,0,114,39,0,0,0,114,40,0,0,0,114,10,0, + 0,0,114,10,0,0,0,114,11,0,0,0,114,39,0,0, + 0,103,0,0,0,115,22,0,0,0,0,1,8,1,8,1, + 10,1,8,1,14,1,14,1,10,1,6,1,6,1,14,1, + 122,19,95,77,111,100,117,108,101,76,111,99,107,46,114,101, + 108,101,97,115,101,99,1,0,0,0,0,0,0,0,1,0, + 0,0,5,0,0,0,67,0,0,0,115,18,0,0,0,100, + 1,160,0,124,0,106,1,116,2,124,0,131,1,161,2,83, + 0,41,2,78,122,23,95,77,111,100,117,108,101,76,111,99, + 107,40,123,33,114,125,41,32,97,116,32,123,125,169,3,218, + 6,102,111,114,109,97,116,114,17,0,0,0,218,2,105,100, + 169,1,114,30,0,0,0,114,10,0,0,0,114,10,0,0, + 0,114,11,0,0,0,218,8,95,95,114,101,112,114,95,95, + 116,0,0,0,115,2,0,0,0,0,1,122,20,95,77,111, + 100,117,108,101,76,111,99,107,46,95,95,114,101,112,114,95, + 95,78,41,9,114,1,0,0,0,114,0,0,0,0,114,2, + 0,0,0,114,3,0,0,0,114,31,0,0,0,114,36,0, + 0,0,114,38,0,0,0,114,39,0,0,0,114,48,0,0, + 0,114,10,0,0,0,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,114,20,0,0,0,52,0,0,0,115,12, + 0,0,0,8,4,4,2,8,8,8,12,8,25,8,13,114, + 20,0,0,0,99,0,0,0,0,0,0,0,0,0,0,0, + 0,2,0,0,0,64,0,0,0,115,48,0,0,0,101,0, + 90,1,100,0,90,2,100,1,90,3,100,2,100,3,132,0, + 90,4,100,4,100,5,132,0,90,5,100,6,100,7,132,0, + 90,6,100,8,100,9,132,0,90,7,100,10,83,0,41,11, + 218,16,95,68,117,109,109,121,77,111,100,117,108,101,76,111, + 99,107,122,86,65,32,115,105,109,112,108,101,32,95,77,111, + 100,117,108,101,76,111,99,107,32,101,113,117,105,118,97,108, + 101,110,116,32,102,111,114,32,80,121,116,104,111,110,32,98, + 117,105,108,100,115,32,119,105,116,104,111,117,116,10,32,32, + 32,32,109,117,108,116,105,45,116,104,114,101,97,100,105,110, + 103,32,115,117,112,112,111,114,116,46,99,2,0,0,0,0, + 0,0,0,2,0,0,0,2,0,0,0,67,0,0,0,115, + 16,0,0,0,124,1,124,0,95,0,100,1,124,0,95,1, + 100,0,83,0,114,21,0,0,0,41,2,114,17,0,0,0, + 114,27,0,0,0,114,29,0,0,0,114,10,0,0,0,114, + 10,0,0,0,114,11,0,0,0,114,31,0,0,0,124,0, + 0,0,115,4,0,0,0,0,1,6,1,122,25,95,68,117, + 109,109,121,77,111,100,117,108,101,76,111,99,107,46,95,95, + 105,110,105,116,95,95,99,1,0,0,0,0,0,0,0,1, + 0,0,0,3,0,0,0,67,0,0,0,115,18,0,0,0, + 124,0,4,0,106,0,100,1,55,0,2,0,95,0,100,2, + 83,0,41,3,78,114,37,0,0,0,84,41,1,114,27,0, + 0,0,114,47,0,0,0,114,10,0,0,0,114,10,0,0, + 0,114,11,0,0,0,114,38,0,0,0,128,0,0,0,115, + 4,0,0,0,0,1,14,1,122,24,95,68,117,109,109,121, + 77,111,100,117,108,101,76,111,99,107,46,97,99,113,117,105, + 114,101,99,1,0,0,0,0,0,0,0,1,0,0,0,3, + 0,0,0,67,0,0,0,115,36,0,0,0,124,0,106,0, + 100,1,107,2,114,18,116,1,100,2,131,1,130,1,124,0, + 4,0,106,0,100,3,56,0,2,0,95,0,100,0,83,0, + 41,4,78,114,22,0,0,0,114,41,0,0,0,114,37,0, + 0,0,41,2,114,27,0,0,0,114,42,0,0,0,114,47, + 0,0,0,114,10,0,0,0,114,10,0,0,0,114,11,0, + 0,0,114,39,0,0,0,132,0,0,0,115,6,0,0,0, + 0,1,10,1,8,1,122,24,95,68,117,109,109,121,77,111, + 100,117,108,101,76,111,99,107,46,114,101,108,101,97,115,101, + 99,1,0,0,0,0,0,0,0,1,0,0,0,5,0,0, + 0,67,0,0,0,115,18,0,0,0,100,1,160,0,124,0, + 106,1,116,2,124,0,131,1,161,2,83,0,41,2,78,122, + 28,95,68,117,109,109,121,77,111,100,117,108,101,76,111,99, + 107,40,123,33,114,125,41,32,97,116,32,123,125,114,44,0, + 0,0,114,47,0,0,0,114,10,0,0,0,114,10,0,0, + 0,114,11,0,0,0,114,48,0,0,0,137,0,0,0,115, + 2,0,0,0,0,1,122,25,95,68,117,109,109,121,77,111, + 100,117,108,101,76,111,99,107,46,95,95,114,101,112,114,95, + 95,78,41,8,114,1,0,0,0,114,0,0,0,0,114,2, + 0,0,0,114,3,0,0,0,114,31,0,0,0,114,38,0, + 0,0,114,39,0,0,0,114,48,0,0,0,114,10,0,0, + 0,114,10,0,0,0,114,10,0,0,0,114,11,0,0,0, + 114,49,0,0,0,120,0,0,0,115,10,0,0,0,8,2, + 4,2,8,4,8,4,8,5,114,49,0,0,0,99,0,0, + 0,0,0,0,0,0,0,0,0,0,2,0,0,0,64,0, + 0,0,115,36,0,0,0,101,0,90,1,100,0,90,2,100, + 1,100,2,132,0,90,3,100,3,100,4,132,0,90,4,100, + 5,100,6,132,0,90,5,100,7,83,0,41,8,218,18,95, 77,111,100,117,108,101,76,111,99,107,77,97,110,97,103,101, - 114,46,95,95,101,120,105,116,95,95,78,41,6,114,1,0, - 0,0,114,0,0,0,0,114,2,0,0,0,114,27,0,0, - 0,114,46,0,0,0,114,48,0,0,0,114,10,0,0,0, - 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,114, - 42,0,0,0,141,0,0,0,115,6,0,0,0,8,2,8, - 4,8,4,114,42,0,0,0,99,1,0,0,0,0,0,0, - 0,3,0,0,0,8,0,0,0,67,0,0,0,115,130,0, - 0,0,116,0,160,1,161,0,1,0,122,106,122,14,116,2, - 124,0,25,0,131,0,125,1,87,0,110,24,4,0,116,3, - 107,10,114,48,1,0,1,0,1,0,100,1,125,1,89,0, - 110,2,88,0,124,1,100,1,107,8,114,112,116,4,100,1, - 107,8,114,76,116,5,124,0,131,1,125,1,110,8,116,6, - 124,0,131,1,125,1,124,0,102,1,100,2,100,3,132,1, - 125,2,116,7,160,8,124,1,124,2,161,2,116,2,124,0, - 60,0,87,0,53,0,116,0,160,9,161,0,1,0,88,0, - 124,1,83,0,41,4,122,139,71,101,116,32,111,114,32,99, - 114,101,97,116,101,32,116,104,101,32,109,111,100,117,108,101, - 32,108,111,99,107,32,102,111,114,32,97,32,103,105,118,101, - 110,32,109,111,100,117,108,101,32,110,97,109,101,46,10,10, - 32,32,32,32,65,99,113,117,105,114,101,47,114,101,108,101, - 97,115,101,32,105,110,116,101,114,110,97,108,108,121,32,116, - 104,101,32,103,108,111,98,97,108,32,105,109,112,111,114,116, - 32,108,111,99,107,32,116,111,32,112,114,111,116,101,99,116, - 10,32,32,32,32,95,109,111,100,117,108,101,95,108,111,99, - 107,115,46,78,99,2,0,0,0,0,0,0,0,2,0,0, - 0,8,0,0,0,83,0,0,0,115,48,0,0,0,116,0, - 160,1,161,0,1,0,122,24,116,2,160,3,124,1,161,1, - 124,0,107,8,114,30,116,2,124,1,61,0,87,0,53,0, - 116,0,160,4,161,0,1,0,88,0,100,0,83,0,41,1, - 78,41,5,218,4,95,105,109,112,218,12,97,99,113,117,105, + 114,99,2,0,0,0,0,0,0,0,2,0,0,0,2,0, + 0,0,67,0,0,0,115,16,0,0,0,124,1,124,0,95, + 0,100,0,124,0,95,1,100,0,83,0,114,13,0,0,0, + 41,2,218,5,95,110,97,109,101,218,5,95,108,111,99,107, + 114,29,0,0,0,114,10,0,0,0,114,10,0,0,0,114, + 11,0,0,0,114,31,0,0,0,143,0,0,0,115,4,0, + 0,0,0,1,6,1,122,27,95,77,111,100,117,108,101,76, + 111,99,107,77,97,110,97,103,101,114,46,95,95,105,110,105, + 116,95,95,99,1,0,0,0,0,0,0,0,1,0,0,0, + 2,0,0,0,67,0,0,0,115,26,0,0,0,116,0,124, + 0,106,1,131,1,124,0,95,2,124,0,106,2,160,3,161, + 0,1,0,100,0,83,0,114,13,0,0,0,41,4,218,16, + 95,103,101,116,95,109,111,100,117,108,101,95,108,111,99,107, + 114,51,0,0,0,114,52,0,0,0,114,38,0,0,0,114, + 47,0,0,0,114,10,0,0,0,114,10,0,0,0,114,11, + 0,0,0,218,9,95,95,101,110,116,101,114,95,95,147,0, + 0,0,115,4,0,0,0,0,1,12,1,122,28,95,77,111, + 100,117,108,101,76,111,99,107,77,97,110,97,103,101,114,46, + 95,95,101,110,116,101,114,95,95,99,1,0,0,0,0,0, + 0,0,3,0,0,0,2,0,0,0,79,0,0,0,115,14, + 0,0,0,124,0,106,0,160,1,161,0,1,0,100,0,83, + 0,114,13,0,0,0,41,2,114,52,0,0,0,114,39,0, + 0,0,41,3,114,30,0,0,0,218,4,97,114,103,115,90, + 6,107,119,97,114,103,115,114,10,0,0,0,114,10,0,0, + 0,114,11,0,0,0,218,8,95,95,101,120,105,116,95,95, + 151,0,0,0,115,2,0,0,0,0,1,122,27,95,77,111, + 100,117,108,101,76,111,99,107,77,97,110,97,103,101,114,46, + 95,95,101,120,105,116,95,95,78,41,6,114,1,0,0,0, + 114,0,0,0,0,114,2,0,0,0,114,31,0,0,0,114, + 54,0,0,0,114,56,0,0,0,114,10,0,0,0,114,10, + 0,0,0,114,10,0,0,0,114,11,0,0,0,114,50,0, + 0,0,141,0,0,0,115,6,0,0,0,8,2,8,4,8, + 4,114,50,0,0,0,99,1,0,0,0,0,0,0,0,3, + 0,0,0,8,0,0,0,67,0,0,0,115,130,0,0,0, + 116,0,160,1,161,0,1,0,122,106,122,14,116,2,124,0, + 25,0,131,0,125,1,87,0,110,24,4,0,116,3,107,10, + 114,48,1,0,1,0,1,0,100,1,125,1,89,0,110,2, + 88,0,124,1,100,1,107,8,114,112,116,4,100,1,107,8, + 114,76,116,5,124,0,131,1,125,1,110,8,116,6,124,0, + 131,1,125,1,124,0,102,1,100,2,100,3,132,1,125,2, + 116,7,160,8,124,1,124,2,161,2,116,2,124,0,60,0, + 87,0,53,0,116,0,160,9,161,0,1,0,88,0,124,1, + 83,0,41,4,122,139,71,101,116,32,111,114,32,99,114,101, + 97,116,101,32,116,104,101,32,109,111,100,117,108,101,32,108, + 111,99,107,32,102,111,114,32,97,32,103,105,118,101,110,32, + 109,111,100,117,108,101,32,110,97,109,101,46,10,10,32,32, + 32,32,65,99,113,117,105,114,101,47,114,101,108,101,97,115, + 101,32,105,110,116,101,114,110,97,108,108,121,32,116,104,101, + 32,103,108,111,98,97,108,32,105,109,112,111,114,116,32,108, + 111,99,107,32,116,111,32,112,114,111,116,101,99,116,10,32, + 32,32,32,95,109,111,100,117,108,101,95,108,111,99,107,115, + 46,78,99,2,0,0,0,0,0,0,0,2,0,0,0,8, + 0,0,0,83,0,0,0,115,48,0,0,0,116,0,160,1, + 161,0,1,0,122,24,116,2,160,3,124,1,161,1,124,0, + 107,8,114,30,116,2,124,1,61,0,87,0,53,0,116,0, + 160,4,161,0,1,0,88,0,100,0,83,0,114,13,0,0, + 0,41,5,218,4,95,105,109,112,218,12,97,99,113,117,105, 114,101,95,108,111,99,107,218,13,95,109,111,100,117,108,101, - 95,108,111,99,107,115,114,30,0,0,0,218,12,114,101,108, + 95,108,111,99,107,115,114,34,0,0,0,218,12,114,101,108, 101,97,115,101,95,108,111,99,107,41,2,218,3,114,101,102, - 114,15,0,0,0,114,10,0,0,0,114,10,0,0,0,114, + 114,17,0,0,0,114,10,0,0,0,114,10,0,0,0,114, 11,0,0,0,218,2,99,98,176,0,0,0,115,10,0,0, 0,0,1,8,1,2,4,14,1,10,2,122,28,95,103,101, 116,95,109,111,100,117,108,101,95,108,111,99,107,46,60,108, - 111,99,97,108,115,62,46,99,98,41,10,114,49,0,0,0, - 114,50,0,0,0,114,51,0,0,0,218,8,75,101,121,69, - 114,114,111,114,114,20,0,0,0,114,41,0,0,0,114,18, - 0,0,0,218,8,95,119,101,97,107,114,101,102,114,53,0, - 0,0,114,52,0,0,0,41,3,114,15,0,0,0,114,21, - 0,0,0,114,54,0,0,0,114,10,0,0,0,114,10,0, - 0,0,114,11,0,0,0,114,45,0,0,0,157,0,0,0, + 111,99,97,108,115,62,46,99,98,41,10,114,57,0,0,0, + 114,58,0,0,0,114,59,0,0,0,218,8,75,101,121,69, + 114,114,111,114,114,23,0,0,0,114,49,0,0,0,114,20, + 0,0,0,218,8,95,119,101,97,107,114,101,102,114,61,0, + 0,0,114,60,0,0,0,41,3,114,17,0,0,0,114,24, + 0,0,0,114,62,0,0,0,114,10,0,0,0,114,10,0, + 0,0,114,11,0,0,0,114,53,0,0,0,157,0,0,0, 115,28,0,0,0,0,6,8,1,2,1,2,1,14,1,14, 1,10,2,8,1,8,1,10,2,8,2,12,11,20,2,10, - 2,114,45,0,0,0,99,1,0,0,0,0,0,0,0,2, + 2,114,53,0,0,0,99,1,0,0,0,0,0,0,0,2, 0,0,0,8,0,0,0,67,0,0,0,115,54,0,0,0, 116,0,124,0,131,1,125,1,122,12,124,1,160,1,161,0, 1,0,87,0,110,20,4,0,116,2,107,10,114,40,1,0, @@ -356,13 +352,13 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 10,32,32,32,32,101,118,101,110,116,32,105,116,32,105,115, 32,98,101,105,110,103,32,105,109,112,111,114,116,101,100,32, 98,121,32,97,110,111,116,104,101,114,32,116,104,114,101,97, - 100,46,10,32,32,32,32,78,41,4,114,45,0,0,0,114, - 34,0,0,0,114,17,0,0,0,114,35,0,0,0,41,2, - 114,15,0,0,0,114,21,0,0,0,114,10,0,0,0,114, + 100,46,10,32,32,32,32,78,41,4,114,53,0,0,0,114, + 38,0,0,0,114,19,0,0,0,114,39,0,0,0,41,2, + 114,17,0,0,0,114,24,0,0,0,114,10,0,0,0,114, 10,0,0,0,114,11,0,0,0,218,19,95,108,111,99,107, 95,117,110,108,111,99,107,95,109,111,100,117,108,101,194,0, 0,0,115,12,0,0,0,0,6,8,1,2,1,12,1,14, - 3,6,2,114,57,0,0,0,99,1,0,0,0,0,0,0, + 3,6,2,114,65,0,0,0,99,1,0,0,0,0,0,0, 0,3,0,0,0,3,0,0,0,79,0,0,0,115,10,0, 0,0,124,0,124,1,124,2,142,1,83,0,41,1,97,46, 1,0,0,114,101,109,111,118,101,95,105,109,112,111,114,116, @@ -384,12 +380,12 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 99,101,98,97,99,107,32,40,101,46,103,46,32,119,104,101, 110,32,101,120,101,99,117,116,105,110,103,10,32,32,32,32, 109,111,100,117,108,101,32,99,111,100,101,41,10,32,32,32, - 32,114,10,0,0,0,41,3,218,1,102,114,47,0,0,0, + 32,114,10,0,0,0,41,3,218,1,102,114,55,0,0,0, 90,4,107,119,100,115,114,10,0,0,0,114,10,0,0,0, 114,11,0,0,0,218,25,95,99,97,108,108,95,119,105,116, 104,95,102,114,97,109,101,115,95,114,101,109,111,118,101,100, - 211,0,0,0,115,2,0,0,0,0,8,114,59,0,0,0, - 114,33,0,0,0,41,1,218,9,118,101,114,98,111,115,105, + 211,0,0,0,115,2,0,0,0,0,8,114,67,0,0,0, + 114,37,0,0,0,41,1,218,9,118,101,114,98,111,115,105, 116,121,99,1,0,0,0,1,0,0,0,3,0,0,0,4, 0,0,0,71,0,0,0,115,54,0,0,0,116,0,106,1, 106,2,124,1,107,5,114,50,124,0,160,3,100,1,161,1, @@ -401,14 +397,14 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 82,66,79,83,69,32,105,115,32,116,117,114,110,101,100,32, 111,110,46,41,2,250,1,35,122,7,105,109,112,111,114,116, 32,122,2,35,32,41,1,90,4,102,105,108,101,78,41,7, - 114,14,0,0,0,218,5,102,108,97,103,115,218,7,118,101, + 114,15,0,0,0,218,5,102,108,97,103,115,218,7,118,101, 114,98,111,115,101,218,10,115,116,97,114,116,115,119,105,116, - 104,218,5,112,114,105,110,116,114,38,0,0,0,218,6,115, + 104,218,5,112,114,105,110,116,114,45,0,0,0,218,6,115, 116,100,101,114,114,41,3,218,7,109,101,115,115,97,103,101, - 114,60,0,0,0,114,47,0,0,0,114,10,0,0,0,114, + 114,68,0,0,0,114,55,0,0,0,114,10,0,0,0,114, 10,0,0,0,114,11,0,0,0,218,16,95,118,101,114,98, 111,115,101,95,109,101,115,115,97,103,101,222,0,0,0,115, - 8,0,0,0,0,2,12,1,10,1,8,1,114,68,0,0, + 8,0,0,0,0,2,12,1,10,1,8,1,114,76,0,0, 0,99,1,0,0,0,0,0,0,0,2,0,0,0,3,0, 0,0,3,0,0,0,115,26,0,0,0,135,0,102,1,100, 1,100,2,132,8,125,1,116,0,124,1,136,0,131,2,1, @@ -419,326 +415,325 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 0,0,0,2,0,0,0,4,0,0,0,19,0,0,0,115, 38,0,0,0,124,1,116,0,106,1,107,7,114,28,116,2, 100,1,160,3,124,1,161,1,124,1,100,2,141,2,130,1, - 136,0,124,0,124,1,131,2,83,0,41,3,78,122,29,123, + 136,0,124,0,124,1,131,2,83,0,41,3,78,250,29,123, 33,114,125,32,105,115,32,110,111,116,32,97,32,98,117,105, - 108,116,45,105,110,32,109,111,100,117,108,101,41,1,114,15, - 0,0,0,41,4,114,14,0,0,0,218,20,98,117,105,108, - 116,105,110,95,109,111,100,117,108,101,95,110,97,109,101,115, - 218,11,73,109,112,111,114,116,69,114,114,111,114,114,38,0, - 0,0,41,2,114,26,0,0,0,218,8,102,117,108,108,110, - 97,109,101,41,1,218,3,102,120,110,114,10,0,0,0,114, - 11,0,0,0,218,25,95,114,101,113,117,105,114,101,115,95, - 98,117,105,108,116,105,110,95,119,114,97,112,112,101,114,232, - 0,0,0,115,10,0,0,0,0,1,10,1,10,1,2,255, - 6,2,122,52,95,114,101,113,117,105,114,101,115,95,98,117, - 105,108,116,105,110,46,60,108,111,99,97,108,115,62,46,95, - 114,101,113,117,105,114,101,115,95,98,117,105,108,116,105,110, - 95,119,114,97,112,112,101,114,41,1,114,12,0,0,0,41, - 2,114,72,0,0,0,114,73,0,0,0,114,10,0,0,0, - 41,1,114,72,0,0,0,114,11,0,0,0,218,17,95,114, - 101,113,117,105,114,101,115,95,98,117,105,108,116,105,110,230, - 0,0,0,115,6,0,0,0,0,2,12,5,10,1,114,74, - 0,0,0,99,1,0,0,0,0,0,0,0,2,0,0,0, - 3,0,0,0,3,0,0,0,115,26,0,0,0,135,0,102, - 1,100,1,100,2,132,8,125,1,116,0,124,1,136,0,131, - 2,1,0,124,1,83,0,41,3,122,47,68,101,99,111,114, - 97,116,111,114,32,116,111,32,118,101,114,105,102,121,32,116, - 104,101,32,110,97,109,101,100,32,109,111,100,117,108,101,32, - 105,115,32,102,114,111,122,101,110,46,99,2,0,0,0,0, - 0,0,0,2,0,0,0,4,0,0,0,19,0,0,0,115, - 38,0,0,0,116,0,160,1,124,1,161,1,115,28,116,2, - 100,1,160,3,124,1,161,1,124,1,100,2,141,2,130,1, - 136,0,124,0,124,1,131,2,83,0,41,3,78,122,27,123, - 33,114,125,32,105,115,32,110,111,116,32,97,32,102,114,111, - 122,101,110,32,109,111,100,117,108,101,41,1,114,15,0,0, - 0,41,4,114,49,0,0,0,218,9,105,115,95,102,114,111, - 122,101,110,114,70,0,0,0,114,38,0,0,0,41,2,114, - 26,0,0,0,114,71,0,0,0,41,1,114,72,0,0,0, - 114,10,0,0,0,114,11,0,0,0,218,24,95,114,101,113, - 117,105,114,101,115,95,102,114,111,122,101,110,95,119,114,97, - 112,112,101,114,243,0,0,0,115,10,0,0,0,0,1,10, - 1,10,1,2,255,6,2,122,50,95,114,101,113,117,105,114, - 101,115,95,102,114,111,122,101,110,46,60,108,111,99,97,108, - 115,62,46,95,114,101,113,117,105,114,101,115,95,102,114,111, - 122,101,110,95,119,114,97,112,112,101,114,41,1,114,12,0, - 0,0,41,2,114,72,0,0,0,114,76,0,0,0,114,10, - 0,0,0,41,1,114,72,0,0,0,114,11,0,0,0,218, - 16,95,114,101,113,117,105,114,101,115,95,102,114,111,122,101, - 110,241,0,0,0,115,6,0,0,0,0,2,12,5,10,1, - 114,77,0,0,0,99,2,0,0,0,0,0,0,0,4,0, - 0,0,3,0,0,0,67,0,0,0,115,62,0,0,0,116, - 0,124,1,124,0,131,2,125,2,124,1,116,1,106,2,107, - 6,114,50,116,1,106,2,124,1,25,0,125,3,116,3,124, - 2,124,3,131,2,1,0,116,1,106,2,124,1,25,0,83, - 0,116,4,124,2,131,1,83,0,100,1,83,0,41,2,122, - 128,76,111,97,100,32,116,104,101,32,115,112,101,99,105,102, - 105,101,100,32,109,111,100,117,108,101,32,105,110,116,111,32, - 115,121,115,46,109,111,100,117,108,101,115,32,97,110,100,32, - 114,101,116,117,114,110,32,105,116,46,10,10,32,32,32,32, - 84,104,105,115,32,109,101,116,104,111,100,32,105,115,32,100, - 101,112,114,101,99,97,116,101,100,46,32,32,85,115,101,32, - 108,111,97,100,101,114,46,101,120,101,99,95,109,111,100,117, - 108,101,32,105,110,115,116,101,97,100,46,10,10,32,32,32, - 32,78,41,5,218,16,115,112,101,99,95,102,114,111,109,95, - 108,111,97,100,101,114,114,14,0,0,0,218,7,109,111,100, - 117,108,101,115,218,5,95,101,120,101,99,218,5,95,108,111, - 97,100,41,4,114,26,0,0,0,114,71,0,0,0,218,4, - 115,112,101,99,218,6,109,111,100,117,108,101,114,10,0,0, - 0,114,10,0,0,0,114,11,0,0,0,218,17,95,108,111, - 97,100,95,109,111,100,117,108,101,95,115,104,105,109,253,0, - 0,0,115,12,0,0,0,0,6,10,1,10,1,10,1,10, - 1,10,2,114,84,0,0,0,99,1,0,0,0,0,0,0, - 0,5,0,0,0,8,0,0,0,67,0,0,0,115,226,0, - 0,0,116,0,124,0,100,1,100,0,131,3,125,1,116,1, - 124,1,100,2,131,2,114,56,122,12,124,1,160,2,124,0, - 161,1,87,0,83,0,4,0,116,3,107,10,114,54,1,0, - 1,0,1,0,89,0,110,2,88,0,122,10,124,0,106,4, - 125,2,87,0,110,20,4,0,116,5,107,10,114,86,1,0, - 1,0,1,0,89,0,110,18,88,0,124,2,100,0,107,9, - 114,104,116,6,124,2,131,1,83,0,122,10,124,0,106,7, - 125,3,87,0,110,24,4,0,116,5,107,10,114,138,1,0, - 1,0,1,0,100,3,125,3,89,0,110,2,88,0,122,10, - 124,0,106,8,125,4,87,0,110,58,4,0,116,5,107,10, - 114,208,1,0,1,0,1,0,124,1,100,0,107,8,114,188, - 100,4,160,9,124,3,161,1,6,0,89,0,83,0,100,5, - 160,9,124,3,124,1,161,2,6,0,89,0,83,0,89,0, - 110,14,88,0,100,6,160,9,124,3,124,4,161,2,83,0, - 100,0,83,0,41,7,78,218,10,95,95,108,111,97,100,101, - 114,95,95,218,11,109,111,100,117,108,101,95,114,101,112,114, - 250,1,63,122,13,60,109,111,100,117,108,101,32,123,33,114, - 125,62,122,20,60,109,111,100,117,108,101,32,123,33,114,125, - 32,40,123,33,114,125,41,62,122,23,60,109,111,100,117,108, - 101,32,123,33,114,125,32,102,114,111,109,32,123,33,114,125, - 62,41,10,114,6,0,0,0,114,4,0,0,0,114,86,0, - 0,0,218,9,69,120,99,101,112,116,105,111,110,218,8,95, - 95,115,112,101,99,95,95,218,14,65,116,116,114,105,98,117, - 116,101,69,114,114,111,114,218,22,95,109,111,100,117,108,101, - 95,114,101,112,114,95,102,114,111,109,95,115,112,101,99,114, - 1,0,0,0,218,8,95,95,102,105,108,101,95,95,114,38, - 0,0,0,41,5,114,83,0,0,0,218,6,108,111,97,100, - 101,114,114,82,0,0,0,114,15,0,0,0,218,8,102,105, - 108,101,110,97,109,101,114,10,0,0,0,114,10,0,0,0, - 114,11,0,0,0,218,12,95,109,111,100,117,108,101,95,114, - 101,112,114,13,1,0,0,115,46,0,0,0,0,2,12,1, - 10,4,2,1,12,1,14,1,6,1,2,1,10,1,14,1, - 6,2,8,1,8,4,2,1,10,1,14,1,10,1,2,1, - 10,1,14,1,8,1,14,2,22,2,114,95,0,0,0,99, - 0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0, - 64,0,0,0,115,114,0,0,0,101,0,90,1,100,0,90, - 2,100,1,90,3,100,2,100,2,100,2,100,3,156,3,100, - 4,100,5,132,2,90,4,100,6,100,7,132,0,90,5,100, - 8,100,9,132,0,90,6,101,7,100,10,100,11,132,0,131, - 1,90,8,101,8,106,9,100,12,100,11,132,0,131,1,90, - 8,101,7,100,13,100,14,132,0,131,1,90,10,101,7,100, - 15,100,16,132,0,131,1,90,11,101,11,106,9,100,17,100, - 16,132,0,131,1,90,11,100,2,83,0,41,18,218,10,77, - 111,100,117,108,101,83,112,101,99,97,208,5,0,0,84,104, - 101,32,115,112,101,99,105,102,105,99,97,116,105,111,110,32, - 102,111,114,32,97,32,109,111,100,117,108,101,44,32,117,115, - 101,100,32,102,111,114,32,108,111,97,100,105,110,103,46,10, - 10,32,32,32,32,65,32,109,111,100,117,108,101,39,115,32, - 115,112,101,99,32,105,115,32,116,104,101,32,115,111,117,114, - 99,101,32,102,111,114,32,105,110,102,111,114,109,97,116,105, - 111,110,32,97,98,111,117,116,32,116,104,101,32,109,111,100, - 117,108,101,46,32,32,70,111,114,10,32,32,32,32,100,97, - 116,97,32,97,115,115,111,99,105,97,116,101,100,32,119,105, - 116,104,32,116,104,101,32,109,111,100,117,108,101,44,32,105, - 110,99,108,117,100,105,110,103,32,115,111,117,114,99,101,44, - 32,117,115,101,32,116,104,101,32,115,112,101,99,39,115,10, - 32,32,32,32,108,111,97,100,101,114,46,10,10,32,32,32, - 32,96,110,97,109,101,96,32,105,115,32,116,104,101,32,97, - 98,115,111,108,117,116,101,32,110,97,109,101,32,111,102,32, - 116,104,101,32,109,111,100,117,108,101,46,32,32,96,108,111, - 97,100,101,114,96,32,105,115,32,116,104,101,32,108,111,97, - 100,101,114,10,32,32,32,32,116,111,32,117,115,101,32,119, - 104,101,110,32,108,111,97,100,105,110,103,32,116,104,101,32, - 109,111,100,117,108,101,46,32,32,96,112,97,114,101,110,116, - 96,32,105,115,32,116,104,101,32,110,97,109,101,32,111,102, - 32,116,104,101,10,32,32,32,32,112,97,99,107,97,103,101, - 32,116,104,101,32,109,111,100,117,108,101,32,105,115,32,105, - 110,46,32,32,84,104,101,32,112,97,114,101,110,116,32,105, - 115,32,100,101,114,105,118,101,100,32,102,114,111,109,32,116, - 104,101,32,110,97,109,101,46,10,10,32,32,32,32,96,105, - 115,95,112,97,99,107,97,103,101,96,32,100,101,116,101,114, - 109,105,110,101,115,32,105,102,32,116,104,101,32,109,111,100, - 117,108,101,32,105,115,32,99,111,110,115,105,100,101,114,101, - 100,32,97,32,112,97,99,107,97,103,101,32,111,114,10,32, - 32,32,32,110,111,116,46,32,32,79,110,32,109,111,100,117, - 108,101,115,32,116,104,105,115,32,105,115,32,114,101,102,108, - 101,99,116,101,100,32,98,121,32,116,104,101,32,96,95,95, - 112,97,116,104,95,95,96,32,97,116,116,114,105,98,117,116, - 101,46,10,10,32,32,32,32,96,111,114,105,103,105,110,96, - 32,105,115,32,116,104,101,32,115,112,101,99,105,102,105,99, - 32,108,111,99,97,116,105,111,110,32,117,115,101,100,32,98, - 121,32,116,104,101,32,108,111,97,100,101,114,32,102,114,111, - 109,32,119,104,105,99,104,32,116,111,10,32,32,32,32,108, - 111,97,100,32,116,104,101,32,109,111,100,117,108,101,44,32, - 105,102,32,116,104,97,116,32,105,110,102,111,114,109,97,116, - 105,111,110,32,105,115,32,97,118,97,105,108,97,98,108,101, - 46,32,32,87,104,101,110,32,102,105,108,101,110,97,109,101, - 32,105,115,10,32,32,32,32,115,101,116,44,32,111,114,105, - 103,105,110,32,119,105,108,108,32,109,97,116,99,104,46,10, - 10,32,32,32,32,96,104,97,115,95,108,111,99,97,116,105, - 111,110,96,32,105,110,100,105,99,97,116,101,115,32,116,104, - 97,116,32,97,32,115,112,101,99,39,115,32,34,111,114,105, - 103,105,110,34,32,114,101,102,108,101,99,116,115,32,97,32, - 108,111,99,97,116,105,111,110,46,10,32,32,32,32,87,104, - 101,110,32,116,104,105,115,32,105,115,32,84,114,117,101,44, - 32,96,95,95,102,105,108,101,95,95,96,32,97,116,116,114, - 105,98,117,116,101,32,111,102,32,116,104,101,32,109,111,100, - 117,108,101,32,105,115,32,115,101,116,46,10,10,32,32,32, - 32,96,99,97,99,104,101,100,96,32,105,115,32,116,104,101, - 32,108,111,99,97,116,105,111,110,32,111,102,32,116,104,101, - 32,99,97,99,104,101,100,32,98,121,116,101,99,111,100,101, - 32,102,105,108,101,44,32,105,102,32,97,110,121,46,32,32, - 73,116,10,32,32,32,32,99,111,114,114,101,115,112,111,110, - 100,115,32,116,111,32,116,104,101,32,96,95,95,99,97,99, - 104,101,100,95,95,96,32,97,116,116,114,105,98,117,116,101, - 46,10,10,32,32,32,32,96,115,117,98,109,111,100,117,108, + 108,116,45,105,110,32,109,111,100,117,108,101,114,16,0,0, + 0,41,4,114,15,0,0,0,218,20,98,117,105,108,116,105, + 110,95,109,111,100,117,108,101,95,110,97,109,101,115,218,11, + 73,109,112,111,114,116,69,114,114,111,114,114,45,0,0,0, + 169,2,114,30,0,0,0,218,8,102,117,108,108,110,97,109, + 101,169,1,218,3,102,120,110,114,10,0,0,0,114,11,0, + 0,0,218,25,95,114,101,113,117,105,114,101,115,95,98,117, + 105,108,116,105,110,95,119,114,97,112,112,101,114,232,0,0, + 0,115,10,0,0,0,0,1,10,1,10,1,2,255,6,2, + 122,52,95,114,101,113,117,105,114,101,115,95,98,117,105,108, + 116,105,110,46,60,108,111,99,97,108,115,62,46,95,114,101, + 113,117,105,114,101,115,95,98,117,105,108,116,105,110,95,119, + 114,97,112,112,101,114,169,1,114,12,0,0,0,41,2,114, + 83,0,0,0,114,84,0,0,0,114,10,0,0,0,114,82, + 0,0,0,114,11,0,0,0,218,17,95,114,101,113,117,105, + 114,101,115,95,98,117,105,108,116,105,110,230,0,0,0,115, + 6,0,0,0,0,2,12,5,10,1,114,86,0,0,0,99, + 1,0,0,0,0,0,0,0,2,0,0,0,3,0,0,0, + 3,0,0,0,115,26,0,0,0,135,0,102,1,100,1,100, + 2,132,8,125,1,116,0,124,1,136,0,131,2,1,0,124, + 1,83,0,41,3,122,47,68,101,99,111,114,97,116,111,114, + 32,116,111,32,118,101,114,105,102,121,32,116,104,101,32,110, + 97,109,101,100,32,109,111,100,117,108,101,32,105,115,32,102, + 114,111,122,101,110,46,99,2,0,0,0,0,0,0,0,2, + 0,0,0,4,0,0,0,19,0,0,0,115,38,0,0,0, + 116,0,160,1,124,1,161,1,115,28,116,2,100,1,160,3, + 124,1,161,1,124,1,100,2,141,2,130,1,136,0,124,0, + 124,1,131,2,83,0,169,3,78,122,27,123,33,114,125,32, + 105,115,32,110,111,116,32,97,32,102,114,111,122,101,110,32, + 109,111,100,117,108,101,114,16,0,0,0,41,4,114,57,0, + 0,0,218,9,105,115,95,102,114,111,122,101,110,114,79,0, + 0,0,114,45,0,0,0,114,80,0,0,0,114,82,0,0, + 0,114,10,0,0,0,114,11,0,0,0,218,24,95,114,101, + 113,117,105,114,101,115,95,102,114,111,122,101,110,95,119,114, + 97,112,112,101,114,243,0,0,0,115,10,0,0,0,0,1, + 10,1,10,1,2,255,6,2,122,50,95,114,101,113,117,105, + 114,101,115,95,102,114,111,122,101,110,46,60,108,111,99,97, + 108,115,62,46,95,114,101,113,117,105,114,101,115,95,102,114, + 111,122,101,110,95,119,114,97,112,112,101,114,114,85,0,0, + 0,41,2,114,83,0,0,0,114,89,0,0,0,114,10,0, + 0,0,114,82,0,0,0,114,11,0,0,0,218,16,95,114, + 101,113,117,105,114,101,115,95,102,114,111,122,101,110,241,0, + 0,0,115,6,0,0,0,0,2,12,5,10,1,114,90,0, + 0,0,99,2,0,0,0,0,0,0,0,4,0,0,0,3, + 0,0,0,67,0,0,0,115,62,0,0,0,116,0,124,1, + 124,0,131,2,125,2,124,1,116,1,106,2,107,6,114,50, + 116,1,106,2,124,1,25,0,125,3,116,3,124,2,124,3, + 131,2,1,0,116,1,106,2,124,1,25,0,83,0,116,4, + 124,2,131,1,83,0,100,1,83,0,41,2,122,128,76,111, + 97,100,32,116,104,101,32,115,112,101,99,105,102,105,101,100, + 32,109,111,100,117,108,101,32,105,110,116,111,32,115,121,115, + 46,109,111,100,117,108,101,115,32,97,110,100,32,114,101,116, + 117,114,110,32,105,116,46,10,10,32,32,32,32,84,104,105, + 115,32,109,101,116,104,111,100,32,105,115,32,100,101,112,114, + 101,99,97,116,101,100,46,32,32,85,115,101,32,108,111,97, + 100,101,114,46,101,120,101,99,95,109,111,100,117,108,101,32, + 105,110,115,116,101,97,100,46,10,10,32,32,32,32,78,41, + 5,218,16,115,112,101,99,95,102,114,111,109,95,108,111,97, + 100,101,114,114,15,0,0,0,218,7,109,111,100,117,108,101, + 115,218,5,95,101,120,101,99,218,5,95,108,111,97,100,41, + 4,114,30,0,0,0,114,81,0,0,0,218,4,115,112,101, + 99,218,6,109,111,100,117,108,101,114,10,0,0,0,114,10, + 0,0,0,114,11,0,0,0,218,17,95,108,111,97,100,95, + 109,111,100,117,108,101,95,115,104,105,109,253,0,0,0,115, + 12,0,0,0,0,6,10,1,10,1,10,1,10,1,10,2, + 114,97,0,0,0,99,1,0,0,0,0,0,0,0,5,0, + 0,0,8,0,0,0,67,0,0,0,115,226,0,0,0,116, + 0,124,0,100,1,100,0,131,3,125,1,116,1,124,1,100, + 2,131,2,114,56,122,12,124,1,160,2,124,0,161,1,87, + 0,83,0,4,0,116,3,107,10,114,54,1,0,1,0,1, + 0,89,0,110,2,88,0,122,10,124,0,106,4,125,2,87, + 0,110,20,4,0,116,5,107,10,114,86,1,0,1,0,1, + 0,89,0,110,18,88,0,124,2,100,0,107,9,114,104,116, + 6,124,2,131,1,83,0,122,10,124,0,106,7,125,3,87, + 0,110,24,4,0,116,5,107,10,114,138,1,0,1,0,1, + 0,100,3,125,3,89,0,110,2,88,0,122,10,124,0,106, + 8,125,4,87,0,110,58,4,0,116,5,107,10,114,208,1, + 0,1,0,1,0,124,1,100,0,107,8,114,188,100,4,160, + 9,124,3,161,1,6,0,89,0,83,0,100,5,160,9,124, + 3,124,1,161,2,6,0,89,0,83,0,89,0,110,14,88, + 0,100,6,160,9,124,3,124,4,161,2,83,0,100,0,83, + 0,41,7,78,218,10,95,95,108,111,97,100,101,114,95,95, + 218,11,109,111,100,117,108,101,95,114,101,112,114,250,1,63, + 250,13,60,109,111,100,117,108,101,32,123,33,114,125,62,250, + 20,60,109,111,100,117,108,101,32,123,33,114,125,32,40,123, + 33,114,125,41,62,250,23,60,109,111,100,117,108,101,32,123, + 33,114,125,32,102,114,111,109,32,123,33,114,125,62,41,10, + 114,6,0,0,0,114,4,0,0,0,114,99,0,0,0,218, + 9,69,120,99,101,112,116,105,111,110,218,8,95,95,115,112, + 101,99,95,95,218,14,65,116,116,114,105,98,117,116,101,69, + 114,114,111,114,218,22,95,109,111,100,117,108,101,95,114,101, + 112,114,95,102,114,111,109,95,115,112,101,99,114,1,0,0, + 0,218,8,95,95,102,105,108,101,95,95,114,45,0,0,0, + 41,5,114,96,0,0,0,218,6,108,111,97,100,101,114,114, + 95,0,0,0,114,17,0,0,0,218,8,102,105,108,101,110, + 97,109,101,114,10,0,0,0,114,10,0,0,0,114,11,0, + 0,0,218,12,95,109,111,100,117,108,101,95,114,101,112,114, + 13,1,0,0,115,46,0,0,0,0,2,12,1,10,4,2, + 1,12,1,14,1,6,1,2,1,10,1,14,1,6,2,8, + 1,8,4,2,1,10,1,14,1,10,1,2,1,10,1,14, + 1,8,1,14,2,22,2,114,111,0,0,0,99,0,0,0, + 0,0,0,0,0,0,0,0,0,4,0,0,0,64,0,0, + 0,115,114,0,0,0,101,0,90,1,100,0,90,2,100,1, + 90,3,100,2,100,2,100,2,100,3,156,3,100,4,100,5, + 132,2,90,4,100,6,100,7,132,0,90,5,100,8,100,9, + 132,0,90,6,101,7,100,10,100,11,132,0,131,1,90,8, + 101,8,106,9,100,12,100,11,132,0,131,1,90,8,101,7, + 100,13,100,14,132,0,131,1,90,10,101,7,100,15,100,16, + 132,0,131,1,90,11,101,11,106,9,100,17,100,16,132,0, + 131,1,90,11,100,2,83,0,41,18,218,10,77,111,100,117, + 108,101,83,112,101,99,97,208,5,0,0,84,104,101,32,115, + 112,101,99,105,102,105,99,97,116,105,111,110,32,102,111,114, + 32,97,32,109,111,100,117,108,101,44,32,117,115,101,100,32, + 102,111,114,32,108,111,97,100,105,110,103,46,10,10,32,32, + 32,32,65,32,109,111,100,117,108,101,39,115,32,115,112,101, + 99,32,105,115,32,116,104,101,32,115,111,117,114,99,101,32, + 102,111,114,32,105,110,102,111,114,109,97,116,105,111,110,32, + 97,98,111,117,116,32,116,104,101,32,109,111,100,117,108,101, + 46,32,32,70,111,114,10,32,32,32,32,100,97,116,97,32, + 97,115,115,111,99,105,97,116,101,100,32,119,105,116,104,32, + 116,104,101,32,109,111,100,117,108,101,44,32,105,110,99,108, + 117,100,105,110,103,32,115,111,117,114,99,101,44,32,117,115, + 101,32,116,104,101,32,115,112,101,99,39,115,10,32,32,32, + 32,108,111,97,100,101,114,46,10,10,32,32,32,32,96,110, + 97,109,101,96,32,105,115,32,116,104,101,32,97,98,115,111, + 108,117,116,101,32,110,97,109,101,32,111,102,32,116,104,101, + 32,109,111,100,117,108,101,46,32,32,96,108,111,97,100,101, + 114,96,32,105,115,32,116,104,101,32,108,111,97,100,101,114, + 10,32,32,32,32,116,111,32,117,115,101,32,119,104,101,110, + 32,108,111,97,100,105,110,103,32,116,104,101,32,109,111,100, + 117,108,101,46,32,32,96,112,97,114,101,110,116,96,32,105, + 115,32,116,104,101,32,110,97,109,101,32,111,102,32,116,104, + 101,10,32,32,32,32,112,97,99,107,97,103,101,32,116,104, + 101,32,109,111,100,117,108,101,32,105,115,32,105,110,46,32, + 32,84,104,101,32,112,97,114,101,110,116,32,105,115,32,100, + 101,114,105,118,101,100,32,102,114,111,109,32,116,104,101,32, + 110,97,109,101,46,10,10,32,32,32,32,96,105,115,95,112, + 97,99,107,97,103,101,96,32,100,101,116,101,114,109,105,110, + 101,115,32,105,102,32,116,104,101,32,109,111,100,117,108,101, + 32,105,115,32,99,111,110,115,105,100,101,114,101,100,32,97, + 32,112,97,99,107,97,103,101,32,111,114,10,32,32,32,32, + 110,111,116,46,32,32,79,110,32,109,111,100,117,108,101,115, + 32,116,104,105,115,32,105,115,32,114,101,102,108,101,99,116, + 101,100,32,98,121,32,116,104,101,32,96,95,95,112,97,116, + 104,95,95,96,32,97,116,116,114,105,98,117,116,101,46,10, + 10,32,32,32,32,96,111,114,105,103,105,110,96,32,105,115, + 32,116,104,101,32,115,112,101,99,105,102,105,99,32,108,111, + 99,97,116,105,111,110,32,117,115,101,100,32,98,121,32,116, + 104,101,32,108,111,97,100,101,114,32,102,114,111,109,32,119, + 104,105,99,104,32,116,111,10,32,32,32,32,108,111,97,100, + 32,116,104,101,32,109,111,100,117,108,101,44,32,105,102,32, + 116,104,97,116,32,105,110,102,111,114,109,97,116,105,111,110, + 32,105,115,32,97,118,97,105,108,97,98,108,101,46,32,32, + 87,104,101,110,32,102,105,108,101,110,97,109,101,32,105,115, + 10,32,32,32,32,115,101,116,44,32,111,114,105,103,105,110, + 32,119,105,108,108,32,109,97,116,99,104,46,10,10,32,32, + 32,32,96,104,97,115,95,108,111,99,97,116,105,111,110,96, + 32,105,110,100,105,99,97,116,101,115,32,116,104,97,116,32, + 97,32,115,112,101,99,39,115,32,34,111,114,105,103,105,110, + 34,32,114,101,102,108,101,99,116,115,32,97,32,108,111,99, + 97,116,105,111,110,46,10,32,32,32,32,87,104,101,110,32, + 116,104,105,115,32,105,115,32,84,114,117,101,44,32,96,95, + 95,102,105,108,101,95,95,96,32,97,116,116,114,105,98,117, + 116,101,32,111,102,32,116,104,101,32,109,111,100,117,108,101, + 32,105,115,32,115,101,116,46,10,10,32,32,32,32,96,99, + 97,99,104,101,100,96,32,105,115,32,116,104,101,32,108,111, + 99,97,116,105,111,110,32,111,102,32,116,104,101,32,99,97, + 99,104,101,100,32,98,121,116,101,99,111,100,101,32,102,105, + 108,101,44,32,105,102,32,97,110,121,46,32,32,73,116,10, + 32,32,32,32,99,111,114,114,101,115,112,111,110,100,115,32, + 116,111,32,116,104,101,32,96,95,95,99,97,99,104,101,100, + 95,95,96,32,97,116,116,114,105,98,117,116,101,46,10,10, + 32,32,32,32,96,115,117,98,109,111,100,117,108,101,95,115, + 101,97,114,99,104,95,108,111,99,97,116,105,111,110,115,96, + 32,105,115,32,116,104,101,32,115,101,113,117,101,110,99,101, + 32,111,102,32,112,97,116,104,32,101,110,116,114,105,101,115, + 32,116,111,10,32,32,32,32,115,101,97,114,99,104,32,119, + 104,101,110,32,105,109,112,111,114,116,105,110,103,32,115,117, + 98,109,111,100,117,108,101,115,46,32,32,73,102,32,115,101, + 116,44,32,105,115,95,112,97,99,107,97,103,101,32,115,104, + 111,117,108,100,32,98,101,10,32,32,32,32,84,114,117,101, + 45,45,97,110,100,32,70,97,108,115,101,32,111,116,104,101, + 114,119,105,115,101,46,10,10,32,32,32,32,80,97,99,107, + 97,103,101,115,32,97,114,101,32,115,105,109,112,108,121,32, + 109,111,100,117,108,101,115,32,116,104,97,116,32,40,109,97, + 121,41,32,104,97,118,101,32,115,117,98,109,111,100,117,108, + 101,115,46,32,32,73,102,32,97,32,115,112,101,99,10,32, + 32,32,32,104,97,115,32,97,32,110,111,110,45,78,111,110, + 101,32,118,97,108,117,101,32,105,110,32,96,115,117,98,109, + 111,100,117,108,101,95,115,101,97,114,99,104,95,108,111,99, + 97,116,105,111,110,115,96,44,32,116,104,101,32,105,109,112, + 111,114,116,10,32,32,32,32,115,121,115,116,101,109,32,119, + 105,108,108,32,99,111,110,115,105,100,101,114,32,109,111,100, + 117,108,101,115,32,108,111,97,100,101,100,32,102,114,111,109, + 32,116,104,101,32,115,112,101,99,32,97,115,32,112,97,99, + 107,97,103,101,115,46,10,10,32,32,32,32,79,110,108,121, + 32,102,105,110,100,101,114,115,32,40,115,101,101,32,105,109, + 112,111,114,116,108,105,98,46,97,98,99,46,77,101,116,97, + 80,97,116,104,70,105,110,100,101,114,32,97,110,100,10,32, + 32,32,32,105,109,112,111,114,116,108,105,98,46,97,98,99, + 46,80,97,116,104,69,110,116,114,121,70,105,110,100,101,114, + 41,32,115,104,111,117,108,100,32,109,111,100,105,102,121,32, + 77,111,100,117,108,101,83,112,101,99,32,105,110,115,116,97, + 110,99,101,115,46,10,10,32,32,32,32,78,41,3,218,6, + 111,114,105,103,105,110,218,12,108,111,97,100,101,114,95,115, + 116,97,116,101,218,10,105,115,95,112,97,99,107,97,103,101, + 99,3,0,0,0,3,0,0,0,6,0,0,0,2,0,0, + 0,67,0,0,0,115,54,0,0,0,124,1,124,0,95,0, + 124,2,124,0,95,1,124,3,124,0,95,2,124,4,124,0, + 95,3,124,5,114,32,103,0,110,2,100,0,124,0,95,4, + 100,1,124,0,95,5,100,0,124,0,95,6,100,0,83,0, + 169,2,78,70,41,7,114,17,0,0,0,114,109,0,0,0, + 114,113,0,0,0,114,114,0,0,0,218,26,115,117,98,109, + 111,100,117,108,101,95,115,101,97,114,99,104,95,108,111,99, + 97,116,105,111,110,115,218,13,95,115,101,116,95,102,105,108, + 101,97,116,116,114,218,7,95,99,97,99,104,101,100,41,6, + 114,30,0,0,0,114,17,0,0,0,114,109,0,0,0,114, + 113,0,0,0,114,114,0,0,0,114,115,0,0,0,114,10, + 0,0,0,114,10,0,0,0,114,11,0,0,0,114,31,0, + 0,0,86,1,0,0,115,14,0,0,0,0,2,6,1,6, + 1,6,1,6,1,14,3,6,1,122,19,77,111,100,117,108, + 101,83,112,101,99,46,95,95,105,110,105,116,95,95,99,1, + 0,0,0,0,0,0,0,2,0,0,0,6,0,0,0,67, + 0,0,0,115,102,0,0,0,100,1,160,0,124,0,106,1, + 161,1,100,2,160,0,124,0,106,2,161,1,103,2,125,1, + 124,0,106,3,100,0,107,9,114,52,124,1,160,4,100,3, + 160,0,124,0,106,3,161,1,161,1,1,0,124,0,106,5, + 100,0,107,9,114,80,124,1,160,4,100,4,160,0,124,0, + 106,5,161,1,161,1,1,0,100,5,160,0,124,0,106,6, + 106,7,100,6,160,8,124,1,161,1,161,2,83,0,41,7, + 78,122,9,110,97,109,101,61,123,33,114,125,122,11,108,111, + 97,100,101,114,61,123,33,114,125,122,11,111,114,105,103,105, + 110,61,123,33,114,125,122,29,115,117,98,109,111,100,117,108, 101,95,115,101,97,114,99,104,95,108,111,99,97,116,105,111, - 110,115,96,32,105,115,32,116,104,101,32,115,101,113,117,101, - 110,99,101,32,111,102,32,112,97,116,104,32,101,110,116,114, - 105,101,115,32,116,111,10,32,32,32,32,115,101,97,114,99, - 104,32,119,104,101,110,32,105,109,112,111,114,116,105,110,103, - 32,115,117,98,109,111,100,117,108,101,115,46,32,32,73,102, - 32,115,101,116,44,32,105,115,95,112,97,99,107,97,103,101, - 32,115,104,111,117,108,100,32,98,101,10,32,32,32,32,84, - 114,117,101,45,45,97,110,100,32,70,97,108,115,101,32,111, - 116,104,101,114,119,105,115,101,46,10,10,32,32,32,32,80, - 97,99,107,97,103,101,115,32,97,114,101,32,115,105,109,112, - 108,121,32,109,111,100,117,108,101,115,32,116,104,97,116,32, - 40,109,97,121,41,32,104,97,118,101,32,115,117,98,109,111, - 100,117,108,101,115,46,32,32,73,102,32,97,32,115,112,101, - 99,10,32,32,32,32,104,97,115,32,97,32,110,111,110,45, - 78,111,110,101,32,118,97,108,117,101,32,105,110,32,96,115, - 117,98,109,111,100,117,108,101,95,115,101,97,114,99,104,95, - 108,111,99,97,116,105,111,110,115,96,44,32,116,104,101,32, - 105,109,112,111,114,116,10,32,32,32,32,115,121,115,116,101, - 109,32,119,105,108,108,32,99,111,110,115,105,100,101,114,32, - 109,111,100,117,108,101,115,32,108,111,97,100,101,100,32,102, - 114,111,109,32,116,104,101,32,115,112,101,99,32,97,115,32, - 112,97,99,107,97,103,101,115,46,10,10,32,32,32,32,79, - 110,108,121,32,102,105,110,100,101,114,115,32,40,115,101,101, - 32,105,109,112,111,114,116,108,105,98,46,97,98,99,46,77, - 101,116,97,80,97,116,104,70,105,110,100,101,114,32,97,110, - 100,10,32,32,32,32,105,109,112,111,114,116,108,105,98,46, - 97,98,99,46,80,97,116,104,69,110,116,114,121,70,105,110, - 100,101,114,41,32,115,104,111,117,108,100,32,109,111,100,105, - 102,121,32,77,111,100,117,108,101,83,112,101,99,32,105,110, - 115,116,97,110,99,101,115,46,10,10,32,32,32,32,78,41, - 3,218,6,111,114,105,103,105,110,218,12,108,111,97,100,101, - 114,95,115,116,97,116,101,218,10,105,115,95,112,97,99,107, - 97,103,101,99,3,0,0,0,3,0,0,0,6,0,0,0, - 2,0,0,0,67,0,0,0,115,54,0,0,0,124,1,124, - 0,95,0,124,2,124,0,95,1,124,3,124,0,95,2,124, - 4,124,0,95,3,124,5,114,32,103,0,110,2,100,0,124, - 0,95,4,100,1,124,0,95,5,100,0,124,0,95,6,100, - 0,83,0,41,2,78,70,41,7,114,15,0,0,0,114,93, - 0,0,0,114,97,0,0,0,114,98,0,0,0,218,26,115, - 117,98,109,111,100,117,108,101,95,115,101,97,114,99,104,95, - 108,111,99,97,116,105,111,110,115,218,13,95,115,101,116,95, - 102,105,108,101,97,116,116,114,218,7,95,99,97,99,104,101, - 100,41,6,114,26,0,0,0,114,15,0,0,0,114,93,0, - 0,0,114,97,0,0,0,114,98,0,0,0,114,99,0,0, - 0,114,10,0,0,0,114,10,0,0,0,114,11,0,0,0, - 114,27,0,0,0,86,1,0,0,115,14,0,0,0,0,2, - 6,1,6,1,6,1,6,1,14,3,6,1,122,19,77,111, - 100,117,108,101,83,112,101,99,46,95,95,105,110,105,116,95, - 95,99,1,0,0,0,0,0,0,0,2,0,0,0,6,0, - 0,0,67,0,0,0,115,102,0,0,0,100,1,160,0,124, - 0,106,1,161,1,100,2,160,0,124,0,106,2,161,1,103, - 2,125,1,124,0,106,3,100,0,107,9,114,52,124,1,160, - 4,100,3,160,0,124,0,106,3,161,1,161,1,1,0,124, - 0,106,5,100,0,107,9,114,80,124,1,160,4,100,4,160, - 0,124,0,106,5,161,1,161,1,1,0,100,5,160,0,124, - 0,106,6,106,7,100,6,160,8,124,1,161,1,161,2,83, - 0,41,7,78,122,9,110,97,109,101,61,123,33,114,125,122, - 11,108,111,97,100,101,114,61,123,33,114,125,122,11,111,114, - 105,103,105,110,61,123,33,114,125,122,29,115,117,98,109,111, - 100,117,108,101,95,115,101,97,114,99,104,95,108,111,99,97, - 116,105,111,110,115,61,123,125,122,6,123,125,40,123,125,41, - 122,2,44,32,41,9,114,38,0,0,0,114,15,0,0,0, - 114,93,0,0,0,114,97,0,0,0,218,6,97,112,112,101, - 110,100,114,100,0,0,0,218,9,95,95,99,108,97,115,115, - 95,95,114,1,0,0,0,218,4,106,111,105,110,41,2,114, - 26,0,0,0,114,47,0,0,0,114,10,0,0,0,114,10, - 0,0,0,114,11,0,0,0,114,40,0,0,0,98,1,0, - 0,115,20,0,0,0,0,1,10,1,10,255,4,2,10,1, - 18,1,10,1,8,1,4,255,6,2,122,19,77,111,100,117, - 108,101,83,112,101,99,46,95,95,114,101,112,114,95,95,99, - 2,0,0,0,0,0,0,0,3,0,0,0,8,0,0,0, - 67,0,0,0,115,114,0,0,0,124,0,106,0,125,2,122, - 76,124,0,106,1,124,1,106,1,107,2,111,76,124,0,106, - 2,124,1,106,2,107,2,111,76,124,0,106,3,124,1,106, - 3,107,2,111,76,124,2,124,1,106,0,107,2,111,76,124, - 0,106,4,124,1,106,4,107,2,111,76,124,0,106,5,124, - 1,106,5,107,2,87,0,83,0,87,0,110,26,4,0,116, - 6,107,10,114,108,1,0,1,0,1,0,89,0,100,1,83, - 0,89,0,110,2,88,0,100,0,83,0,41,2,78,70,41, - 7,114,100,0,0,0,114,15,0,0,0,114,93,0,0,0, - 114,97,0,0,0,218,6,99,97,99,104,101,100,218,12,104, - 97,115,95,108,111,99,97,116,105,111,110,114,90,0,0,0, - 41,3,114,26,0,0,0,90,5,111,116,104,101,114,90,4, - 115,109,115,108,114,10,0,0,0,114,10,0,0,0,114,11, - 0,0,0,218,6,95,95,101,113,95,95,108,1,0,0,115, - 30,0,0,0,0,1,6,1,2,1,12,1,10,255,2,2, - 10,254,2,3,8,253,2,4,10,252,2,5,10,251,8,6, - 14,1,122,17,77,111,100,117,108,101,83,112,101,99,46,95, - 95,101,113,95,95,99,1,0,0,0,0,0,0,0,1,0, - 0,0,3,0,0,0,67,0,0,0,115,58,0,0,0,124, - 0,106,0,100,0,107,8,114,52,124,0,106,1,100,0,107, - 9,114,52,124,0,106,2,114,52,116,3,100,0,107,8,114, - 38,116,4,130,1,116,3,160,5,124,0,106,1,161,1,124, - 0,95,0,124,0,106,0,83,0,41,1,78,41,6,114,102, - 0,0,0,114,97,0,0,0,114,101,0,0,0,218,19,95, + 110,115,61,123,125,122,6,123,125,40,123,125,41,122,2,44, + 32,41,9,114,45,0,0,0,114,17,0,0,0,114,109,0, + 0,0,114,113,0,0,0,218,6,97,112,112,101,110,100,114, + 117,0,0,0,218,9,95,95,99,108,97,115,115,95,95,114, + 1,0,0,0,218,4,106,111,105,110,41,2,114,30,0,0, + 0,114,55,0,0,0,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,114,48,0,0,0,98,1,0,0,115,20, + 0,0,0,0,1,10,1,10,255,4,2,10,1,18,1,10, + 1,8,1,4,255,6,2,122,19,77,111,100,117,108,101,83, + 112,101,99,46,95,95,114,101,112,114,95,95,99,2,0,0, + 0,0,0,0,0,3,0,0,0,8,0,0,0,67,0,0, + 0,115,114,0,0,0,124,0,106,0,125,2,122,76,124,0, + 106,1,124,1,106,1,107,2,111,76,124,0,106,2,124,1, + 106,2,107,2,111,76,124,0,106,3,124,1,106,3,107,2, + 111,76,124,2,124,1,106,0,107,2,111,76,124,0,106,4, + 124,1,106,4,107,2,111,76,124,0,106,5,124,1,106,5, + 107,2,87,0,83,0,87,0,110,26,4,0,116,6,107,10, + 114,108,1,0,1,0,1,0,89,0,100,1,83,0,89,0, + 110,2,88,0,100,0,83,0,114,116,0,0,0,41,7,114, + 117,0,0,0,114,17,0,0,0,114,109,0,0,0,114,113, + 0,0,0,218,6,99,97,99,104,101,100,218,12,104,97,115, + 95,108,111,99,97,116,105,111,110,114,106,0,0,0,41,3, + 114,30,0,0,0,90,5,111,116,104,101,114,90,4,115,109, + 115,108,114,10,0,0,0,114,10,0,0,0,114,11,0,0, + 0,218,6,95,95,101,113,95,95,108,1,0,0,115,30,0, + 0,0,0,1,6,1,2,1,12,1,10,255,2,2,10,254, + 2,3,8,253,2,4,10,252,2,5,10,251,8,6,14,1, + 122,17,77,111,100,117,108,101,83,112,101,99,46,95,95,101, + 113,95,95,99,1,0,0,0,0,0,0,0,1,0,0,0, + 3,0,0,0,67,0,0,0,115,58,0,0,0,124,0,106, + 0,100,0,107,8,114,52,124,0,106,1,100,0,107,9,114, + 52,124,0,106,2,114,52,116,3,100,0,107,8,114,38,116, + 4,130,1,116,3,160,5,124,0,106,1,161,1,124,0,95, + 0,124,0,106,0,83,0,114,13,0,0,0,41,6,114,119, + 0,0,0,114,113,0,0,0,114,118,0,0,0,218,19,95, 98,111,111,116,115,116,114,97,112,95,101,120,116,101,114,110, 97,108,218,19,78,111,116,73,109,112,108,101,109,101,110,116, 101,100,69,114,114,111,114,90,11,95,103,101,116,95,99,97, - 99,104,101,100,41,1,114,26,0,0,0,114,10,0,0,0, - 114,10,0,0,0,114,11,0,0,0,114,106,0,0,0,120, - 1,0,0,115,12,0,0,0,0,2,10,1,16,1,8,1, - 4,1,14,1,122,17,77,111,100,117,108,101,83,112,101,99, - 46,99,97,99,104,101,100,99,2,0,0,0,0,0,0,0, - 2,0,0,0,2,0,0,0,67,0,0,0,115,10,0,0, - 0,124,1,124,0,95,0,100,0,83,0,41,1,78,41,1, - 114,102,0,0,0,41,2,114,26,0,0,0,114,106,0,0, + 99,104,101,100,114,47,0,0,0,114,10,0,0,0,114,10, + 0,0,0,114,11,0,0,0,114,123,0,0,0,120,1,0, + 0,115,12,0,0,0,0,2,10,1,16,1,8,1,4,1, + 14,1,122,17,77,111,100,117,108,101,83,112,101,99,46,99, + 97,99,104,101,100,99,2,0,0,0,0,0,0,0,2,0, + 0,0,2,0,0,0,67,0,0,0,115,10,0,0,0,124, + 1,124,0,95,0,100,0,83,0,114,13,0,0,0,41,1, + 114,119,0,0,0,41,2,114,30,0,0,0,114,123,0,0, 0,114,10,0,0,0,114,10,0,0,0,114,11,0,0,0, - 114,106,0,0,0,129,1,0,0,115,2,0,0,0,0,2, + 114,123,0,0,0,129,1,0,0,115,2,0,0,0,0,2, 99,1,0,0,0,0,0,0,0,1,0,0,0,3,0,0, 0,67,0,0,0,115,36,0,0,0,124,0,106,0,100,1, 107,8,114,26,124,0,106,1,160,2,100,2,161,1,100,3, 25,0,83,0,124,0,106,1,83,0,100,1,83,0,41,4, 122,32,84,104,101,32,110,97,109,101,32,111,102,32,116,104, 101,32,109,111,100,117,108,101,39,115,32,112,97,114,101,110, - 116,46,78,218,1,46,114,19,0,0,0,41,3,114,100,0, - 0,0,114,15,0,0,0,218,10,114,112,97,114,116,105,116, - 105,111,110,41,1,114,26,0,0,0,114,10,0,0,0,114, - 10,0,0,0,114,11,0,0,0,218,6,112,97,114,101,110, - 116,133,1,0,0,115,6,0,0,0,0,3,10,1,16,2, - 122,17,77,111,100,117,108,101,83,112,101,99,46,112,97,114, - 101,110,116,99,1,0,0,0,0,0,0,0,1,0,0,0, - 1,0,0,0,67,0,0,0,115,6,0,0,0,124,0,106, - 0,83,0,41,1,78,41,1,114,101,0,0,0,41,1,114, - 26,0,0,0,114,10,0,0,0,114,10,0,0,0,114,11, - 0,0,0,114,107,0,0,0,141,1,0,0,115,2,0,0, - 0,0,2,122,23,77,111,100,117,108,101,83,112,101,99,46, - 104,97,115,95,108,111,99,97,116,105,111,110,99,2,0,0, - 0,0,0,0,0,2,0,0,0,2,0,0,0,67,0,0, - 0,115,14,0,0,0,116,0,124,1,131,1,124,0,95,1, - 100,0,83,0,41,1,78,41,2,218,4,98,111,111,108,114, - 101,0,0,0,41,2,114,26,0,0,0,218,5,118,97,108, + 116,46,78,218,1,46,114,22,0,0,0,41,3,114,117,0, + 0,0,114,17,0,0,0,218,10,114,112,97,114,116,105,116, + 105,111,110,114,47,0,0,0,114,10,0,0,0,114,10,0, + 0,0,114,11,0,0,0,218,6,112,97,114,101,110,116,133, + 1,0,0,115,6,0,0,0,0,3,10,1,16,2,122,17, + 77,111,100,117,108,101,83,112,101,99,46,112,97,114,101,110, + 116,99,1,0,0,0,0,0,0,0,1,0,0,0,1,0, + 0,0,67,0,0,0,115,6,0,0,0,124,0,106,0,83, + 0,114,13,0,0,0,41,1,114,118,0,0,0,114,47,0, + 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, + 0,114,124,0,0,0,141,1,0,0,115,2,0,0,0,0, + 2,122,23,77,111,100,117,108,101,83,112,101,99,46,104,97, + 115,95,108,111,99,97,116,105,111,110,99,2,0,0,0,0, + 0,0,0,2,0,0,0,2,0,0,0,67,0,0,0,115, + 14,0,0,0,116,0,124,1,131,1,124,0,95,1,100,0, + 83,0,114,13,0,0,0,41,2,218,4,98,111,111,108,114, + 118,0,0,0,41,2,114,30,0,0,0,218,5,118,97,108, 117,101,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,114,107,0,0,0,145,1,0,0,115,2,0,0,0,0, + 0,114,124,0,0,0,145,1,0,0,115,2,0,0,0,0, 2,41,12,114,1,0,0,0,114,0,0,0,0,114,2,0, - 0,0,114,3,0,0,0,114,27,0,0,0,114,40,0,0, - 0,114,108,0,0,0,218,8,112,114,111,112,101,114,116,121, - 114,106,0,0,0,218,6,115,101,116,116,101,114,114,113,0, - 0,0,114,107,0,0,0,114,10,0,0,0,114,10,0,0, - 0,114,10,0,0,0,114,11,0,0,0,114,96,0,0,0, + 0,0,114,3,0,0,0,114,31,0,0,0,114,48,0,0, + 0,114,125,0,0,0,218,8,112,114,111,112,101,114,116,121, + 114,123,0,0,0,218,6,115,101,116,116,101,114,114,130,0, + 0,0,114,124,0,0,0,114,10,0,0,0,114,10,0,0, + 0,114,10,0,0,0,114,11,0,0,0,114,112,0,0,0, 49,1,0,0,115,32,0,0,0,8,35,4,2,4,1,2, 255,12,12,8,10,8,12,2,1,10,8,4,1,10,3,2, - 1,10,7,2,1,10,3,4,1,114,96,0,0,0,41,2, - 114,97,0,0,0,114,99,0,0,0,99,2,0,0,0,2, + 1,10,7,2,1,10,3,4,1,114,112,0,0,0,169,2, + 114,113,0,0,0,114,115,0,0,0,99,2,0,0,0,2, 0,0,0,6,0,0,0,8,0,0,0,67,0,0,0,115, 154,0,0,0,116,0,124,1,100,1,131,2,114,74,116,1, 100,2,107,8,114,22,116,2,130,1,116,1,106,3,125,4, @@ -754,429 +749,281 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 101,32,115,112,101,99,32,98,97,115,101,100,32,111,110,32, 118,97,114,105,111,117,115,32,108,111,97,100,101,114,32,109, 101,116,104,111,100,115,46,90,12,103,101,116,95,102,105,108, - 101,110,97,109,101,78,41,1,114,93,0,0,0,41,2,114, - 93,0,0,0,114,100,0,0,0,114,99,0,0,0,70,41, - 2,114,97,0,0,0,114,99,0,0,0,41,7,114,4,0, - 0,0,114,109,0,0,0,114,110,0,0,0,218,23,115,112, - 101,99,95,102,114,111,109,95,102,105,108,101,95,108,111,99, - 97,116,105,111,110,114,99,0,0,0,114,70,0,0,0,114, - 96,0,0,0,41,6,114,15,0,0,0,114,93,0,0,0, - 114,97,0,0,0,114,99,0,0,0,114,118,0,0,0,90, - 6,115,101,97,114,99,104,114,10,0,0,0,114,10,0,0, - 0,114,11,0,0,0,114,78,0,0,0,150,1,0,0,115, - 36,0,0,0,0,2,10,1,8,1,4,1,6,2,8,1, - 12,1,12,1,6,1,2,255,6,3,8,1,10,1,2,1, - 14,1,14,1,12,3,4,2,114,78,0,0,0,99,3,0, - 0,0,0,0,0,0,8,0,0,0,8,0,0,0,67,0, - 0,0,115,56,1,0,0,122,10,124,0,106,0,125,3,87, - 0,110,20,4,0,116,1,107,10,114,30,1,0,1,0,1, - 0,89,0,110,14,88,0,124,3,100,0,107,9,114,44,124, - 3,83,0,124,0,106,2,125,4,124,1,100,0,107,8,114, - 90,122,10,124,0,106,3,125,1,87,0,110,20,4,0,116, - 1,107,10,114,88,1,0,1,0,1,0,89,0,110,2,88, - 0,122,10,124,0,106,4,125,5,87,0,110,24,4,0,116, - 1,107,10,114,124,1,0,1,0,1,0,100,0,125,5,89, - 0,110,2,88,0,124,2,100,0,107,8,114,184,124,5,100, - 0,107,8,114,180,122,10,124,1,106,5,125,2,87,0,113, - 184,4,0,116,1,107,10,114,176,1,0,1,0,1,0,100, - 0,125,2,89,0,113,184,88,0,110,4,124,5,125,2,122, - 10,124,0,106,6,125,6,87,0,110,24,4,0,116,1,107, - 10,114,218,1,0,1,0,1,0,100,0,125,6,89,0,110, - 2,88,0,122,14,116,7,124,0,106,8,131,1,125,7,87, - 0,110,26,4,0,116,1,107,10,144,1,114,4,1,0,1, - 0,1,0,100,0,125,7,89,0,110,2,88,0,116,9,124, - 4,124,1,124,2,100,1,141,3,125,3,124,5,100,0,107, - 8,144,1,114,34,100,2,110,2,100,3,124,3,95,10,124, - 6,124,3,95,11,124,7,124,3,95,12,124,3,83,0,41, - 4,78,41,1,114,97,0,0,0,70,84,41,13,114,89,0, - 0,0,114,90,0,0,0,114,1,0,0,0,114,85,0,0, - 0,114,92,0,0,0,90,7,95,79,82,73,71,73,78,218, - 10,95,95,99,97,99,104,101,100,95,95,218,4,108,105,115, - 116,218,8,95,95,112,97,116,104,95,95,114,96,0,0,0, - 114,101,0,0,0,114,106,0,0,0,114,100,0,0,0,41, - 8,114,83,0,0,0,114,93,0,0,0,114,97,0,0,0, - 114,82,0,0,0,114,15,0,0,0,90,8,108,111,99,97, - 116,105,111,110,114,106,0,0,0,114,100,0,0,0,114,10, - 0,0,0,114,10,0,0,0,114,11,0,0,0,218,17,95, - 115,112,101,99,95,102,114,111,109,95,109,111,100,117,108,101, - 176,1,0,0,115,72,0,0,0,0,2,2,1,10,1,14, - 1,6,2,8,1,4,2,6,1,8,1,2,1,10,1,14, - 2,6,1,2,1,10,1,14,1,10,1,8,1,8,1,2, - 1,10,1,14,1,12,2,4,1,2,1,10,1,14,1,10, - 1,2,1,14,1,16,1,10,2,14,1,20,1,6,1,6, - 1,114,122,0,0,0,70,41,1,218,8,111,118,101,114,114, - 105,100,101,99,2,0,0,0,1,0,0,0,5,0,0,0, - 8,0,0,0,67,0,0,0,115,226,1,0,0,124,2,115, - 20,116,0,124,1,100,1,100,0,131,3,100,0,107,8,114, - 54,122,12,124,0,106,1,124,1,95,2,87,0,110,20,4, - 0,116,3,107,10,114,52,1,0,1,0,1,0,89,0,110, - 2,88,0,124,2,115,74,116,0,124,1,100,2,100,0,131, - 3,100,0,107,8,114,178,124,0,106,4,125,3,124,3,100, - 0,107,8,114,146,124,0,106,5,100,0,107,9,114,146,116, - 6,100,0,107,8,114,110,116,7,130,1,116,6,106,8,125, - 4,124,4,160,9,124,4,161,1,125,3,124,0,106,5,124, - 3,95,10,124,3,124,0,95,4,100,0,124,1,95,11,122, - 10,124,3,124,1,95,12,87,0,110,20,4,0,116,3,107, - 10,114,176,1,0,1,0,1,0,89,0,110,2,88,0,124, - 2,115,198,116,0,124,1,100,3,100,0,131,3,100,0,107, - 8,114,232,122,12,124,0,106,13,124,1,95,14,87,0,110, - 20,4,0,116,3,107,10,114,230,1,0,1,0,1,0,89, - 0,110,2,88,0,122,10,124,0,124,1,95,15,87,0,110, - 22,4,0,116,3,107,10,144,1,114,8,1,0,1,0,1, - 0,89,0,110,2,88,0,124,2,144,1,115,34,116,0,124, - 1,100,4,100,0,131,3,100,0,107,8,144,1,114,82,124, - 0,106,5,100,0,107,9,144,1,114,82,122,12,124,0,106, - 5,124,1,95,16,87,0,110,22,4,0,116,3,107,10,144, - 1,114,80,1,0,1,0,1,0,89,0,110,2,88,0,124, - 0,106,17,144,1,114,222,124,2,144,1,115,114,116,0,124, - 1,100,5,100,0,131,3,100,0,107,8,144,1,114,150,122, - 12,124,0,106,18,124,1,95,11,87,0,110,22,4,0,116, - 3,107,10,144,1,114,148,1,0,1,0,1,0,89,0,110, - 2,88,0,124,2,144,1,115,174,116,0,124,1,100,6,100, - 0,131,3,100,0,107,8,144,1,114,222,124,0,106,19,100, - 0,107,9,144,1,114,222,122,12,124,0,106,19,124,1,95, - 20,87,0,110,22,4,0,116,3,107,10,144,1,114,220,1, - 0,1,0,1,0,89,0,110,2,88,0,124,1,83,0,41, - 7,78,114,1,0,0,0,114,85,0,0,0,218,11,95,95, - 112,97,99,107,97,103,101,95,95,114,121,0,0,0,114,92, - 0,0,0,114,119,0,0,0,41,21,114,6,0,0,0,114, - 15,0,0,0,114,1,0,0,0,114,90,0,0,0,114,93, - 0,0,0,114,100,0,0,0,114,109,0,0,0,114,110,0, - 0,0,218,16,95,78,97,109,101,115,112,97,99,101,76,111, - 97,100,101,114,218,7,95,95,110,101,119,95,95,90,5,95, - 112,97,116,104,114,92,0,0,0,114,85,0,0,0,114,113, - 0,0,0,114,124,0,0,0,114,89,0,0,0,114,121,0, - 0,0,114,107,0,0,0,114,97,0,0,0,114,106,0,0, - 0,114,119,0,0,0,41,5,114,82,0,0,0,114,83,0, - 0,0,114,123,0,0,0,114,93,0,0,0,114,125,0,0, - 0,114,10,0,0,0,114,10,0,0,0,114,11,0,0,0, - 218,18,95,105,110,105,116,95,109,111,100,117,108,101,95,97, - 116,116,114,115,221,1,0,0,115,96,0,0,0,0,4,20, - 1,2,1,12,1,14,1,6,2,20,1,6,1,8,2,10, - 1,8,1,4,1,6,2,10,1,8,1,6,11,6,1,2, - 1,10,1,14,1,6,2,20,1,2,1,12,1,14,1,6, - 2,2,1,10,1,16,1,6,2,24,1,12,1,2,1,12, - 1,16,1,6,2,8,1,24,1,2,1,12,1,16,1,6, - 2,24,1,12,1,2,1,12,1,16,1,6,1,114,127,0, - 0,0,99,1,0,0,0,0,0,0,0,2,0,0,0,3, - 0,0,0,67,0,0,0,115,82,0,0,0,100,1,125,1, - 116,0,124,0,106,1,100,2,131,2,114,30,124,0,106,1, - 160,2,124,0,161,1,125,1,110,20,116,0,124,0,106,1, - 100,3,131,2,114,50,116,3,100,4,131,1,130,1,124,1, - 100,1,107,8,114,68,116,4,124,0,106,5,131,1,125,1, - 116,6,124,0,124,1,131,2,1,0,124,1,83,0,41,5, - 122,43,67,114,101,97,116,101,32,97,32,109,111,100,117,108, - 101,32,98,97,115,101,100,32,111,110,32,116,104,101,32,112, - 114,111,118,105,100,101,100,32,115,112,101,99,46,78,218,13, - 99,114,101,97,116,101,95,109,111,100,117,108,101,218,11,101, - 120,101,99,95,109,111,100,117,108,101,122,66,108,111,97,100, - 101,114,115,32,116,104,97,116,32,100,101,102,105,110,101,32, - 101,120,101,99,95,109,111,100,117,108,101,40,41,32,109,117, - 115,116,32,97,108,115,111,32,100,101,102,105,110,101,32,99, - 114,101,97,116,101,95,109,111,100,117,108,101,40,41,41,7, - 114,4,0,0,0,114,93,0,0,0,114,128,0,0,0,114, - 70,0,0,0,114,16,0,0,0,114,15,0,0,0,114,127, - 0,0,0,41,2,114,82,0,0,0,114,83,0,0,0,114, - 10,0,0,0,114,10,0,0,0,114,11,0,0,0,218,16, - 109,111,100,117,108,101,95,102,114,111,109,95,115,112,101,99, - 37,2,0,0,115,18,0,0,0,0,3,4,1,12,3,14, - 1,12,1,8,2,8,1,10,1,10,1,114,130,0,0,0, - 99,1,0,0,0,0,0,0,0,2,0,0,0,4,0,0, - 0,67,0,0,0,115,106,0,0,0,124,0,106,0,100,1, - 107,8,114,14,100,2,110,4,124,0,106,0,125,1,124,0, - 106,1,100,1,107,8,114,66,124,0,106,2,100,1,107,8, - 114,50,100,3,160,3,124,1,161,1,83,0,100,4,160,3, - 124,1,124,0,106,2,161,2,83,0,110,36,124,0,106,4, - 114,86,100,5,160,3,124,1,124,0,106,1,161,2,83,0, - 100,6,160,3,124,0,106,0,124,0,106,1,161,2,83,0, - 100,1,83,0,41,7,122,38,82,101,116,117,114,110,32,116, - 104,101,32,114,101,112,114,32,116,111,32,117,115,101,32,102, - 111,114,32,116,104,101,32,109,111,100,117,108,101,46,78,114, - 87,0,0,0,122,13,60,109,111,100,117,108,101,32,123,33, - 114,125,62,122,20,60,109,111,100,117,108,101,32,123,33,114, - 125,32,40,123,33,114,125,41,62,122,23,60,109,111,100,117, - 108,101,32,123,33,114,125,32,102,114,111,109,32,123,33,114, - 125,62,122,18,60,109,111,100,117,108,101,32,123,33,114,125, - 32,40,123,125,41,62,41,5,114,15,0,0,0,114,97,0, - 0,0,114,93,0,0,0,114,38,0,0,0,114,107,0,0, - 0,41,2,114,82,0,0,0,114,15,0,0,0,114,10,0, - 0,0,114,10,0,0,0,114,11,0,0,0,114,91,0,0, - 0,54,2,0,0,115,16,0,0,0,0,3,20,1,10,1, - 10,1,10,2,16,2,6,1,14,2,114,91,0,0,0,99, - 2,0,0,0,0,0,0,0,4,0,0,0,10,0,0,0, - 67,0,0,0,115,204,0,0,0,124,0,106,0,125,2,116, - 1,124,2,131,1,143,180,1,0,116,2,106,3,160,4,124, - 2,161,1,124,1,107,9,114,54,100,1,160,5,124,2,161, - 1,125,3,116,6,124,3,124,2,100,2,141,2,130,1,122, - 106,124,0,106,7,100,3,107,8,114,106,124,0,106,8,100, - 3,107,8,114,90,116,6,100,4,124,0,106,0,100,2,141, - 2,130,1,116,9,124,0,124,1,100,5,100,6,141,3,1, - 0,110,52,116,9,124,0,124,1,100,5,100,6,141,3,1, - 0,116,10,124,0,106,7,100,7,131,2,115,146,124,0,106, - 7,160,11,124,2,161,1,1,0,110,12,124,0,106,7,160, - 12,124,1,161,1,1,0,87,0,53,0,116,2,106,3,160, - 13,124,0,106,0,161,1,125,1,124,1,116,2,106,3,124, - 0,106,0,60,0,88,0,87,0,53,0,81,0,82,0,88, - 0,124,1,83,0,41,8,122,70,69,120,101,99,117,116,101, - 32,116,104,101,32,115,112,101,99,39,115,32,115,112,101,99, - 105,102,105,101,100,32,109,111,100,117,108,101,32,105,110,32, - 97,110,32,101,120,105,115,116,105,110,103,32,109,111,100,117, - 108,101,39,115,32,110,97,109,101,115,112,97,99,101,46,122, - 30,109,111,100,117,108,101,32,123,33,114,125,32,110,111,116, - 32,105,110,32,115,121,115,46,109,111,100,117,108,101,115,41, - 1,114,15,0,0,0,78,122,14,109,105,115,115,105,110,103, - 32,108,111,97,100,101,114,84,41,1,114,123,0,0,0,114, - 129,0,0,0,41,14,114,15,0,0,0,114,42,0,0,0, - 114,14,0,0,0,114,79,0,0,0,114,30,0,0,0,114, - 38,0,0,0,114,70,0,0,0,114,93,0,0,0,114,100, - 0,0,0,114,127,0,0,0,114,4,0,0,0,218,11,108, - 111,97,100,95,109,111,100,117,108,101,114,129,0,0,0,218, - 3,112,111,112,41,4,114,82,0,0,0,114,83,0,0,0, - 114,15,0,0,0,218,3,109,115,103,114,10,0,0,0,114, - 10,0,0,0,114,11,0,0,0,114,80,0,0,0,71,2, - 0,0,115,34,0,0,0,0,2,6,1,10,1,16,1,10, - 1,12,1,2,1,10,1,10,1,14,2,16,2,14,1,12, - 4,14,2,16,4,14,1,24,1,114,80,0,0,0,99,1, - 0,0,0,0,0,0,0,2,0,0,0,8,0,0,0,67, - 0,0,0,115,26,1,0,0,122,18,124,0,106,0,160,1, - 124,0,106,2,161,1,1,0,87,0,110,52,1,0,1,0, - 1,0,124,0,106,2,116,3,106,4,107,6,114,64,116,3, - 106,4,160,5,124,0,106,2,161,1,125,1,124,1,116,3, - 106,4,124,0,106,2,60,0,130,0,89,0,110,2,88,0, - 116,3,106,4,160,5,124,0,106,2,161,1,125,1,124,1, - 116,3,106,4,124,0,106,2,60,0,116,6,124,1,100,1, - 100,0,131,3,100,0,107,8,114,148,122,12,124,0,106,0, - 124,1,95,7,87,0,110,20,4,0,116,8,107,10,114,146, - 1,0,1,0,1,0,89,0,110,2,88,0,116,6,124,1, - 100,2,100,0,131,3,100,0,107,8,114,226,122,40,124,1, - 106,9,124,1,95,10,116,11,124,1,100,3,131,2,115,202, - 124,0,106,2,160,12,100,4,161,1,100,5,25,0,124,1, - 95,10,87,0,110,20,4,0,116,8,107,10,114,224,1,0, - 1,0,1,0,89,0,110,2,88,0,116,6,124,1,100,6, - 100,0,131,3,100,0,107,8,144,1,114,22,122,10,124,0, - 124,1,95,13,87,0,110,22,4,0,116,8,107,10,144,1, - 114,20,1,0,1,0,1,0,89,0,110,2,88,0,124,1, - 83,0,41,7,78,114,85,0,0,0,114,124,0,0,0,114, - 121,0,0,0,114,111,0,0,0,114,19,0,0,0,114,89, - 0,0,0,41,14,114,93,0,0,0,114,131,0,0,0,114, - 15,0,0,0,114,14,0,0,0,114,79,0,0,0,114,132, - 0,0,0,114,6,0,0,0,114,85,0,0,0,114,90,0, - 0,0,114,1,0,0,0,114,124,0,0,0,114,4,0,0, - 0,114,112,0,0,0,114,89,0,0,0,41,2,114,82,0, - 0,0,114,83,0,0,0,114,10,0,0,0,114,10,0,0, - 0,114,11,0,0,0,218,25,95,108,111,97,100,95,98,97, - 99,107,119,97,114,100,95,99,111,109,112,97,116,105,98,108, - 101,101,2,0,0,115,54,0,0,0,0,4,2,1,18,1, - 6,1,12,1,14,1,12,1,8,3,14,1,12,1,16,1, - 2,1,12,1,14,1,6,1,16,1,2,4,8,1,10,1, - 22,1,14,1,6,1,18,1,2,1,10,1,16,1,6,1, - 114,134,0,0,0,99,1,0,0,0,0,0,0,0,2,0, - 0,0,11,0,0,0,67,0,0,0,115,220,0,0,0,124, - 0,106,0,100,0,107,9,114,30,116,1,124,0,106,0,100, - 1,131,2,115,30,116,2,124,0,131,1,83,0,116,3,124, - 0,131,1,125,1,100,2,124,0,95,4,122,162,124,1,116, - 5,106,6,124,0,106,7,60,0,122,52,124,0,106,0,100, - 0,107,8,114,96,124,0,106,8,100,0,107,8,114,108,116, - 9,100,3,124,0,106,7,100,4,141,2,130,1,110,12,124, - 0,106,0,160,10,124,1,161,1,1,0,87,0,110,50,1, - 0,1,0,1,0,122,14,116,5,106,6,124,0,106,7,61, - 0,87,0,110,20,4,0,116,11,107,10,114,152,1,0,1, - 0,1,0,89,0,110,2,88,0,130,0,89,0,110,2,88, - 0,116,5,106,6,160,12,124,0,106,7,161,1,125,1,124, - 1,116,5,106,6,124,0,106,7,60,0,116,13,100,5,124, - 0,106,7,124,0,106,0,131,3,1,0,87,0,53,0,100, - 6,124,0,95,4,88,0,124,1,83,0,41,7,78,114,129, - 0,0,0,84,122,14,109,105,115,115,105,110,103,32,108,111, - 97,100,101,114,41,1,114,15,0,0,0,122,18,105,109,112, - 111,114,116,32,123,33,114,125,32,35,32,123,33,114,125,70, - 41,14,114,93,0,0,0,114,4,0,0,0,114,134,0,0, - 0,114,130,0,0,0,90,13,95,105,110,105,116,105,97,108, - 105,122,105,110,103,114,14,0,0,0,114,79,0,0,0,114, - 15,0,0,0,114,100,0,0,0,114,70,0,0,0,114,129, - 0,0,0,114,55,0,0,0,114,132,0,0,0,114,68,0, - 0,0,41,2,114,82,0,0,0,114,83,0,0,0,114,10, - 0,0,0,114,10,0,0,0,114,11,0,0,0,218,14,95, - 108,111,97,100,95,117,110,108,111,99,107,101,100,138,2,0, - 0,115,46,0,0,0,0,2,10,2,12,1,8,2,8,5, - 6,1,2,1,12,1,2,1,10,1,10,1,16,3,16,1, - 6,1,2,1,14,1,14,1,6,1,8,5,14,1,12,1, - 20,2,8,2,114,135,0,0,0,99,1,0,0,0,0,0, - 0,0,1,0,0,0,10,0,0,0,67,0,0,0,115,42, - 0,0,0,116,0,124,0,106,1,131,1,143,22,1,0,116, - 2,124,0,131,1,87,0,2,0,53,0,81,0,82,0,163, - 0,83,0,81,0,82,0,88,0,100,1,83,0,41,2,122, - 191,82,101,116,117,114,110,32,97,32,110,101,119,32,109,111, - 100,117,108,101,32,111,98,106,101,99,116,44,32,108,111,97, - 100,101,100,32,98,121,32,116,104,101,32,115,112,101,99,39, - 115,32,108,111,97,100,101,114,46,10,10,32,32,32,32,84, - 104,101,32,109,111,100,117,108,101,32,105,115,32,110,111,116, - 32,97,100,100,101,100,32,116,111,32,105,116,115,32,112,97, - 114,101,110,116,46,10,10,32,32,32,32,73,102,32,97,32, - 109,111,100,117,108,101,32,105,115,32,97,108,114,101,97,100, - 121,32,105,110,32,115,121,115,46,109,111,100,117,108,101,115, - 44,32,116,104,97,116,32,101,120,105,115,116,105,110,103,32, - 109,111,100,117,108,101,32,103,101,116,115,10,32,32,32,32, - 99,108,111,98,98,101,114,101,100,46,10,10,32,32,32,32, - 78,41,3,114,42,0,0,0,114,15,0,0,0,114,135,0, - 0,0,41,1,114,82,0,0,0,114,10,0,0,0,114,10, - 0,0,0,114,11,0,0,0,114,81,0,0,0,180,2,0, - 0,115,4,0,0,0,0,9,12,1,114,81,0,0,0,99, - 0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0, - 64,0,0,0,115,136,0,0,0,101,0,90,1,100,0,90, - 2,100,1,90,3,101,4,100,2,100,3,132,0,131,1,90, - 5,101,6,100,19,100,5,100,6,132,1,131,1,90,7,101, - 6,100,20,100,7,100,8,132,1,131,1,90,8,101,6,100, - 9,100,10,132,0,131,1,90,9,101,6,100,11,100,12,132, - 0,131,1,90,10,101,6,101,11,100,13,100,14,132,0,131, - 1,131,1,90,12,101,6,101,11,100,15,100,16,132,0,131, - 1,131,1,90,13,101,6,101,11,100,17,100,18,132,0,131, - 1,131,1,90,14,101,6,101,15,131,1,90,16,100,4,83, - 0,41,21,218,15,66,117,105,108,116,105,110,73,109,112,111, - 114,116,101,114,122,144,77,101,116,97,32,112,97,116,104,32, - 105,109,112,111,114,116,32,102,111,114,32,98,117,105,108,116, - 45,105,110,32,109,111,100,117,108,101,115,46,10,10,32,32, - 32,32,65,108,108,32,109,101,116,104,111,100,115,32,97,114, - 101,32,101,105,116,104,101,114,32,99,108,97,115,115,32,111, - 114,32,115,116,97,116,105,99,32,109,101,116,104,111,100,115, - 32,116,111,32,97,118,111,105,100,32,116,104,101,32,110,101, - 101,100,32,116,111,10,32,32,32,32,105,110,115,116,97,110, - 116,105,97,116,101,32,116,104,101,32,99,108,97,115,115,46, - 10,10,32,32,32,32,99,1,0,0,0,0,0,0,0,1, - 0,0,0,3,0,0,0,67,0,0,0,115,12,0,0,0, - 100,1,160,0,124,0,106,1,161,1,83,0,41,2,122,115, - 82,101,116,117,114,110,32,114,101,112,114,32,102,111,114,32, - 116,104,101,32,109,111,100,117,108,101,46,10,10,32,32,32, - 32,32,32,32,32,84,104,101,32,109,101,116,104,111,100,32, - 105,115,32,100,101,112,114,101,99,97,116,101,100,46,32,32, - 84,104,101,32,105,109,112,111,114,116,32,109,97,99,104,105, - 110,101,114,121,32,100,111,101,115,32,116,104,101,32,106,111, - 98,32,105,116,115,101,108,102,46,10,10,32,32,32,32,32, - 32,32,32,122,24,60,109,111,100,117,108,101,32,123,33,114, - 125,32,40,98,117,105,108,116,45,105,110,41,62,41,2,114, - 38,0,0,0,114,1,0,0,0,41,1,114,83,0,0,0, + 101,110,97,109,101,78,41,1,114,109,0,0,0,41,2,114, + 109,0,0,0,114,117,0,0,0,114,115,0,0,0,70,114, + 135,0,0,0,41,7,114,4,0,0,0,114,126,0,0,0, + 114,127,0,0,0,218,23,115,112,101,99,95,102,114,111,109, + 95,102,105,108,101,95,108,111,99,97,116,105,111,110,114,115, + 0,0,0,114,79,0,0,0,114,112,0,0,0,41,6,114, + 17,0,0,0,114,109,0,0,0,114,113,0,0,0,114,115, + 0,0,0,114,136,0,0,0,90,6,115,101,97,114,99,104, 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,114, - 86,0,0,0,204,2,0,0,115,2,0,0,0,0,7,122, - 27,66,117,105,108,116,105,110,73,109,112,111,114,116,101,114, - 46,109,111,100,117,108,101,95,114,101,112,114,78,99,4,0, - 0,0,0,0,0,0,4,0,0,0,5,0,0,0,67,0, - 0,0,115,44,0,0,0,124,2,100,0,107,9,114,12,100, - 0,83,0,116,0,160,1,124,1,161,1,114,36,116,2,124, - 1,124,0,100,1,100,2,141,3,83,0,100,0,83,0,100, - 0,83,0,41,3,78,122,8,98,117,105,108,116,45,105,110, - 41,1,114,97,0,0,0,41,3,114,49,0,0,0,90,10, - 105,115,95,98,117,105,108,116,105,110,114,78,0,0,0,41, - 4,218,3,99,108,115,114,71,0,0,0,218,4,112,97,116, - 104,218,6,116,97,114,103,101,116,114,10,0,0,0,114,10, - 0,0,0,114,11,0,0,0,218,9,102,105,110,100,95,115, - 112,101,99,213,2,0,0,115,10,0,0,0,0,2,8,1, - 4,1,10,1,14,2,122,25,66,117,105,108,116,105,110,73, - 109,112,111,114,116,101,114,46,102,105,110,100,95,115,112,101, - 99,99,3,0,0,0,0,0,0,0,4,0,0,0,4,0, - 0,0,67,0,0,0,115,30,0,0,0,124,0,160,0,124, - 1,124,2,161,2,125,3,124,3,100,1,107,9,114,26,124, - 3,106,1,83,0,100,1,83,0,41,2,122,175,70,105,110, - 100,32,116,104,101,32,98,117,105,108,116,45,105,110,32,109, - 111,100,117,108,101,46,10,10,32,32,32,32,32,32,32,32, - 73,102,32,39,112,97,116,104,39,32,105,115,32,101,118,101, - 114,32,115,112,101,99,105,102,105,101,100,32,116,104,101,110, - 32,116,104,101,32,115,101,97,114,99,104,32,105,115,32,99, - 111,110,115,105,100,101,114,101,100,32,97,32,102,97,105,108, - 117,114,101,46,10,10,32,32,32,32,32,32,32,32,84,104, - 105,115,32,109,101,116,104,111,100,32,105,115,32,100,101,112, - 114,101,99,97,116,101,100,46,32,32,85,115,101,32,102,105, - 110,100,95,115,112,101,99,40,41,32,105,110,115,116,101,97, - 100,46,10,10,32,32,32,32,32,32,32,32,78,41,2,114, - 140,0,0,0,114,93,0,0,0,41,4,114,137,0,0,0, - 114,71,0,0,0,114,138,0,0,0,114,82,0,0,0,114, - 10,0,0,0,114,10,0,0,0,114,11,0,0,0,218,11, - 102,105,110,100,95,109,111,100,117,108,101,222,2,0,0,115, - 4,0,0,0,0,9,12,1,122,27,66,117,105,108,116,105, - 110,73,109,112,111,114,116,101,114,46,102,105,110,100,95,109, - 111,100,117,108,101,99,2,0,0,0,0,0,0,0,2,0, - 0,0,4,0,0,0,67,0,0,0,115,46,0,0,0,124, - 1,106,0,116,1,106,2,107,7,114,34,116,3,100,1,160, - 4,124,1,106,0,161,1,124,1,106,0,100,2,141,2,130, - 1,116,5,116,6,106,7,124,1,131,2,83,0,41,3,122, - 24,67,114,101,97,116,101,32,97,32,98,117,105,108,116,45, - 105,110,32,109,111,100,117,108,101,122,29,123,33,114,125,32, - 105,115,32,110,111,116,32,97,32,98,117,105,108,116,45,105, - 110,32,109,111,100,117,108,101,41,1,114,15,0,0,0,41, - 8,114,15,0,0,0,114,14,0,0,0,114,69,0,0,0, - 114,70,0,0,0,114,38,0,0,0,114,59,0,0,0,114, - 49,0,0,0,90,14,99,114,101,97,116,101,95,98,117,105, - 108,116,105,110,41,2,114,26,0,0,0,114,82,0,0,0, + 91,0,0,0,150,1,0,0,115,36,0,0,0,0,2,10, + 1,8,1,4,1,6,2,8,1,12,1,12,1,6,1,2, + 255,6,3,8,1,10,1,2,1,14,1,14,1,12,3,4, + 2,114,91,0,0,0,99,3,0,0,0,0,0,0,0,8, + 0,0,0,8,0,0,0,67,0,0,0,115,56,1,0,0, + 122,10,124,0,106,0,125,3,87,0,110,20,4,0,116,1, + 107,10,114,30,1,0,1,0,1,0,89,0,110,14,88,0, + 124,3,100,0,107,9,114,44,124,3,83,0,124,0,106,2, + 125,4,124,1,100,0,107,8,114,90,122,10,124,0,106,3, + 125,1,87,0,110,20,4,0,116,1,107,10,114,88,1,0, + 1,0,1,0,89,0,110,2,88,0,122,10,124,0,106,4, + 125,5,87,0,110,24,4,0,116,1,107,10,114,124,1,0, + 1,0,1,0,100,0,125,5,89,0,110,2,88,0,124,2, + 100,0,107,8,114,184,124,5,100,0,107,8,114,180,122,10, + 124,1,106,5,125,2,87,0,113,184,4,0,116,1,107,10, + 114,176,1,0,1,0,1,0,100,0,125,2,89,0,113,184, + 88,0,110,4,124,5,125,2,122,10,124,0,106,6,125,6, + 87,0,110,24,4,0,116,1,107,10,114,218,1,0,1,0, + 1,0,100,0,125,6,89,0,110,2,88,0,122,14,116,7, + 124,0,106,8,131,1,125,7,87,0,110,26,4,0,116,1, + 107,10,144,1,114,4,1,0,1,0,1,0,100,0,125,7, + 89,0,110,2,88,0,116,9,124,4,124,1,124,2,100,1, + 141,3,125,3,124,5,100,0,107,8,144,1,114,34,100,2, + 110,2,100,3,124,3,95,10,124,6,124,3,95,11,124,7, + 124,3,95,12,124,3,83,0,41,4,78,169,1,114,113,0, + 0,0,70,84,41,13,114,105,0,0,0,114,106,0,0,0, + 114,1,0,0,0,114,98,0,0,0,114,108,0,0,0,90, + 7,95,79,82,73,71,73,78,218,10,95,95,99,97,99,104, + 101,100,95,95,218,4,108,105,115,116,218,8,95,95,112,97, + 116,104,95,95,114,112,0,0,0,114,118,0,0,0,114,123, + 0,0,0,114,117,0,0,0,41,8,114,96,0,0,0,114, + 109,0,0,0,114,113,0,0,0,114,95,0,0,0,114,17, + 0,0,0,90,8,108,111,99,97,116,105,111,110,114,123,0, + 0,0,114,117,0,0,0,114,10,0,0,0,114,10,0,0, + 0,114,11,0,0,0,218,17,95,115,112,101,99,95,102,114, + 111,109,95,109,111,100,117,108,101,176,1,0,0,115,72,0, + 0,0,0,2,2,1,10,1,14,1,6,2,8,1,4,2, + 6,1,8,1,2,1,10,1,14,2,6,1,2,1,10,1, + 14,1,10,1,8,1,8,1,2,1,10,1,14,1,12,2, + 4,1,2,1,10,1,14,1,10,1,2,1,14,1,16,1, + 10,2,14,1,20,1,6,1,6,1,114,141,0,0,0,70, + 169,1,218,8,111,118,101,114,114,105,100,101,99,2,0,0, + 0,1,0,0,0,5,0,0,0,8,0,0,0,67,0,0, + 0,115,226,1,0,0,124,2,115,20,116,0,124,1,100,1, + 100,0,131,3,100,0,107,8,114,54,122,12,124,0,106,1, + 124,1,95,2,87,0,110,20,4,0,116,3,107,10,114,52, + 1,0,1,0,1,0,89,0,110,2,88,0,124,2,115,74, + 116,0,124,1,100,2,100,0,131,3,100,0,107,8,114,178, + 124,0,106,4,125,3,124,3,100,0,107,8,114,146,124,0, + 106,5,100,0,107,9,114,146,116,6,100,0,107,8,114,110, + 116,7,130,1,116,6,106,8,125,4,124,4,160,9,124,4, + 161,1,125,3,124,0,106,5,124,3,95,10,124,3,124,0, + 95,4,100,0,124,1,95,11,122,10,124,3,124,1,95,12, + 87,0,110,20,4,0,116,3,107,10,114,176,1,0,1,0, + 1,0,89,0,110,2,88,0,124,2,115,198,116,0,124,1, + 100,3,100,0,131,3,100,0,107,8,114,232,122,12,124,0, + 106,13,124,1,95,14,87,0,110,20,4,0,116,3,107,10, + 114,230,1,0,1,0,1,0,89,0,110,2,88,0,122,10, + 124,0,124,1,95,15,87,0,110,22,4,0,116,3,107,10, + 144,1,114,8,1,0,1,0,1,0,89,0,110,2,88,0, + 124,2,144,1,115,34,116,0,124,1,100,4,100,0,131,3, + 100,0,107,8,144,1,114,82,124,0,106,5,100,0,107,9, + 144,1,114,82,122,12,124,0,106,5,124,1,95,16,87,0, + 110,22,4,0,116,3,107,10,144,1,114,80,1,0,1,0, + 1,0,89,0,110,2,88,0,124,0,106,17,144,1,114,222, + 124,2,144,1,115,114,116,0,124,1,100,5,100,0,131,3, + 100,0,107,8,144,1,114,150,122,12,124,0,106,18,124,1, + 95,11,87,0,110,22,4,0,116,3,107,10,144,1,114,148, + 1,0,1,0,1,0,89,0,110,2,88,0,124,2,144,1, + 115,174,116,0,124,1,100,6,100,0,131,3,100,0,107,8, + 144,1,114,222,124,0,106,19,100,0,107,9,144,1,114,222, + 122,12,124,0,106,19,124,1,95,20,87,0,110,22,4,0, + 116,3,107,10,144,1,114,220,1,0,1,0,1,0,89,0, + 110,2,88,0,124,1,83,0,41,7,78,114,1,0,0,0, + 114,98,0,0,0,218,11,95,95,112,97,99,107,97,103,101, + 95,95,114,140,0,0,0,114,108,0,0,0,114,138,0,0, + 0,41,21,114,6,0,0,0,114,17,0,0,0,114,1,0, + 0,0,114,106,0,0,0,114,109,0,0,0,114,117,0,0, + 0,114,126,0,0,0,114,127,0,0,0,218,16,95,78,97, + 109,101,115,112,97,99,101,76,111,97,100,101,114,218,7,95, + 95,110,101,119,95,95,90,5,95,112,97,116,104,114,108,0, + 0,0,114,98,0,0,0,114,130,0,0,0,114,144,0,0, + 0,114,105,0,0,0,114,140,0,0,0,114,124,0,0,0, + 114,113,0,0,0,114,123,0,0,0,114,138,0,0,0,41, + 5,114,95,0,0,0,114,96,0,0,0,114,143,0,0,0, + 114,109,0,0,0,114,145,0,0,0,114,10,0,0,0,114, + 10,0,0,0,114,11,0,0,0,218,18,95,105,110,105,116, + 95,109,111,100,117,108,101,95,97,116,116,114,115,221,1,0, + 0,115,96,0,0,0,0,4,20,1,2,1,12,1,14,1, + 6,2,20,1,6,1,8,2,10,1,8,1,4,1,6,2, + 10,1,8,1,6,11,6,1,2,1,10,1,14,1,6,2, + 20,1,2,1,12,1,14,1,6,2,2,1,10,1,16,1, + 6,2,24,1,12,1,2,1,12,1,16,1,6,2,8,1, + 24,1,2,1,12,1,16,1,6,2,24,1,12,1,2,1, + 12,1,16,1,6,1,114,147,0,0,0,99,1,0,0,0, + 0,0,0,0,2,0,0,0,3,0,0,0,67,0,0,0, + 115,82,0,0,0,100,1,125,1,116,0,124,0,106,1,100, + 2,131,2,114,30,124,0,106,1,160,2,124,0,161,1,125, + 1,110,20,116,0,124,0,106,1,100,3,131,2,114,50,116, + 3,100,4,131,1,130,1,124,1,100,1,107,8,114,68,116, + 4,124,0,106,5,131,1,125,1,116,6,124,0,124,1,131, + 2,1,0,124,1,83,0,41,5,122,43,67,114,101,97,116, + 101,32,97,32,109,111,100,117,108,101,32,98,97,115,101,100, + 32,111,110,32,116,104,101,32,112,114,111,118,105,100,101,100, + 32,115,112,101,99,46,78,218,13,99,114,101,97,116,101,95, + 109,111,100,117,108,101,218,11,101,120,101,99,95,109,111,100, + 117,108,101,122,66,108,111,97,100,101,114,115,32,116,104,97, + 116,32,100,101,102,105,110,101,32,101,120,101,99,95,109,111, + 100,117,108,101,40,41,32,109,117,115,116,32,97,108,115,111, + 32,100,101,102,105,110,101,32,99,114,101,97,116,101,95,109, + 111,100,117,108,101,40,41,41,7,114,4,0,0,0,114,109, + 0,0,0,114,148,0,0,0,114,79,0,0,0,114,18,0, + 0,0,114,17,0,0,0,114,147,0,0,0,169,2,114,95, + 0,0,0,114,96,0,0,0,114,10,0,0,0,114,10,0, + 0,0,114,11,0,0,0,218,16,109,111,100,117,108,101,95, + 102,114,111,109,95,115,112,101,99,37,2,0,0,115,18,0, + 0,0,0,3,4,1,12,3,14,1,12,1,8,2,8,1, + 10,1,10,1,114,151,0,0,0,99,1,0,0,0,0,0, + 0,0,2,0,0,0,4,0,0,0,67,0,0,0,115,106, + 0,0,0,124,0,106,0,100,1,107,8,114,14,100,2,110, + 4,124,0,106,0,125,1,124,0,106,1,100,1,107,8,114, + 66,124,0,106,2,100,1,107,8,114,50,100,3,160,3,124, + 1,161,1,83,0,100,4,160,3,124,1,124,0,106,2,161, + 2,83,0,110,36,124,0,106,4,114,86,100,5,160,3,124, + 1,124,0,106,1,161,2,83,0,100,6,160,3,124,0,106, + 0,124,0,106,1,161,2,83,0,100,1,83,0,41,7,122, + 38,82,101,116,117,114,110,32,116,104,101,32,114,101,112,114, + 32,116,111,32,117,115,101,32,102,111,114,32,116,104,101,32, + 109,111,100,117,108,101,46,78,114,100,0,0,0,114,101,0, + 0,0,114,102,0,0,0,114,103,0,0,0,122,18,60,109, + 111,100,117,108,101,32,123,33,114,125,32,40,123,125,41,62, + 41,5,114,17,0,0,0,114,113,0,0,0,114,109,0,0, + 0,114,45,0,0,0,114,124,0,0,0,41,2,114,95,0, + 0,0,114,17,0,0,0,114,10,0,0,0,114,10,0,0, + 0,114,11,0,0,0,114,107,0,0,0,54,2,0,0,115, + 16,0,0,0,0,3,20,1,10,1,10,1,10,2,16,2, + 6,1,14,2,114,107,0,0,0,99,2,0,0,0,0,0, + 0,0,4,0,0,0,10,0,0,0,67,0,0,0,115,204, + 0,0,0,124,0,106,0,125,2,116,1,124,2,131,1,143, + 180,1,0,116,2,106,3,160,4,124,2,161,1,124,1,107, + 9,114,54,100,1,160,5,124,2,161,1,125,3,116,6,124, + 3,124,2,100,2,141,2,130,1,122,106,124,0,106,7,100, + 3,107,8,114,106,124,0,106,8,100,3,107,8,114,90,116, + 6,100,4,124,0,106,0,100,2,141,2,130,1,116,9,124, + 0,124,1,100,5,100,6,141,3,1,0,110,52,116,9,124, + 0,124,1,100,5,100,6,141,3,1,0,116,10,124,0,106, + 7,100,7,131,2,115,146,124,0,106,7,160,11,124,2,161, + 1,1,0,110,12,124,0,106,7,160,12,124,1,161,1,1, + 0,87,0,53,0,116,2,106,3,160,13,124,0,106,0,161, + 1,125,1,124,1,116,2,106,3,124,0,106,0,60,0,88, + 0,87,0,53,0,81,0,82,0,88,0,124,1,83,0,41, + 8,122,70,69,120,101,99,117,116,101,32,116,104,101,32,115, + 112,101,99,39,115,32,115,112,101,99,105,102,105,101,100,32, + 109,111,100,117,108,101,32,105,110,32,97,110,32,101,120,105, + 115,116,105,110,103,32,109,111,100,117,108,101,39,115,32,110, + 97,109,101,115,112,97,99,101,46,122,30,109,111,100,117,108, + 101,32,123,33,114,125,32,110,111,116,32,105,110,32,115,121, + 115,46,109,111,100,117,108,101,115,114,16,0,0,0,78,250, + 14,109,105,115,115,105,110,103,32,108,111,97,100,101,114,84, + 114,142,0,0,0,114,149,0,0,0,41,14,114,17,0,0, + 0,114,50,0,0,0,114,15,0,0,0,114,92,0,0,0, + 114,34,0,0,0,114,45,0,0,0,114,79,0,0,0,114, + 109,0,0,0,114,117,0,0,0,114,147,0,0,0,114,4, + 0,0,0,218,11,108,111,97,100,95,109,111,100,117,108,101, + 114,149,0,0,0,218,3,112,111,112,41,4,114,95,0,0, + 0,114,96,0,0,0,114,17,0,0,0,218,3,109,115,103, 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,114, - 128,0,0,0,234,2,0,0,115,10,0,0,0,0,3,12, - 1,12,1,4,255,6,2,122,29,66,117,105,108,116,105,110, - 73,109,112,111,114,116,101,114,46,99,114,101,97,116,101,95, - 109,111,100,117,108,101,99,2,0,0,0,0,0,0,0,2, - 0,0,0,3,0,0,0,67,0,0,0,115,16,0,0,0, - 116,0,116,1,106,2,124,1,131,2,1,0,100,1,83,0, - 41,2,122,22,69,120,101,99,32,97,32,98,117,105,108,116, - 45,105,110,32,109,111,100,117,108,101,78,41,3,114,59,0, - 0,0,114,49,0,0,0,90,12,101,120,101,99,95,98,117, - 105,108,116,105,110,41,2,114,26,0,0,0,114,83,0,0, - 0,114,10,0,0,0,114,10,0,0,0,114,11,0,0,0, - 114,129,0,0,0,242,2,0,0,115,2,0,0,0,0,3, - 122,27,66,117,105,108,116,105,110,73,109,112,111,114,116,101, - 114,46,101,120,101,99,95,109,111,100,117,108,101,99,2,0, - 0,0,0,0,0,0,2,0,0,0,1,0,0,0,67,0, - 0,0,115,4,0,0,0,100,1,83,0,41,2,122,57,82, - 101,116,117,114,110,32,78,111,110,101,32,97,115,32,98,117, - 105,108,116,45,105,110,32,109,111,100,117,108,101,115,32,100, - 111,32,110,111,116,32,104,97,118,101,32,99,111,100,101,32, - 111,98,106,101,99,116,115,46,78,114,10,0,0,0,41,2, - 114,137,0,0,0,114,71,0,0,0,114,10,0,0,0,114, - 10,0,0,0,114,11,0,0,0,218,8,103,101,116,95,99, - 111,100,101,247,2,0,0,115,2,0,0,0,0,4,122,24, - 66,117,105,108,116,105,110,73,109,112,111,114,116,101,114,46, - 103,101,116,95,99,111,100,101,99,2,0,0,0,0,0,0, - 0,2,0,0,0,1,0,0,0,67,0,0,0,115,4,0, - 0,0,100,1,83,0,41,2,122,56,82,101,116,117,114,110, - 32,78,111,110,101,32,97,115,32,98,117,105,108,116,45,105, - 110,32,109,111,100,117,108,101,115,32,100,111,32,110,111,116, - 32,104,97,118,101,32,115,111,117,114,99,101,32,99,111,100, - 101,46,78,114,10,0,0,0,41,2,114,137,0,0,0,114, - 71,0,0,0,114,10,0,0,0,114,10,0,0,0,114,11, - 0,0,0,218,10,103,101,116,95,115,111,117,114,99,101,253, - 2,0,0,115,2,0,0,0,0,4,122,26,66,117,105,108, - 116,105,110,73,109,112,111,114,116,101,114,46,103,101,116,95, - 115,111,117,114,99,101,99,2,0,0,0,0,0,0,0,2, - 0,0,0,1,0,0,0,67,0,0,0,115,4,0,0,0, - 100,1,83,0,41,2,122,52,82,101,116,117,114,110,32,70, - 97,108,115,101,32,97,115,32,98,117,105,108,116,45,105,110, - 32,109,111,100,117,108,101,115,32,97,114,101,32,110,101,118, - 101,114,32,112,97,99,107,97,103,101,115,46,70,114,10,0, - 0,0,41,2,114,137,0,0,0,114,71,0,0,0,114,10, - 0,0,0,114,10,0,0,0,114,11,0,0,0,114,99,0, - 0,0,3,3,0,0,115,2,0,0,0,0,4,122,26,66, - 117,105,108,116,105,110,73,109,112,111,114,116,101,114,46,105, - 115,95,112,97,99,107,97,103,101,41,2,78,78,41,1,78, - 41,17,114,1,0,0,0,114,0,0,0,0,114,2,0,0, - 0,114,3,0,0,0,218,12,115,116,97,116,105,99,109,101, - 116,104,111,100,114,86,0,0,0,218,11,99,108,97,115,115, - 109,101,116,104,111,100,114,140,0,0,0,114,141,0,0,0, - 114,128,0,0,0,114,129,0,0,0,114,74,0,0,0,114, - 142,0,0,0,114,143,0,0,0,114,99,0,0,0,114,84, - 0,0,0,114,131,0,0,0,114,10,0,0,0,114,10,0, - 0,0,114,10,0,0,0,114,11,0,0,0,114,136,0,0, - 0,195,2,0,0,115,42,0,0,0,8,7,4,2,2,1, - 10,8,2,1,12,8,2,1,12,11,2,1,10,7,2,1, - 10,4,2,1,2,1,12,4,2,1,2,1,12,4,2,1, - 2,1,12,4,114,136,0,0,0,99,0,0,0,0,0,0, - 0,0,0,0,0,0,4,0,0,0,64,0,0,0,115,140, - 0,0,0,101,0,90,1,100,0,90,2,100,1,90,3,101, - 4,100,2,100,3,132,0,131,1,90,5,101,6,100,21,100, - 5,100,6,132,1,131,1,90,7,101,6,100,22,100,7,100, - 8,132,1,131,1,90,8,101,6,100,9,100,10,132,0,131, - 1,90,9,101,4,100,11,100,12,132,0,131,1,90,10,101, - 6,100,13,100,14,132,0,131,1,90,11,101,6,101,12,100, - 15,100,16,132,0,131,1,131,1,90,13,101,6,101,12,100, - 17,100,18,132,0,131,1,131,1,90,14,101,6,101,12,100, - 19,100,20,132,0,131,1,131,1,90,15,100,4,83,0,41, - 23,218,14,70,114,111,122,101,110,73,109,112,111,114,116,101, - 114,122,142,77,101,116,97,32,112,97,116,104,32,105,109,112, - 111,114,116,32,102,111,114,32,102,114,111,122,101,110,32,109, + 93,0,0,0,71,2,0,0,115,34,0,0,0,0,2,6, + 1,10,1,16,1,10,1,12,1,2,1,10,1,10,1,14, + 2,16,2,14,1,12,4,14,2,16,4,14,1,24,1,114, + 93,0,0,0,99,1,0,0,0,0,0,0,0,2,0,0, + 0,8,0,0,0,67,0,0,0,115,26,1,0,0,122,18, + 124,0,106,0,160,1,124,0,106,2,161,1,1,0,87,0, + 110,52,1,0,1,0,1,0,124,0,106,2,116,3,106,4, + 107,6,114,64,116,3,106,4,160,5,124,0,106,2,161,1, + 125,1,124,1,116,3,106,4,124,0,106,2,60,0,130,0, + 89,0,110,2,88,0,116,3,106,4,160,5,124,0,106,2, + 161,1,125,1,124,1,116,3,106,4,124,0,106,2,60,0, + 116,6,124,1,100,1,100,0,131,3,100,0,107,8,114,148, + 122,12,124,0,106,0,124,1,95,7,87,0,110,20,4,0, + 116,8,107,10,114,146,1,0,1,0,1,0,89,0,110,2, + 88,0,116,6,124,1,100,2,100,0,131,3,100,0,107,8, + 114,226,122,40,124,1,106,9,124,1,95,10,116,11,124,1, + 100,3,131,2,115,202,124,0,106,2,160,12,100,4,161,1, + 100,5,25,0,124,1,95,10,87,0,110,20,4,0,116,8, + 107,10,114,224,1,0,1,0,1,0,89,0,110,2,88,0, + 116,6,124,1,100,6,100,0,131,3,100,0,107,8,144,1, + 114,22,122,10,124,0,124,1,95,13,87,0,110,22,4,0, + 116,8,107,10,144,1,114,20,1,0,1,0,1,0,89,0, + 110,2,88,0,124,1,83,0,41,7,78,114,98,0,0,0, + 114,144,0,0,0,114,140,0,0,0,114,128,0,0,0,114, + 22,0,0,0,114,105,0,0,0,41,14,114,109,0,0,0, + 114,153,0,0,0,114,17,0,0,0,114,15,0,0,0,114, + 92,0,0,0,114,154,0,0,0,114,6,0,0,0,114,98, + 0,0,0,114,106,0,0,0,114,1,0,0,0,114,144,0, + 0,0,114,4,0,0,0,114,129,0,0,0,114,105,0,0, + 0,114,150,0,0,0,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,218,25,95,108,111,97,100,95,98,97,99, + 107,119,97,114,100,95,99,111,109,112,97,116,105,98,108,101, + 101,2,0,0,115,54,0,0,0,0,4,2,1,18,1,6, + 1,12,1,14,1,12,1,8,3,14,1,12,1,16,1,2, + 1,12,1,14,1,6,1,16,1,2,4,8,1,10,1,22, + 1,14,1,6,1,18,1,2,1,10,1,16,1,6,1,114, + 156,0,0,0,99,1,0,0,0,0,0,0,0,2,0,0, + 0,11,0,0,0,67,0,0,0,115,220,0,0,0,124,0, + 106,0,100,0,107,9,114,30,116,1,124,0,106,0,100,1, + 131,2,115,30,116,2,124,0,131,1,83,0,116,3,124,0, + 131,1,125,1,100,2,124,0,95,4,122,162,124,1,116,5, + 106,6,124,0,106,7,60,0,122,52,124,0,106,0,100,0, + 107,8,114,96,124,0,106,8,100,0,107,8,114,108,116,9, + 100,3,124,0,106,7,100,4,141,2,130,1,110,12,124,0, + 106,0,160,10,124,1,161,1,1,0,87,0,110,50,1,0, + 1,0,1,0,122,14,116,5,106,6,124,0,106,7,61,0, + 87,0,110,20,4,0,116,11,107,10,114,152,1,0,1,0, + 1,0,89,0,110,2,88,0,130,0,89,0,110,2,88,0, + 116,5,106,6,160,12,124,0,106,7,161,1,125,1,124,1, + 116,5,106,6,124,0,106,7,60,0,116,13,100,5,124,0, + 106,7,124,0,106,0,131,3,1,0,87,0,53,0,100,6, + 124,0,95,4,88,0,124,1,83,0,41,7,78,114,149,0, + 0,0,84,114,152,0,0,0,114,16,0,0,0,122,18,105, + 109,112,111,114,116,32,123,33,114,125,32,35,32,123,33,114, + 125,70,41,14,114,109,0,0,0,114,4,0,0,0,114,156, + 0,0,0,114,151,0,0,0,90,13,95,105,110,105,116,105, + 97,108,105,122,105,110,103,114,15,0,0,0,114,92,0,0, + 0,114,17,0,0,0,114,117,0,0,0,114,79,0,0,0, + 114,149,0,0,0,114,63,0,0,0,114,154,0,0,0,114, + 76,0,0,0,114,150,0,0,0,114,10,0,0,0,114,10, + 0,0,0,114,11,0,0,0,218,14,95,108,111,97,100,95, + 117,110,108,111,99,107,101,100,138,2,0,0,115,46,0,0, + 0,0,2,10,2,12,1,8,2,8,5,6,1,2,1,12, + 1,2,1,10,1,10,1,16,3,16,1,6,1,2,1,14, + 1,14,1,6,1,8,5,14,1,12,1,20,2,8,2,114, + 157,0,0,0,99,1,0,0,0,0,0,0,0,1,0,0, + 0,10,0,0,0,67,0,0,0,115,42,0,0,0,116,0, + 124,0,106,1,131,1,143,22,1,0,116,2,124,0,131,1, + 87,0,2,0,53,0,81,0,82,0,163,0,83,0,81,0, + 82,0,88,0,100,1,83,0,41,2,122,191,82,101,116,117, + 114,110,32,97,32,110,101,119,32,109,111,100,117,108,101,32, + 111,98,106,101,99,116,44,32,108,111,97,100,101,100,32,98, + 121,32,116,104,101,32,115,112,101,99,39,115,32,108,111,97, + 100,101,114,46,10,10,32,32,32,32,84,104,101,32,109,111, + 100,117,108,101,32,105,115,32,110,111,116,32,97,100,100,101, + 100,32,116,111,32,105,116,115,32,112,97,114,101,110,116,46, + 10,10,32,32,32,32,73,102,32,97,32,109,111,100,117,108, + 101,32,105,115,32,97,108,114,101,97,100,121,32,105,110,32, + 115,121,115,46,109,111,100,117,108,101,115,44,32,116,104,97, + 116,32,101,120,105,115,116,105,110,103,32,109,111,100,117,108, + 101,32,103,101,116,115,10,32,32,32,32,99,108,111,98,98, + 101,114,101,100,46,10,10,32,32,32,32,78,41,3,114,50, + 0,0,0,114,17,0,0,0,114,157,0,0,0,41,1,114, + 95,0,0,0,114,10,0,0,0,114,10,0,0,0,114,11, + 0,0,0,114,94,0,0,0,180,2,0,0,115,4,0,0, + 0,0,9,12,1,114,94,0,0,0,99,0,0,0,0,0, + 0,0,0,0,0,0,0,4,0,0,0,64,0,0,0,115, + 136,0,0,0,101,0,90,1,100,0,90,2,100,1,90,3, + 101,4,100,2,100,3,132,0,131,1,90,5,101,6,100,19, + 100,5,100,6,132,1,131,1,90,7,101,6,100,20,100,7, + 100,8,132,1,131,1,90,8,101,6,100,9,100,10,132,0, + 131,1,90,9,101,6,100,11,100,12,132,0,131,1,90,10, + 101,6,101,11,100,13,100,14,132,0,131,1,131,1,90,12, + 101,6,101,11,100,15,100,16,132,0,131,1,131,1,90,13, + 101,6,101,11,100,17,100,18,132,0,131,1,131,1,90,14, + 101,6,101,15,131,1,90,16,100,4,83,0,41,21,218,15, + 66,117,105,108,116,105,110,73,109,112,111,114,116,101,114,122, + 144,77,101,116,97,32,112,97,116,104,32,105,109,112,111,114, + 116,32,102,111,114,32,98,117,105,108,116,45,105,110,32,109, 111,100,117,108,101,115,46,10,10,32,32,32,32,65,108,108, 32,109,101,116,104,111,100,115,32,97,114,101,32,101,105,116, 104,101,114,32,99,108,97,115,115,32,111,114,32,115,116,97, @@ -1186,610 +1033,736 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 32,116,104,101,32,99,108,97,115,115,46,10,10,32,32,32, 32,99,1,0,0,0,0,0,0,0,1,0,0,0,3,0, 0,0,67,0,0,0,115,12,0,0,0,100,1,160,0,124, - 0,106,1,161,1,83,0,41,2,122,115,82,101,116,117,114, + 0,106,1,161,1,83,0,41,2,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,22, - 60,109,111,100,117,108,101,32,123,33,114,125,32,40,102,114, - 111,122,101,110,41,62,41,2,114,38,0,0,0,114,1,0, - 0,0,41,1,218,1,109,114,10,0,0,0,114,10,0,0, - 0,114,11,0,0,0,114,86,0,0,0,21,3,0,0,115, - 2,0,0,0,0,7,122,26,70,114,111,122,101,110,73,109, - 112,111,114,116,101,114,46,109,111,100,117,108,101,95,114,101, - 112,114,78,99,4,0,0,0,0,0,0,0,4,0,0,0, - 5,0,0,0,67,0,0,0,115,32,0,0,0,116,0,160, - 1,124,1,161,1,114,24,116,2,124,1,124,0,100,1,100, - 2,141,3,83,0,100,0,83,0,100,0,83,0,41,3,78, - 90,6,102,114,111,122,101,110,41,1,114,97,0,0,0,41, - 3,114,49,0,0,0,114,75,0,0,0,114,78,0,0,0, - 41,4,114,137,0,0,0,114,71,0,0,0,114,138,0,0, - 0,114,139,0,0,0,114,10,0,0,0,114,10,0,0,0, - 114,11,0,0,0,114,140,0,0,0,30,3,0,0,115,6, - 0,0,0,0,2,10,1,14,2,122,24,70,114,111,122,101, - 110,73,109,112,111,114,116,101,114,46,102,105,110,100,95,115, - 112,101,99,99,3,0,0,0,0,0,0,0,3,0,0,0, - 3,0,0,0,67,0,0,0,115,18,0,0,0,116,0,160, - 1,124,1,161,1,114,14,124,0,83,0,100,1,83,0,41, - 2,122,93,70,105,110,100,32,97,32,102,114,111,122,101,110, - 32,109,111,100,117,108,101,46,10,10,32,32,32,32,32,32, - 32,32,84,104,105,115,32,109,101,116,104,111,100,32,105,115, - 32,100,101,112,114,101,99,97,116,101,100,46,32,32,85,115, - 101,32,102,105,110,100,95,115,112,101,99,40,41,32,105,110, - 115,116,101,97,100,46,10,10,32,32,32,32,32,32,32,32, - 78,41,2,114,49,0,0,0,114,75,0,0,0,41,3,114, - 137,0,0,0,114,71,0,0,0,114,138,0,0,0,114,10, - 0,0,0,114,10,0,0,0,114,11,0,0,0,114,141,0, - 0,0,37,3,0,0,115,2,0,0,0,0,7,122,26,70, - 114,111,122,101,110,73,109,112,111,114,116,101,114,46,102,105, - 110,100,95,109,111,100,117,108,101,99,2,0,0,0,0,0, - 0,0,2,0,0,0,1,0,0,0,67,0,0,0,115,4, - 0,0,0,100,1,83,0,41,2,122,42,85,115,101,32,100, - 101,102,97,117,108,116,32,115,101,109,97,110,116,105,99,115, - 32,102,111,114,32,109,111,100,117,108,101,32,99,114,101,97, - 116,105,111,110,46,78,114,10,0,0,0,41,2,114,137,0, - 0,0,114,82,0,0,0,114,10,0,0,0,114,10,0,0, - 0,114,11,0,0,0,114,128,0,0,0,46,3,0,0,115, - 2,0,0,0,0,2,122,28,70,114,111,122,101,110,73,109, - 112,111,114,116,101,114,46,99,114,101,97,116,101,95,109,111, - 100,117,108,101,99,1,0,0,0,0,0,0,0,3,0,0, - 0,4,0,0,0,67,0,0,0,115,64,0,0,0,124,0, - 106,0,106,1,125,1,116,2,160,3,124,1,161,1,115,36, - 116,4,100,1,160,5,124,1,161,1,124,1,100,2,141,2, - 130,1,116,6,116,2,106,7,124,1,131,2,125,2,116,8, - 124,2,124,0,106,9,131,2,1,0,100,0,83,0,41,3, - 78,122,27,123,33,114,125,32,105,115,32,110,111,116,32,97, - 32,102,114,111,122,101,110,32,109,111,100,117,108,101,41,1, - 114,15,0,0,0,41,10,114,89,0,0,0,114,15,0,0, - 0,114,49,0,0,0,114,75,0,0,0,114,70,0,0,0, - 114,38,0,0,0,114,59,0,0,0,218,17,103,101,116,95, - 102,114,111,122,101,110,95,111,98,106,101,99,116,218,4,101, - 120,101,99,114,7,0,0,0,41,3,114,83,0,0,0,114, - 15,0,0,0,218,4,99,111,100,101,114,10,0,0,0,114, - 10,0,0,0,114,11,0,0,0,114,129,0,0,0,50,3, - 0,0,115,14,0,0,0,0,2,8,1,10,1,10,1,2, - 255,6,2,12,1,122,26,70,114,111,122,101,110,73,109,112, - 111,114,116,101,114,46,101,120,101,99,95,109,111,100,117,108, - 101,99,2,0,0,0,0,0,0,0,2,0,0,0,3,0, - 0,0,67,0,0,0,115,10,0,0,0,116,0,124,0,124, - 1,131,2,83,0,41,1,122,95,76,111,97,100,32,97,32, - 102,114,111,122,101,110,32,109,111,100,117,108,101,46,10,10, - 32,32,32,32,32,32,32,32,84,104,105,115,32,109,101,116, - 104,111,100,32,105,115,32,100,101,112,114,101,99,97,116,101, - 100,46,32,32,85,115,101,32,101,120,101,99,95,109,111,100, - 117,108,101,40,41,32,105,110,115,116,101,97,100,46,10,10, - 32,32,32,32,32,32,32,32,41,1,114,84,0,0,0,41, - 2,114,137,0,0,0,114,71,0,0,0,114,10,0,0,0, - 114,10,0,0,0,114,11,0,0,0,114,131,0,0,0,59, - 3,0,0,115,2,0,0,0,0,7,122,26,70,114,111,122, - 101,110,73,109,112,111,114,116,101,114,46,108,111,97,100,95, - 109,111,100,117,108,101,99,2,0,0,0,0,0,0,0,2, - 0,0,0,3,0,0,0,67,0,0,0,115,10,0,0,0, - 116,0,160,1,124,1,161,1,83,0,41,1,122,45,82,101, - 116,117,114,110,32,116,104,101,32,99,111,100,101,32,111,98, - 106,101,99,116,32,102,111,114,32,116,104,101,32,102,114,111, - 122,101,110,32,109,111,100,117,108,101,46,41,2,114,49,0, - 0,0,114,148,0,0,0,41,2,114,137,0,0,0,114,71, + 101,108,102,46,10,10,32,32,32,32,32,32,32,32,122,24, + 60,109,111,100,117,108,101,32,123,33,114,125,32,40,98,117, + 105,108,116,45,105,110,41,62,169,2,114,45,0,0,0,114, + 1,0,0,0,41,1,114,96,0,0,0,114,10,0,0,0, + 114,10,0,0,0,114,11,0,0,0,114,99,0,0,0,204, + 2,0,0,115,2,0,0,0,0,7,122,27,66,117,105,108, + 116,105,110,73,109,112,111,114,116,101,114,46,109,111,100,117, + 108,101,95,114,101,112,114,78,99,4,0,0,0,0,0,0, + 0,4,0,0,0,5,0,0,0,67,0,0,0,115,44,0, + 0,0,124,2,100,0,107,9,114,12,100,0,83,0,116,0, + 160,1,124,1,161,1,114,36,116,2,124,1,124,0,100,1, + 100,2,141,3,83,0,100,0,83,0,100,0,83,0,41,3, + 78,122,8,98,117,105,108,116,45,105,110,114,137,0,0,0, + 41,3,114,57,0,0,0,90,10,105,115,95,98,117,105,108, + 116,105,110,114,91,0,0,0,169,4,218,3,99,108,115,114, + 81,0,0,0,218,4,112,97,116,104,218,6,116,97,114,103, + 101,116,114,10,0,0,0,114,10,0,0,0,114,11,0,0, + 0,218,9,102,105,110,100,95,115,112,101,99,213,2,0,0, + 115,10,0,0,0,0,2,8,1,4,1,10,1,14,2,122, + 25,66,117,105,108,116,105,110,73,109,112,111,114,116,101,114, + 46,102,105,110,100,95,115,112,101,99,99,3,0,0,0,0, + 0,0,0,4,0,0,0,4,0,0,0,67,0,0,0,115, + 30,0,0,0,124,0,160,0,124,1,124,2,161,2,125,3, + 124,3,100,1,107,9,114,26,124,3,106,1,83,0,100,1, + 83,0,41,2,122,175,70,105,110,100,32,116,104,101,32,98, + 117,105,108,116,45,105,110,32,109,111,100,117,108,101,46,10, + 10,32,32,32,32,32,32,32,32,73,102,32,39,112,97,116, + 104,39,32,105,115,32,101,118,101,114,32,115,112,101,99,105, + 102,105,101,100,32,116,104,101,110,32,116,104,101,32,115,101, + 97,114,99,104,32,105,115,32,99,111,110,115,105,100,101,114, + 101,100,32,97,32,102,97,105,108,117,114,101,46,10,10,32, + 32,32,32,32,32,32,32,84,104,105,115,32,109,101,116,104, + 111,100,32,105,115,32,100,101,112,114,101,99,97,116,101,100, + 46,32,32,85,115,101,32,102,105,110,100,95,115,112,101,99, + 40,41,32,105,110,115,116,101,97,100,46,10,10,32,32,32, + 32,32,32,32,32,78,41,2,114,165,0,0,0,114,109,0, + 0,0,41,4,114,162,0,0,0,114,81,0,0,0,114,163, + 0,0,0,114,95,0,0,0,114,10,0,0,0,114,10,0, + 0,0,114,11,0,0,0,218,11,102,105,110,100,95,109,111, + 100,117,108,101,222,2,0,0,115,4,0,0,0,0,9,12, + 1,122,27,66,117,105,108,116,105,110,73,109,112,111,114,116, + 101,114,46,102,105,110,100,95,109,111,100,117,108,101,99,2, + 0,0,0,0,0,0,0,2,0,0,0,4,0,0,0,67, + 0,0,0,115,46,0,0,0,124,1,106,0,116,1,106,2, + 107,7,114,34,116,3,100,1,160,4,124,1,106,0,161,1, + 124,1,106,0,100,2,141,2,130,1,116,5,116,6,106,7, + 124,1,131,2,83,0,41,3,122,24,67,114,101,97,116,101, + 32,97,32,98,117,105,108,116,45,105,110,32,109,111,100,117, + 108,101,114,77,0,0,0,114,16,0,0,0,41,8,114,17, + 0,0,0,114,15,0,0,0,114,78,0,0,0,114,79,0, + 0,0,114,45,0,0,0,114,67,0,0,0,114,57,0,0, + 0,90,14,99,114,101,97,116,101,95,98,117,105,108,116,105, + 110,41,2,114,30,0,0,0,114,95,0,0,0,114,10,0, + 0,0,114,10,0,0,0,114,11,0,0,0,114,148,0,0, + 0,234,2,0,0,115,10,0,0,0,0,3,12,1,12,1, + 4,255,6,2,122,29,66,117,105,108,116,105,110,73,109,112, + 111,114,116,101,114,46,99,114,101,97,116,101,95,109,111,100, + 117,108,101,99,2,0,0,0,0,0,0,0,2,0,0,0, + 3,0,0,0,67,0,0,0,115,16,0,0,0,116,0,116, + 1,106,2,124,1,131,2,1,0,100,1,83,0,41,2,122, + 22,69,120,101,99,32,97,32,98,117,105,108,116,45,105,110, + 32,109,111,100,117,108,101,78,41,3,114,67,0,0,0,114, + 57,0,0,0,90,12,101,120,101,99,95,98,117,105,108,116, + 105,110,41,2,114,30,0,0,0,114,96,0,0,0,114,10, + 0,0,0,114,10,0,0,0,114,11,0,0,0,114,149,0, + 0,0,242,2,0,0,115,2,0,0,0,0,3,122,27,66, + 117,105,108,116,105,110,73,109,112,111,114,116,101,114,46,101, + 120,101,99,95,109,111,100,117,108,101,99,2,0,0,0,0, + 0,0,0,2,0,0,0,1,0,0,0,67,0,0,0,115, + 4,0,0,0,100,1,83,0,41,2,122,57,82,101,116,117, + 114,110,32,78,111,110,101,32,97,115,32,98,117,105,108,116, + 45,105,110,32,109,111,100,117,108,101,115,32,100,111,32,110, + 111,116,32,104,97,118,101,32,99,111,100,101,32,111,98,106, + 101,99,116,115,46,78,114,10,0,0,0,169,2,114,162,0, + 0,0,114,81,0,0,0,114,10,0,0,0,114,10,0,0, + 0,114,11,0,0,0,218,8,103,101,116,95,99,111,100,101, + 247,2,0,0,115,2,0,0,0,0,4,122,24,66,117,105, + 108,116,105,110,73,109,112,111,114,116,101,114,46,103,101,116, + 95,99,111,100,101,99,2,0,0,0,0,0,0,0,2,0, + 0,0,1,0,0,0,67,0,0,0,115,4,0,0,0,100, + 1,83,0,41,2,122,56,82,101,116,117,114,110,32,78,111, + 110,101,32,97,115,32,98,117,105,108,116,45,105,110,32,109, + 111,100,117,108,101,115,32,100,111,32,110,111,116,32,104,97, + 118,101,32,115,111,117,114,99,101,32,99,111,100,101,46,78, + 114,10,0,0,0,114,167,0,0,0,114,10,0,0,0,114, + 10,0,0,0,114,11,0,0,0,218,10,103,101,116,95,115, + 111,117,114,99,101,253,2,0,0,115,2,0,0,0,0,4, + 122,26,66,117,105,108,116,105,110,73,109,112,111,114,116,101, + 114,46,103,101,116,95,115,111,117,114,99,101,99,2,0,0, + 0,0,0,0,0,2,0,0,0,1,0,0,0,67,0,0, + 0,115,4,0,0,0,100,1,83,0,41,2,122,52,82,101, + 116,117,114,110,32,70,97,108,115,101,32,97,115,32,98,117, + 105,108,116,45,105,110,32,109,111,100,117,108,101,115,32,97, + 114,101,32,110,101,118,101,114,32,112,97,99,107,97,103,101, + 115,46,70,114,10,0,0,0,114,167,0,0,0,114,10,0, + 0,0,114,10,0,0,0,114,11,0,0,0,114,115,0,0, + 0,3,3,0,0,115,2,0,0,0,0,4,122,26,66,117, + 105,108,116,105,110,73,109,112,111,114,116,101,114,46,105,115, + 95,112,97,99,107,97,103,101,41,2,78,78,41,1,78,41, + 17,114,1,0,0,0,114,0,0,0,0,114,2,0,0,0, + 114,3,0,0,0,218,12,115,116,97,116,105,99,109,101,116, + 104,111,100,114,99,0,0,0,218,11,99,108,97,115,115,109, + 101,116,104,111,100,114,165,0,0,0,114,166,0,0,0,114, + 148,0,0,0,114,149,0,0,0,114,86,0,0,0,114,168, + 0,0,0,114,169,0,0,0,114,115,0,0,0,114,97,0, + 0,0,114,153,0,0,0,114,10,0,0,0,114,10,0,0, + 0,114,10,0,0,0,114,11,0,0,0,114,158,0,0,0, + 195,2,0,0,115,42,0,0,0,8,7,4,2,2,1,10, + 8,2,1,12,8,2,1,12,11,2,1,10,7,2,1,10, + 4,2,1,2,1,12,4,2,1,2,1,12,4,2,1,2, + 1,12,4,114,158,0,0,0,99,0,0,0,0,0,0,0, + 0,0,0,0,0,4,0,0,0,64,0,0,0,115,140,0, + 0,0,101,0,90,1,100,0,90,2,100,1,90,3,101,4, + 100,2,100,3,132,0,131,1,90,5,101,6,100,21,100,5, + 100,6,132,1,131,1,90,7,101,6,100,22,100,7,100,8, + 132,1,131,1,90,8,101,6,100,9,100,10,132,0,131,1, + 90,9,101,4,100,11,100,12,132,0,131,1,90,10,101,6, + 100,13,100,14,132,0,131,1,90,11,101,6,101,12,100,15, + 100,16,132,0,131,1,131,1,90,13,101,6,101,12,100,17, + 100,18,132,0,131,1,131,1,90,14,101,6,101,12,100,19, + 100,20,132,0,131,1,131,1,90,15,100,4,83,0,41,23, + 218,14,70,114,111,122,101,110,73,109,112,111,114,116,101,114, + 122,142,77,101,116,97,32,112,97,116,104,32,105,109,112,111, + 114,116,32,102,111,114,32,102,114,111,122,101,110,32,109,111, + 100,117,108,101,115,46,10,10,32,32,32,32,65,108,108,32, + 109,101,116,104,111,100,115,32,97,114,101,32,101,105,116,104, + 101,114,32,99,108,97,115,115,32,111,114,32,115,116,97,116, + 105,99,32,109,101,116,104,111,100,115,32,116,111,32,97,118, + 111,105,100,32,116,104,101,32,110,101,101,100,32,116,111,10, + 32,32,32,32,105,110,115,116,97,110,116,105,97,116,101,32, + 116,104,101,32,99,108,97,115,115,46,10,10,32,32,32,32, + 99,1,0,0,0,0,0,0,0,1,0,0,0,3,0,0, + 0,67,0,0,0,115,12,0,0,0,100,1,160,0,124,0, + 106,1,161,1,83,0,41,2,114,159,0,0,0,122,22,60, + 109,111,100,117,108,101,32,123,33,114,125,32,40,102,114,111, + 122,101,110,41,62,114,160,0,0,0,41,1,218,1,109,114, + 10,0,0,0,114,10,0,0,0,114,11,0,0,0,114,99, + 0,0,0,21,3,0,0,115,2,0,0,0,0,7,122,26, + 70,114,111,122,101,110,73,109,112,111,114,116,101,114,46,109, + 111,100,117,108,101,95,114,101,112,114,78,99,4,0,0,0, + 0,0,0,0,4,0,0,0,5,0,0,0,67,0,0,0, + 115,32,0,0,0,116,0,160,1,124,1,161,1,114,24,116, + 2,124,1,124,0,100,1,100,2,141,3,83,0,100,0,83, + 0,100,0,83,0,41,3,78,90,6,102,114,111,122,101,110, + 114,137,0,0,0,41,3,114,57,0,0,0,114,88,0,0, + 0,114,91,0,0,0,114,161,0,0,0,114,10,0,0,0, + 114,10,0,0,0,114,11,0,0,0,114,165,0,0,0,30, + 3,0,0,115,6,0,0,0,0,2,10,1,14,2,122,24, + 70,114,111,122,101,110,73,109,112,111,114,116,101,114,46,102, + 105,110,100,95,115,112,101,99,99,3,0,0,0,0,0,0, + 0,3,0,0,0,3,0,0,0,67,0,0,0,115,18,0, + 0,0,116,0,160,1,124,1,161,1,114,14,124,0,83,0, + 100,1,83,0,41,2,122,93,70,105,110,100,32,97,32,102, + 114,111,122,101,110,32,109,111,100,117,108,101,46,10,10,32, + 32,32,32,32,32,32,32,84,104,105,115,32,109,101,116,104, + 111,100,32,105,115,32,100,101,112,114,101,99,97,116,101,100, + 46,32,32,85,115,101,32,102,105,110,100,95,115,112,101,99, + 40,41,32,105,110,115,116,101,97,100,46,10,10,32,32,32, + 32,32,32,32,32,78,41,2,114,57,0,0,0,114,88,0, + 0,0,41,3,114,162,0,0,0,114,81,0,0,0,114,163, 0,0,0,114,10,0,0,0,114,10,0,0,0,114,11,0, - 0,0,114,142,0,0,0,68,3,0,0,115,2,0,0,0, - 0,4,122,23,70,114,111,122,101,110,73,109,112,111,114,116, - 101,114,46,103,101,116,95,99,111,100,101,99,2,0,0,0, - 0,0,0,0,2,0,0,0,1,0,0,0,67,0,0,0, - 115,4,0,0,0,100,1,83,0,41,2,122,54,82,101,116, - 117,114,110,32,78,111,110,101,32,97,115,32,102,114,111,122, - 101,110,32,109,111,100,117,108,101,115,32,100,111,32,110,111, - 116,32,104,97,118,101,32,115,111,117,114,99,101,32,99,111, - 100,101,46,78,114,10,0,0,0,41,2,114,137,0,0,0, - 114,71,0,0,0,114,10,0,0,0,114,10,0,0,0,114, - 11,0,0,0,114,143,0,0,0,74,3,0,0,115,2,0, - 0,0,0,4,122,25,70,114,111,122,101,110,73,109,112,111, - 114,116,101,114,46,103,101,116,95,115,111,117,114,99,101,99, - 2,0,0,0,0,0,0,0,2,0,0,0,3,0,0,0, - 67,0,0,0,115,10,0,0,0,116,0,160,1,124,1,161, - 1,83,0,41,1,122,46,82,101,116,117,114,110,32,84,114, - 117,101,32,105,102,32,116,104,101,32,102,114,111,122,101,110, - 32,109,111,100,117,108,101,32,105,115,32,97,32,112,97,99, - 107,97,103,101,46,41,2,114,49,0,0,0,90,17,105,115, - 95,102,114,111,122,101,110,95,112,97,99,107,97,103,101,41, - 2,114,137,0,0,0,114,71,0,0,0,114,10,0,0,0, - 114,10,0,0,0,114,11,0,0,0,114,99,0,0,0,80, - 3,0,0,115,2,0,0,0,0,4,122,25,70,114,111,122, - 101,110,73,109,112,111,114,116,101,114,46,105,115,95,112,97, - 99,107,97,103,101,41,2,78,78,41,1,78,41,16,114,1, - 0,0,0,114,0,0,0,0,114,2,0,0,0,114,3,0, - 0,0,114,144,0,0,0,114,86,0,0,0,114,145,0,0, - 0,114,140,0,0,0,114,141,0,0,0,114,128,0,0,0, - 114,129,0,0,0,114,131,0,0,0,114,77,0,0,0,114, - 142,0,0,0,114,143,0,0,0,114,99,0,0,0,114,10, + 0,0,114,166,0,0,0,37,3,0,0,115,2,0,0,0, + 0,7,122,26,70,114,111,122,101,110,73,109,112,111,114,116, + 101,114,46,102,105,110,100,95,109,111,100,117,108,101,99,2, + 0,0,0,0,0,0,0,2,0,0,0,1,0,0,0,67, + 0,0,0,115,4,0,0,0,100,1,83,0,41,2,122,42, + 85,115,101,32,100,101,102,97,117,108,116,32,115,101,109,97, + 110,116,105,99,115,32,102,111,114,32,109,111,100,117,108,101, + 32,99,114,101,97,116,105,111,110,46,78,114,10,0,0,0, + 41,2,114,162,0,0,0,114,95,0,0,0,114,10,0,0, + 0,114,10,0,0,0,114,11,0,0,0,114,148,0,0,0, + 46,3,0,0,115,2,0,0,0,0,2,122,28,70,114,111, + 122,101,110,73,109,112,111,114,116,101,114,46,99,114,101,97, + 116,101,95,109,111,100,117,108,101,99,1,0,0,0,0,0, + 0,0,3,0,0,0,4,0,0,0,67,0,0,0,115,64, + 0,0,0,124,0,106,0,106,1,125,1,116,2,160,3,124, + 1,161,1,115,36,116,4,100,1,160,5,124,1,161,1,124, + 1,100,2,141,2,130,1,116,6,116,2,106,7,124,1,131, + 2,125,2,116,8,124,2,124,0,106,9,131,2,1,0,100, + 0,83,0,114,87,0,0,0,41,10,114,105,0,0,0,114, + 17,0,0,0,114,57,0,0,0,114,88,0,0,0,114,79, + 0,0,0,114,45,0,0,0,114,67,0,0,0,218,17,103, + 101,116,95,102,114,111,122,101,110,95,111,98,106,101,99,116, + 218,4,101,120,101,99,114,7,0,0,0,41,3,114,96,0, + 0,0,114,17,0,0,0,218,4,99,111,100,101,114,10,0, + 0,0,114,10,0,0,0,114,11,0,0,0,114,149,0,0, + 0,50,3,0,0,115,14,0,0,0,0,2,8,1,10,1, + 10,1,2,255,6,2,12,1,122,26,70,114,111,122,101,110, + 73,109,112,111,114,116,101,114,46,101,120,101,99,95,109,111, + 100,117,108,101,99,2,0,0,0,0,0,0,0,2,0,0, + 0,3,0,0,0,67,0,0,0,115,10,0,0,0,116,0, + 124,0,124,1,131,2,83,0,41,1,122,95,76,111,97,100, + 32,97,32,102,114,111,122,101,110,32,109,111,100,117,108,101, + 46,10,10,32,32,32,32,32,32,32,32,84,104,105,115,32, + 109,101,116,104,111,100,32,105,115,32,100,101,112,114,101,99, + 97,116,101,100,46,32,32,85,115,101,32,101,120,101,99,95, + 109,111,100,117,108,101,40,41,32,105,110,115,116,101,97,100, + 46,10,10,32,32,32,32,32,32,32,32,41,1,114,97,0, + 0,0,114,167,0,0,0,114,10,0,0,0,114,10,0,0, + 0,114,11,0,0,0,114,153,0,0,0,59,3,0,0,115, + 2,0,0,0,0,7,122,26,70,114,111,122,101,110,73,109, + 112,111,114,116,101,114,46,108,111,97,100,95,109,111,100,117, + 108,101,99,2,0,0,0,0,0,0,0,2,0,0,0,3, + 0,0,0,67,0,0,0,115,10,0,0,0,116,0,160,1, + 124,1,161,1,83,0,41,1,122,45,82,101,116,117,114,110, + 32,116,104,101,32,99,111,100,101,32,111,98,106,101,99,116, + 32,102,111,114,32,116,104,101,32,102,114,111,122,101,110,32, + 109,111,100,117,108,101,46,41,2,114,57,0,0,0,114,174, + 0,0,0,114,167,0,0,0,114,10,0,0,0,114,10,0, + 0,0,114,11,0,0,0,114,168,0,0,0,68,3,0,0, + 115,2,0,0,0,0,4,122,23,70,114,111,122,101,110,73, + 109,112,111,114,116,101,114,46,103,101,116,95,99,111,100,101, + 99,2,0,0,0,0,0,0,0,2,0,0,0,1,0,0, + 0,67,0,0,0,115,4,0,0,0,100,1,83,0,41,2, + 122,54,82,101,116,117,114,110,32,78,111,110,101,32,97,115, + 32,102,114,111,122,101,110,32,109,111,100,117,108,101,115,32, + 100,111,32,110,111,116,32,104,97,118,101,32,115,111,117,114, + 99,101,32,99,111,100,101,46,78,114,10,0,0,0,114,167, 0,0,0,114,10,0,0,0,114,10,0,0,0,114,11,0, - 0,0,114,146,0,0,0,12,3,0,0,115,44,0,0,0, - 8,7,4,2,2,1,10,8,2,1,12,6,2,1,12,8, - 2,1,10,3,2,1,10,8,2,1,10,8,2,1,2,1, - 12,4,2,1,2,1,12,4,2,1,2,1,114,146,0,0, - 0,99,0,0,0,0,0,0,0,0,0,0,0,0,2,0, - 0,0,64,0,0,0,115,32,0,0,0,101,0,90,1,100, - 0,90,2,100,1,90,3,100,2,100,3,132,0,90,4,100, - 4,100,5,132,0,90,5,100,6,83,0,41,7,218,18,95, - 73,109,112,111,114,116,76,111,99,107,67,111,110,116,101,120, - 116,122,36,67,111,110,116,101,120,116,32,109,97,110,97,103, - 101,114,32,102,111,114,32,116,104,101,32,105,109,112,111,114, - 116,32,108,111,99,107,46,99,1,0,0,0,0,0,0,0, - 1,0,0,0,2,0,0,0,67,0,0,0,115,12,0,0, - 0,116,0,160,1,161,0,1,0,100,1,83,0,41,2,122, - 24,65,99,113,117,105,114,101,32,116,104,101,32,105,109,112, - 111,114,116,32,108,111,99,107,46,78,41,2,114,49,0,0, - 0,114,50,0,0,0,41,1,114,26,0,0,0,114,10,0, - 0,0,114,10,0,0,0,114,11,0,0,0,114,46,0,0, - 0,93,3,0,0,115,2,0,0,0,0,2,122,28,95,73, + 0,0,114,169,0,0,0,74,3,0,0,115,2,0,0,0, + 0,4,122,25,70,114,111,122,101,110,73,109,112,111,114,116, + 101,114,46,103,101,116,95,115,111,117,114,99,101,99,2,0, + 0,0,0,0,0,0,2,0,0,0,3,0,0,0,67,0, + 0,0,115,10,0,0,0,116,0,160,1,124,1,161,1,83, + 0,41,1,122,46,82,101,116,117,114,110,32,84,114,117,101, + 32,105,102,32,116,104,101,32,102,114,111,122,101,110,32,109, + 111,100,117,108,101,32,105,115,32,97,32,112,97,99,107,97, + 103,101,46,41,2,114,57,0,0,0,90,17,105,115,95,102, + 114,111,122,101,110,95,112,97,99,107,97,103,101,114,167,0, + 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, + 0,114,115,0,0,0,80,3,0,0,115,2,0,0,0,0, + 4,122,25,70,114,111,122,101,110,73,109,112,111,114,116,101, + 114,46,105,115,95,112,97,99,107,97,103,101,41,2,78,78, + 41,1,78,41,16,114,1,0,0,0,114,0,0,0,0,114, + 2,0,0,0,114,3,0,0,0,114,170,0,0,0,114,99, + 0,0,0,114,171,0,0,0,114,165,0,0,0,114,166,0, + 0,0,114,148,0,0,0,114,149,0,0,0,114,153,0,0, + 0,114,90,0,0,0,114,168,0,0,0,114,169,0,0,0, + 114,115,0,0,0,114,10,0,0,0,114,10,0,0,0,114, + 10,0,0,0,114,11,0,0,0,114,172,0,0,0,12,3, + 0,0,115,44,0,0,0,8,7,4,2,2,1,10,8,2, + 1,12,6,2,1,12,8,2,1,10,3,2,1,10,8,2, + 1,10,8,2,1,2,1,12,4,2,1,2,1,12,4,2, + 1,2,1,114,172,0,0,0,99,0,0,0,0,0,0,0, + 0,0,0,0,0,2,0,0,0,64,0,0,0,115,32,0, + 0,0,101,0,90,1,100,0,90,2,100,1,90,3,100,2, + 100,3,132,0,90,4,100,4,100,5,132,0,90,5,100,6, + 83,0,41,7,218,18,95,73,109,112,111,114,116,76,111,99, + 107,67,111,110,116,101,120,116,122,36,67,111,110,116,101,120, + 116,32,109,97,110,97,103,101,114,32,102,111,114,32,116,104, + 101,32,105,109,112,111,114,116,32,108,111,99,107,46,99,1, + 0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,67, + 0,0,0,115,12,0,0,0,116,0,160,1,161,0,1,0, + 100,1,83,0,41,2,122,24,65,99,113,117,105,114,101,32, + 116,104,101,32,105,109,112,111,114,116,32,108,111,99,107,46, + 78,41,2,114,57,0,0,0,114,58,0,0,0,114,47,0, + 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, + 0,114,54,0,0,0,93,3,0,0,115,2,0,0,0,0, + 2,122,28,95,73,109,112,111,114,116,76,111,99,107,67,111, + 110,116,101,120,116,46,95,95,101,110,116,101,114,95,95,99, + 4,0,0,0,0,0,0,0,4,0,0,0,2,0,0,0, + 67,0,0,0,115,12,0,0,0,116,0,160,1,161,0,1, + 0,100,1,83,0,41,2,122,60,82,101,108,101,97,115,101, + 32,116,104,101,32,105,109,112,111,114,116,32,108,111,99,107, + 32,114,101,103,97,114,100,108,101,115,115,32,111,102,32,97, + 110,121,32,114,97,105,115,101,100,32,101,120,99,101,112,116, + 105,111,110,115,46,78,41,2,114,57,0,0,0,114,60,0, + 0,0,41,4,114,30,0,0,0,90,8,101,120,99,95,116, + 121,112,101,90,9,101,120,99,95,118,97,108,117,101,90,13, + 101,120,99,95,116,114,97,99,101,98,97,99,107,114,10,0, + 0,0,114,10,0,0,0,114,11,0,0,0,114,56,0,0, + 0,97,3,0,0,115,2,0,0,0,0,2,122,27,95,73, 109,112,111,114,116,76,111,99,107,67,111,110,116,101,120,116, - 46,95,95,101,110,116,101,114,95,95,99,4,0,0,0,0, - 0,0,0,4,0,0,0,2,0,0,0,67,0,0,0,115, - 12,0,0,0,116,0,160,1,161,0,1,0,100,1,83,0, - 41,2,122,60,82,101,108,101,97,115,101,32,116,104,101,32, - 105,109,112,111,114,116,32,108,111,99,107,32,114,101,103,97, - 114,100,108,101,115,115,32,111,102,32,97,110,121,32,114,97, - 105,115,101,100,32,101,120,99,101,112,116,105,111,110,115,46, - 78,41,2,114,49,0,0,0,114,52,0,0,0,41,4,114, - 26,0,0,0,90,8,101,120,99,95,116,121,112,101,90,9, - 101,120,99,95,118,97,108,117,101,90,13,101,120,99,95,116, - 114,97,99,101,98,97,99,107,114,10,0,0,0,114,10,0, - 0,0,114,11,0,0,0,114,48,0,0,0,97,3,0,0, - 115,2,0,0,0,0,2,122,27,95,73,109,112,111,114,116, - 76,111,99,107,67,111,110,116,101,120,116,46,95,95,101,120, - 105,116,95,95,78,41,6,114,1,0,0,0,114,0,0,0, - 0,114,2,0,0,0,114,3,0,0,0,114,46,0,0,0, - 114,48,0,0,0,114,10,0,0,0,114,10,0,0,0,114, - 10,0,0,0,114,11,0,0,0,114,151,0,0,0,89,3, - 0,0,115,6,0,0,0,8,2,4,2,8,4,114,151,0, - 0,0,99,3,0,0,0,0,0,0,0,5,0,0,0,5, - 0,0,0,67,0,0,0,115,64,0,0,0,124,1,160,0, - 100,1,124,2,100,2,24,0,161,2,125,3,116,1,124,3, - 131,1,124,2,107,0,114,36,116,2,100,3,131,1,130,1, - 124,3,100,4,25,0,125,4,124,0,114,60,100,5,160,3, - 124,4,124,0,161,2,83,0,124,4,83,0,41,6,122,50, - 82,101,115,111,108,118,101,32,97,32,114,101,108,97,116,105, - 118,101,32,109,111,100,117,108,101,32,110,97,109,101,32,116, - 111,32,97,110,32,97,98,115,111,108,117,116,101,32,111,110, - 101,46,114,111,0,0,0,114,33,0,0,0,122,50,97,116, - 116,101,109,112,116,101,100,32,114,101,108,97,116,105,118,101, - 32,105,109,112,111,114,116,32,98,101,121,111,110,100,32,116, - 111,112,45,108,101,118,101,108,32,112,97,99,107,97,103,101, - 114,19,0,0,0,122,5,123,125,46,123,125,41,4,218,6, - 114,115,112,108,105,116,218,3,108,101,110,218,10,86,97,108, - 117,101,69,114,114,111,114,114,38,0,0,0,41,5,114,15, - 0,0,0,218,7,112,97,99,107,97,103,101,218,5,108,101, - 118,101,108,90,4,98,105,116,115,90,4,98,97,115,101,114, - 10,0,0,0,114,10,0,0,0,114,11,0,0,0,218,13, - 95,114,101,115,111,108,118,101,95,110,97,109,101,102,3,0, - 0,115,10,0,0,0,0,2,16,1,12,1,8,1,8,1, - 114,157,0,0,0,99,3,0,0,0,0,0,0,0,4,0, - 0,0,4,0,0,0,67,0,0,0,115,34,0,0,0,124, - 0,160,0,124,1,124,2,161,2,125,3,124,3,100,0,107, - 8,114,24,100,0,83,0,116,1,124,1,124,3,131,2,83, - 0,41,1,78,41,2,114,141,0,0,0,114,78,0,0,0, - 41,4,218,6,102,105,110,100,101,114,114,15,0,0,0,114, - 138,0,0,0,114,93,0,0,0,114,10,0,0,0,114,10, - 0,0,0,114,11,0,0,0,218,17,95,102,105,110,100,95, - 115,112,101,99,95,108,101,103,97,99,121,111,3,0,0,115, - 8,0,0,0,0,3,12,1,8,1,4,1,114,159,0,0, - 0,99,3,0,0,0,0,0,0,0,10,0,0,0,10,0, - 0,0,67,0,0,0,115,12,1,0,0,116,0,106,1,125, - 3,124,3,100,1,107,8,114,22,116,2,100,2,131,1,130, - 1,124,3,115,38,116,3,160,4,100,3,116,5,161,2,1, - 0,124,0,116,0,106,6,107,6,125,4,124,3,68,0,93, - 210,125,5,116,7,131,0,143,84,1,0,122,10,124,5,106, - 8,125,6,87,0,110,54,4,0,116,9,107,10,114,128,1, - 0,1,0,1,0,116,10,124,5,124,0,124,1,131,3,125, - 7,124,7,100,1,107,8,114,124,89,0,87,0,53,0,81, - 0,82,0,163,0,113,52,89,0,110,14,88,0,124,6,124, - 0,124,1,124,2,131,3,125,7,87,0,53,0,81,0,82, - 0,88,0,124,7,100,1,107,9,114,52,124,4,144,0,115, - 254,124,0,116,0,106,6,107,6,144,0,114,254,116,0,106, - 6,124,0,25,0,125,8,122,10,124,8,106,11,125,9,87, - 0,110,28,4,0,116,9,107,10,114,226,1,0,1,0,1, - 0,124,7,6,0,89,0,2,0,1,0,83,0,88,0,124, - 9,100,1,107,8,114,244,124,7,2,0,1,0,83,0,124, - 9,2,0,1,0,83,0,113,52,124,7,2,0,1,0,83, - 0,113,52,100,1,83,0,41,4,122,21,70,105,110,100,32, - 97,32,109,111,100,117,108,101,39,115,32,115,112,101,99,46, - 78,122,53,115,121,115,46,109,101,116,97,95,112,97,116,104, - 32,105,115,32,78,111,110,101,44,32,80,121,116,104,111,110, - 32,105,115,32,108,105,107,101,108,121,32,115,104,117,116,116, - 105,110,103,32,100,111,119,110,122,22,115,121,115,46,109,101, - 116,97,95,112,97,116,104,32,105,115,32,101,109,112,116,121, - 41,12,114,14,0,0,0,218,9,109,101,116,97,95,112,97, - 116,104,114,70,0,0,0,218,9,95,119,97,114,110,105,110, - 103,115,218,4,119,97,114,110,218,13,73,109,112,111,114,116, - 87,97,114,110,105,110,103,114,79,0,0,0,114,151,0,0, - 0,114,140,0,0,0,114,90,0,0,0,114,159,0,0,0, - 114,89,0,0,0,41,10,114,15,0,0,0,114,138,0,0, - 0,114,139,0,0,0,114,160,0,0,0,90,9,105,115,95, - 114,101,108,111,97,100,114,158,0,0,0,114,140,0,0,0, - 114,82,0,0,0,114,83,0,0,0,114,89,0,0,0,114, - 10,0,0,0,114,10,0,0,0,114,11,0,0,0,218,10, - 95,102,105,110,100,95,115,112,101,99,120,3,0,0,115,54, - 0,0,0,0,2,6,1,8,2,8,3,4,1,12,5,10, - 1,8,1,8,1,2,1,10,1,14,1,12,1,8,1,20, - 2,22,1,8,2,18,1,10,1,2,1,10,1,14,4,14, - 2,8,1,8,2,10,2,10,2,114,164,0,0,0,99,3, - 0,0,0,0,0,0,0,3,0,0,0,5,0,0,0,67, - 0,0,0,115,108,0,0,0,116,0,124,0,116,1,131,2, - 115,28,116,2,100,1,160,3,116,4,124,0,131,1,161,1, - 131,1,130,1,124,2,100,2,107,0,114,44,116,5,100,3, - 131,1,130,1,124,2,100,2,107,4,114,84,116,0,124,1, - 116,1,131,2,115,72,116,2,100,4,131,1,130,1,110,12, - 124,1,115,84,116,6,100,5,131,1,130,1,124,0,115,104, - 124,2,100,2,107,2,114,104,116,5,100,6,131,1,130,1, - 100,7,83,0,41,8,122,28,86,101,114,105,102,121,32,97, - 114,103,117,109,101,110,116,115,32,97,114,101,32,34,115,97, - 110,101,34,46,122,31,109,111,100,117,108,101,32,110,97,109, - 101,32,109,117,115,116,32,98,101,32,115,116,114,44,32,110, - 111,116,32,123,125,114,19,0,0,0,122,18,108,101,118,101, - 108,32,109,117,115,116,32,98,101,32,62,61,32,48,122,31, - 95,95,112,97,99,107,97,103,101,95,95,32,110,111,116,32, - 115,101,116,32,116,111,32,97,32,115,116,114,105,110,103,122, - 54,97,116,116,101,109,112,116,101,100,32,114,101,108,97,116, - 105,118,101,32,105,109,112,111,114,116,32,119,105,116,104,32, - 110,111,32,107,110,111,119,110,32,112,97,114,101,110,116,32, - 112,97,99,107,97,103,101,122,17,69,109,112,116,121,32,109, - 111,100,117,108,101,32,110,97,109,101,78,41,7,218,10,105, - 115,105,110,115,116,97,110,99,101,218,3,115,116,114,218,9, - 84,121,112,101,69,114,114,111,114,114,38,0,0,0,114,13, - 0,0,0,114,154,0,0,0,114,70,0,0,0,41,3,114, - 15,0,0,0,114,155,0,0,0,114,156,0,0,0,114,10, - 0,0,0,114,10,0,0,0,114,11,0,0,0,218,13,95, - 115,97,110,105,116,121,95,99,104,101,99,107,167,3,0,0, - 115,22,0,0,0,0,2,10,1,18,1,8,1,8,1,8, - 1,10,1,10,1,4,1,8,2,12,1,114,168,0,0,0, - 122,16,78,111,32,109,111,100,117,108,101,32,110,97,109,101, - 100,32,122,4,123,33,114,125,99,2,0,0,0,0,0,0, - 0,8,0,0,0,8,0,0,0,67,0,0,0,115,220,0, - 0,0,100,0,125,2,124,0,160,0,100,1,161,1,100,2, - 25,0,125,3,124,3,114,134,124,3,116,1,106,2,107,7, - 114,42,116,3,124,1,124,3,131,2,1,0,124,0,116,1, - 106,2,107,6,114,62,116,1,106,2,124,0,25,0,83,0, - 116,1,106,2,124,3,25,0,125,4,122,10,124,4,106,4, - 125,2,87,0,110,50,4,0,116,5,107,10,114,132,1,0, - 1,0,1,0,116,6,100,3,23,0,160,7,124,0,124,3, - 161,2,125,5,116,8,124,5,124,0,100,4,141,2,100,0, - 130,2,89,0,110,2,88,0,116,9,124,0,124,2,131,2, - 125,6,124,6,100,0,107,8,114,172,116,8,116,6,160,7, - 124,0,161,1,124,0,100,4,141,2,130,1,110,8,116,10, - 124,6,131,1,125,7,124,3,114,216,116,1,106,2,124,3, - 25,0,125,4,116,11,124,4,124,0,160,0,100,1,161,1, - 100,5,25,0,124,7,131,3,1,0,124,7,83,0,41,6, - 78,114,111,0,0,0,114,19,0,0,0,122,23,59,32,123, - 33,114,125,32,105,115,32,110,111,116,32,97,32,112,97,99, - 107,97,103,101,41,1,114,15,0,0,0,233,2,0,0,0, - 41,12,114,112,0,0,0,114,14,0,0,0,114,79,0,0, - 0,114,59,0,0,0,114,121,0,0,0,114,90,0,0,0, - 218,8,95,69,82,82,95,77,83,71,114,38,0,0,0,218, - 19,77,111,100,117,108,101,78,111,116,70,111,117,110,100,69, - 114,114,111,114,114,164,0,0,0,114,135,0,0,0,114,5, - 0,0,0,41,8,114,15,0,0,0,218,7,105,109,112,111, - 114,116,95,114,138,0,0,0,114,113,0,0,0,90,13,112, - 97,114,101,110,116,95,109,111,100,117,108,101,114,133,0,0, - 0,114,82,0,0,0,114,83,0,0,0,114,10,0,0,0, - 114,10,0,0,0,114,11,0,0,0,218,23,95,102,105,110, - 100,95,97,110,100,95,108,111,97,100,95,117,110,108,111,99, - 107,101,100,186,3,0,0,115,42,0,0,0,0,1,4,1, - 14,1,4,1,10,1,10,2,10,1,10,1,10,1,2,1, - 10,1,14,1,16,1,20,1,10,1,8,1,20,2,8,1, - 4,2,10,1,22,1,114,173,0,0,0,99,2,0,0,0, - 0,0,0,0,4,0,0,0,10,0,0,0,67,0,0,0, - 115,106,0,0,0,116,0,124,0,131,1,143,50,1,0,116, - 1,106,2,160,3,124,0,116,4,161,2,125,2,124,2,116, - 4,107,8,114,54,116,5,124,0,124,1,131,2,87,0,2, - 0,53,0,81,0,82,0,163,0,83,0,87,0,53,0,81, - 0,82,0,88,0,124,2,100,1,107,8,114,94,100,2,160, - 6,124,0,161,1,125,3,116,7,124,3,124,0,100,3,141, - 2,130,1,116,8,124,0,131,1,1,0,124,2,83,0,41, - 4,122,25,70,105,110,100,32,97,110,100,32,108,111,97,100, - 32,116,104,101,32,109,111,100,117,108,101,46,78,122,40,105, - 109,112,111,114,116,32,111,102,32,123,125,32,104,97,108,116, - 101,100,59,32,78,111,110,101,32,105,110,32,115,121,115,46, - 109,111,100,117,108,101,115,41,1,114,15,0,0,0,41,9, - 114,42,0,0,0,114,14,0,0,0,114,79,0,0,0,114, - 30,0,0,0,218,14,95,78,69,69,68,83,95,76,79,65, - 68,73,78,71,114,173,0,0,0,114,38,0,0,0,114,171, - 0,0,0,114,57,0,0,0,41,4,114,15,0,0,0,114, - 172,0,0,0,114,83,0,0,0,114,67,0,0,0,114,10, - 0,0,0,114,10,0,0,0,114,11,0,0,0,218,14,95, - 102,105,110,100,95,97,110,100,95,108,111,97,100,216,3,0, - 0,115,22,0,0,0,0,2,10,1,14,1,8,1,32,2, - 8,1,4,1,2,255,4,2,12,2,8,1,114,175,0,0, - 0,114,19,0,0,0,99,3,0,0,0,0,0,0,0,3, - 0,0,0,4,0,0,0,67,0,0,0,115,42,0,0,0, - 116,0,124,0,124,1,124,2,131,3,1,0,124,2,100,1, - 107,4,114,32,116,1,124,0,124,1,124,2,131,3,125,0, - 116,2,124,0,116,3,131,2,83,0,41,2,97,50,1,0, - 0,73,109,112,111,114,116,32,97,110,100,32,114,101,116,117, - 114,110,32,116,104,101,32,109,111,100,117,108,101,32,98,97, - 115,101,100,32,111,110,32,105,116,115,32,110,97,109,101,44, - 32,116,104,101,32,112,97,99,107,97,103,101,32,116,104,101, - 32,99,97,108,108,32,105,115,10,32,32,32,32,98,101,105, - 110,103,32,109,97,100,101,32,102,114,111,109,44,32,97,110, - 100,32,116,104,101,32,108,101,118,101,108,32,97,100,106,117, - 115,116,109,101,110,116,46,10,10,32,32,32,32,84,104,105, - 115,32,102,117,110,99,116,105,111,110,32,114,101,112,114,101, - 115,101,110,116,115,32,116,104,101,32,103,114,101,97,116,101, - 115,116,32,99,111,109,109,111,110,32,100,101,110,111,109,105, - 110,97,116,111,114,32,111,102,32,102,117,110,99,116,105,111, - 110,97,108,105,116,121,10,32,32,32,32,98,101,116,119,101, - 101,110,32,105,109,112,111,114,116,95,109,111,100,117,108,101, - 32,97,110,100,32,95,95,105,109,112,111,114,116,95,95,46, - 32,84,104,105,115,32,105,110,99,108,117,100,101,115,32,115, - 101,116,116,105,110,103,32,95,95,112,97,99,107,97,103,101, - 95,95,32,105,102,10,32,32,32,32,116,104,101,32,108,111, - 97,100,101,114,32,100,105,100,32,110,111,116,46,10,10,32, - 32,32,32,114,19,0,0,0,41,4,114,168,0,0,0,114, - 157,0,0,0,114,175,0,0,0,218,11,95,103,99,100,95, - 105,109,112,111,114,116,41,3,114,15,0,0,0,114,155,0, - 0,0,114,156,0,0,0,114,10,0,0,0,114,10,0,0, - 0,114,11,0,0,0,114,176,0,0,0,232,3,0,0,115, - 8,0,0,0,0,9,12,1,8,1,12,1,114,176,0,0, - 0,41,1,218,9,114,101,99,117,114,115,105,118,101,99,3, - 0,0,0,1,0,0,0,8,0,0,0,11,0,0,0,67, - 0,0,0,115,226,0,0,0,124,1,68,0,93,216,125,4, - 116,0,124,4,116,1,131,2,115,66,124,3,114,34,124,0, - 106,2,100,1,23,0,125,5,110,4,100,2,125,5,116,3, - 100,3,124,5,155,0,100,4,116,4,124,4,131,1,106,2, - 155,0,157,4,131,1,130,1,110,154,124,4,100,5,107,2, - 114,108,124,3,115,106,116,5,124,0,100,6,131,2,114,106, - 116,6,124,0,124,0,106,7,124,2,100,7,100,8,141,4, - 1,0,110,112,116,5,124,0,124,4,131,2,115,220,100,9, - 160,8,124,0,106,2,124,4,161,2,125,6,122,14,116,9, - 124,2,124,6,131,2,1,0,87,0,110,72,4,0,116,10, - 107,10,114,218,1,0,125,7,1,0,122,42,124,7,106,11, - 124,6,107,2,114,200,116,12,106,13,160,14,124,6,116,15, - 161,2,100,10,107,9,114,200,87,0,89,0,162,8,113,4, - 130,0,87,0,53,0,100,10,125,7,126,7,88,0,89,0, - 110,2,88,0,113,4,124,0,83,0,41,11,122,238,70,105, - 103,117,114,101,32,111,117,116,32,119,104,97,116,32,95,95, - 105,109,112,111,114,116,95,95,32,115,104,111,117,108,100,32, - 114,101,116,117,114,110,46,10,10,32,32,32,32,84,104,101, - 32,105,109,112,111,114,116,95,32,112,97,114,97,109,101,116, - 101,114,32,105,115,32,97,32,99,97,108,108,97,98,108,101, - 32,119,104,105,99,104,32,116,97,107,101,115,32,116,104,101, - 32,110,97,109,101,32,111,102,32,109,111,100,117,108,101,32, - 116,111,10,32,32,32,32,105,109,112,111,114,116,46,32,73, - 116,32,105,115,32,114,101,113,117,105,114,101,100,32,116,111, - 32,100,101,99,111,117,112,108,101,32,116,104,101,32,102,117, - 110,99,116,105,111,110,32,102,114,111,109,32,97,115,115,117, - 109,105,110,103,32,105,109,112,111,114,116,108,105,98,39,115, - 10,32,32,32,32,105,109,112,111,114,116,32,105,109,112,108, - 101,109,101,110,116,97,116,105,111,110,32,105,115,32,100,101, - 115,105,114,101,100,46,10,10,32,32,32,32,122,8,46,95, - 95,97,108,108,95,95,122,13,96,96,102,114,111,109,32,108, - 105,115,116,39,39,122,8,73,116,101,109,32,105,110,32,122, - 18,32,109,117,115,116,32,98,101,32,115,116,114,44,32,110, - 111,116,32,250,1,42,218,7,95,95,97,108,108,95,95,84, - 41,1,114,177,0,0,0,122,5,123,125,46,123,125,78,41, - 16,114,165,0,0,0,114,166,0,0,0,114,1,0,0,0, - 114,167,0,0,0,114,13,0,0,0,114,4,0,0,0,218, - 16,95,104,97,110,100,108,101,95,102,114,111,109,108,105,115, - 116,114,179,0,0,0,114,38,0,0,0,114,59,0,0,0, - 114,171,0,0,0,114,15,0,0,0,114,14,0,0,0,114, - 79,0,0,0,114,30,0,0,0,114,174,0,0,0,41,8, - 114,83,0,0,0,218,8,102,114,111,109,108,105,115,116,114, - 172,0,0,0,114,177,0,0,0,218,1,120,90,5,119,104, - 101,114,101,90,9,102,114,111,109,95,110,97,109,101,90,3, - 101,120,99,114,10,0,0,0,114,10,0,0,0,114,11,0, - 0,0,114,180,0,0,0,247,3,0,0,115,44,0,0,0, - 0,10,8,1,10,1,4,1,12,2,4,1,28,2,8,1, - 14,1,10,1,2,255,8,2,10,1,14,1,2,1,14,1, - 16,4,10,1,16,255,2,2,8,1,22,1,114,180,0,0, - 0,99,1,0,0,0,0,0,0,0,3,0,0,0,6,0, - 0,0,67,0,0,0,115,146,0,0,0,124,0,160,0,100, - 1,161,1,125,1,124,0,160,0,100,2,161,1,125,2,124, - 1,100,3,107,9,114,82,124,2,100,3,107,9,114,78,124, - 1,124,2,106,1,107,3,114,78,116,2,106,3,100,4,124, - 1,155,2,100,5,124,2,106,1,155,2,100,6,157,5,116, - 4,100,7,100,8,141,3,1,0,124,1,83,0,124,2,100, - 3,107,9,114,96,124,2,106,1,83,0,116,2,106,3,100, - 9,116,4,100,7,100,8,141,3,1,0,124,0,100,10,25, - 0,125,1,100,11,124,0,107,7,114,142,124,1,160,5,100, - 12,161,1,100,13,25,0,125,1,124,1,83,0,41,14,122, - 167,67,97,108,99,117,108,97,116,101,32,119,104,97,116,32, - 95,95,112,97,99,107,97,103,101,95,95,32,115,104,111,117, - 108,100,32,98,101,46,10,10,32,32,32,32,95,95,112,97, - 99,107,97,103,101,95,95,32,105,115,32,110,111,116,32,103, - 117,97,114,97,110,116,101,101,100,32,116,111,32,98,101,32, - 100,101,102,105,110,101,100,32,111,114,32,99,111,117,108,100, - 32,98,101,32,115,101,116,32,116,111,32,78,111,110,101,10, - 32,32,32,32,116,111,32,114,101,112,114,101,115,101,110,116, - 32,116,104,97,116,32,105,116,115,32,112,114,111,112,101,114, - 32,118,97,108,117,101,32,105,115,32,117,110,107,110,111,119, - 110,46,10,10,32,32,32,32,114,124,0,0,0,114,89,0, - 0,0,78,122,32,95,95,112,97,99,107,97,103,101,95,95, - 32,33,61,32,95,95,115,112,101,99,95,95,46,112,97,114, - 101,110,116,32,40,122,4,32,33,61,32,250,1,41,233,3, - 0,0,0,41,1,90,10,115,116,97,99,107,108,101,118,101, - 108,122,89,99,97,110,39,116,32,114,101,115,111,108,118,101, - 32,112,97,99,107,97,103,101,32,102,114,111,109,32,95,95, - 115,112,101,99,95,95,32,111,114,32,95,95,112,97,99,107, - 97,103,101,95,95,44,32,102,97,108,108,105,110,103,32,98, - 97,99,107,32,111,110,32,95,95,110,97,109,101,95,95,32, - 97,110,100,32,95,95,112,97,116,104,95,95,114,1,0,0, - 0,114,121,0,0,0,114,111,0,0,0,114,19,0,0,0, - 41,6,114,30,0,0,0,114,113,0,0,0,114,161,0,0, - 0,114,162,0,0,0,114,163,0,0,0,114,112,0,0,0, - 41,3,218,7,103,108,111,98,97,108,115,114,155,0,0,0, - 114,82,0,0,0,114,10,0,0,0,114,10,0,0,0,114, - 11,0,0,0,218,17,95,99,97,108,99,95,95,95,112,97, - 99,107,97,103,101,95,95,28,4,0,0,115,38,0,0,0, - 0,7,10,1,10,1,8,1,18,1,22,2,2,0,2,254, - 6,3,4,1,8,1,6,2,6,2,2,0,2,254,6,3, - 8,1,8,1,14,1,114,186,0,0,0,114,10,0,0,0, - 99,5,0,0,0,0,0,0,0,9,0,0,0,5,0,0, - 0,67,0,0,0,115,180,0,0,0,124,4,100,1,107,2, - 114,18,116,0,124,0,131,1,125,5,110,36,124,1,100,2, - 107,9,114,30,124,1,110,2,105,0,125,6,116,1,124,6, - 131,1,125,7,116,0,124,0,124,7,124,4,131,3,125,5, - 124,3,115,150,124,4,100,1,107,2,114,84,116,0,124,0, - 160,2,100,3,161,1,100,1,25,0,131,1,83,0,124,0, - 115,92,124,5,83,0,116,3,124,0,131,1,116,3,124,0, - 160,2,100,3,161,1,100,1,25,0,131,1,24,0,125,8, - 116,4,106,5,124,5,106,6,100,2,116,3,124,5,106,6, - 131,1,124,8,24,0,133,2,25,0,25,0,83,0,110,26, - 116,7,124,5,100,4,131,2,114,172,116,8,124,5,124,3, - 116,0,131,3,83,0,124,5,83,0,100,2,83,0,41,5, - 97,215,1,0,0,73,109,112,111,114,116,32,97,32,109,111, - 100,117,108,101,46,10,10,32,32,32,32,84,104,101,32,39, - 103,108,111,98,97,108,115,39,32,97,114,103,117,109,101,110, - 116,32,105,115,32,117,115,101,100,32,116,111,32,105,110,102, - 101,114,32,119,104,101,114,101,32,116,104,101,32,105,109,112, - 111,114,116,32,105,115,32,111,99,99,117,114,114,105,110,103, - 32,102,114,111,109,10,32,32,32,32,116,111,32,104,97,110, - 100,108,101,32,114,101,108,97,116,105,118,101,32,105,109,112, - 111,114,116,115,46,32,84,104,101,32,39,108,111,99,97,108, - 115,39,32,97,114,103,117,109,101,110,116,32,105,115,32,105, - 103,110,111,114,101,100,46,32,84,104,101,10,32,32,32,32, - 39,102,114,111,109,108,105,115,116,39,32,97,114,103,117,109, - 101,110,116,32,115,112,101,99,105,102,105,101,115,32,119,104, - 97,116,32,115,104,111,117,108,100,32,101,120,105,115,116,32, - 97,115,32,97,116,116,114,105,98,117,116,101,115,32,111,110, - 32,116,104,101,32,109,111,100,117,108,101,10,32,32,32,32, - 98,101,105,110,103,32,105,109,112,111,114,116,101,100,32,40, - 101,46,103,46,32,96,96,102,114,111,109,32,109,111,100,117, - 108,101,32,105,109,112,111,114,116,32,60,102,114,111,109,108, - 105,115,116,62,96,96,41,46,32,32,84,104,101,32,39,108, - 101,118,101,108,39,10,32,32,32,32,97,114,103,117,109,101, - 110,116,32,114,101,112,114,101,115,101,110,116,115,32,116,104, - 101,32,112,97,99,107,97,103,101,32,108,111,99,97,116,105, - 111,110,32,116,111,32,105,109,112,111,114,116,32,102,114,111, - 109,32,105,110,32,97,32,114,101,108,97,116,105,118,101,10, - 32,32,32,32,105,109,112,111,114,116,32,40,101,46,103,46, - 32,96,96,102,114,111,109,32,46,46,112,107,103,32,105,109, - 112,111,114,116,32,109,111,100,96,96,32,119,111,117,108,100, - 32,104,97,118,101,32,97,32,39,108,101,118,101,108,39,32, - 111,102,32,50,41,46,10,10,32,32,32,32,114,19,0,0, - 0,78,114,111,0,0,0,114,121,0,0,0,41,9,114,176, - 0,0,0,114,186,0,0,0,218,9,112,97,114,116,105,116, - 105,111,110,114,153,0,0,0,114,14,0,0,0,114,79,0, - 0,0,114,1,0,0,0,114,4,0,0,0,114,180,0,0, - 0,41,9,114,15,0,0,0,114,185,0,0,0,218,6,108, - 111,99,97,108,115,114,181,0,0,0,114,156,0,0,0,114, - 83,0,0,0,90,8,103,108,111,98,97,108,115,95,114,155, - 0,0,0,90,7,99,117,116,95,111,102,102,114,10,0,0, - 0,114,10,0,0,0,114,11,0,0,0,218,10,95,95,105, - 109,112,111,114,116,95,95,55,4,0,0,115,30,0,0,0, - 0,11,8,1,10,2,16,1,8,1,12,1,4,3,8,1, - 18,1,4,1,4,4,26,3,32,1,10,1,12,2,114,189, - 0,0,0,99,1,0,0,0,0,0,0,0,2,0,0,0, - 3,0,0,0,67,0,0,0,115,38,0,0,0,116,0,160, - 1,124,0,161,1,125,1,124,1,100,0,107,8,114,30,116, - 2,100,1,124,0,23,0,131,1,130,1,116,3,124,1,131, - 1,83,0,41,2,78,122,25,110,111,32,98,117,105,108,116, - 45,105,110,32,109,111,100,117,108,101,32,110,97,109,101,100, - 32,41,4,114,136,0,0,0,114,140,0,0,0,114,70,0, - 0,0,114,135,0,0,0,41,2,114,15,0,0,0,114,82, - 0,0,0,114,10,0,0,0,114,10,0,0,0,114,11,0, - 0,0,218,18,95,98,117,105,108,116,105,110,95,102,114,111, - 109,95,110,97,109,101,92,4,0,0,115,8,0,0,0,0, - 1,10,1,8,1,12,1,114,190,0,0,0,99,2,0,0, - 0,0,0,0,0,10,0,0,0,5,0,0,0,67,0,0, - 0,115,166,0,0,0,124,1,97,0,124,0,97,1,116,2, - 116,1,131,1,125,2,116,1,106,3,160,4,161,0,68,0, - 93,72,92,2,125,3,125,4,116,5,124,4,124,2,131,2, - 114,26,124,3,116,1,106,6,107,6,114,60,116,7,125,5, - 110,18,116,0,160,8,124,3,161,1,114,26,116,9,125,5, - 110,2,113,26,116,10,124,4,124,5,131,2,125,6,116,11, - 124,6,124,4,131,2,1,0,113,26,116,1,106,3,116,12, - 25,0,125,7,100,1,68,0,93,46,125,8,124,8,116,1, - 106,3,107,7,114,138,116,13,124,8,131,1,125,9,110,10, - 116,1,106,3,124,8,25,0,125,9,116,14,124,7,124,8, - 124,9,131,3,1,0,113,114,100,2,83,0,41,3,122,250, - 83,101,116,117,112,32,105,109,112,111,114,116,108,105,98,32, - 98,121,32,105,109,112,111,114,116,105,110,103,32,110,101,101, - 100,101,100,32,98,117,105,108,116,45,105,110,32,109,111,100, - 117,108,101,115,32,97,110,100,32,105,110,106,101,99,116,105, - 110,103,32,116,104,101,109,10,32,32,32,32,105,110,116,111, - 32,116,104,101,32,103,108,111,98,97,108,32,110,97,109,101, - 115,112,97,99,101,46,10,10,32,32,32,32,65,115,32,115, - 121,115,32,105,115,32,110,101,101,100,101,100,32,102,111,114, - 32,115,121,115,46,109,111,100,117,108,101,115,32,97,99,99, - 101,115,115,32,97,110,100,32,95,105,109,112,32,105,115,32, - 110,101,101,100,101,100,32,116,111,32,108,111,97,100,32,98, - 117,105,108,116,45,105,110,10,32,32,32,32,109,111,100,117, - 108,101,115,44,32,116,104,111,115,101,32,116,119,111,32,109, - 111,100,117,108,101,115,32,109,117,115,116,32,98,101,32,101, - 120,112,108,105,99,105,116,108,121,32,112,97,115,115,101,100, - 32,105,110,46,10,10,32,32,32,32,41,3,114,20,0,0, - 0,114,161,0,0,0,114,56,0,0,0,78,41,15,114,49, - 0,0,0,114,14,0,0,0,114,13,0,0,0,114,79,0, - 0,0,218,5,105,116,101,109,115,114,165,0,0,0,114,69, - 0,0,0,114,136,0,0,0,114,75,0,0,0,114,146,0, - 0,0,114,122,0,0,0,114,127,0,0,0,114,1,0,0, - 0,114,190,0,0,0,114,5,0,0,0,41,10,218,10,115, - 121,115,95,109,111,100,117,108,101,218,11,95,105,109,112,95, - 109,111,100,117,108,101,90,11,109,111,100,117,108,101,95,116, - 121,112,101,114,15,0,0,0,114,83,0,0,0,114,93,0, - 0,0,114,82,0,0,0,90,11,115,101,108,102,95,109,111, - 100,117,108,101,90,12,98,117,105,108,116,105,110,95,110,97, - 109,101,90,14,98,117,105,108,116,105,110,95,109,111,100,117, - 108,101,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,218,6,95,115,101,116,117,112,99,4,0,0,115,36,0, - 0,0,0,9,4,1,4,3,8,1,18,1,10,1,10,1, - 6,1,10,1,6,2,2,1,10,1,12,3,10,1,8,1, - 10,1,10,2,10,1,114,194,0,0,0,99,2,0,0,0, - 0,0,0,0,2,0,0,0,3,0,0,0,67,0,0,0, - 115,38,0,0,0,116,0,124,0,124,1,131,2,1,0,116, - 1,106,2,160,3,116,4,161,1,1,0,116,1,106,2,160, - 3,116,5,161,1,1,0,100,1,83,0,41,2,122,48,73, - 110,115,116,97,108,108,32,105,109,112,111,114,116,101,114,115, - 32,102,111,114,32,98,117,105,108,116,105,110,32,97,110,100, - 32,102,114,111,122,101,110,32,109,111,100,117,108,101,115,78, - 41,6,114,194,0,0,0,114,14,0,0,0,114,160,0,0, - 0,114,103,0,0,0,114,136,0,0,0,114,146,0,0,0, - 41,2,114,192,0,0,0,114,193,0,0,0,114,10,0,0, - 0,114,10,0,0,0,114,11,0,0,0,218,8,95,105,110, - 115,116,97,108,108,134,4,0,0,115,6,0,0,0,0,2, - 10,2,12,1,114,195,0,0,0,99,0,0,0,0,0,0, - 0,0,1,0,0,0,4,0,0,0,67,0,0,0,115,32, - 0,0,0,100,1,100,2,108,0,125,0,124,0,97,1,124, - 0,160,2,116,3,106,4,116,5,25,0,161,1,1,0,100, - 2,83,0,41,3,122,57,73,110,115,116,97,108,108,32,105, - 109,112,111,114,116,101,114,115,32,116,104,97,116,32,114,101, - 113,117,105,114,101,32,101,120,116,101,114,110,97,108,32,102, - 105,108,101,115,121,115,116,101,109,32,97,99,99,101,115,115, - 114,19,0,0,0,78,41,6,218,26,95,102,114,111,122,101, - 110,95,105,109,112,111,114,116,108,105,98,95,101,120,116,101, - 114,110,97,108,114,109,0,0,0,114,195,0,0,0,114,14, - 0,0,0,114,79,0,0,0,114,1,0,0,0,41,1,114, - 196,0,0,0,114,10,0,0,0,114,10,0,0,0,114,11, - 0,0,0,218,27,95,105,110,115,116,97,108,108,95,101,120, - 116,101,114,110,97,108,95,105,109,112,111,114,116,101,114,115, - 142,4,0,0,115,6,0,0,0,0,3,8,1,4,1,114, - 197,0,0,0,41,2,78,78,41,1,78,41,2,78,114,19, - 0,0,0,41,4,78,78,114,10,0,0,0,114,19,0,0, - 0,41,50,114,3,0,0,0,114,109,0,0,0,114,12,0, - 0,0,114,16,0,0,0,114,51,0,0,0,114,29,0,0, - 0,114,36,0,0,0,114,17,0,0,0,114,18,0,0,0, - 114,41,0,0,0,114,42,0,0,0,114,45,0,0,0,114, - 57,0,0,0,114,59,0,0,0,114,68,0,0,0,114,74, - 0,0,0,114,77,0,0,0,114,84,0,0,0,114,95,0, - 0,0,114,96,0,0,0,114,78,0,0,0,114,122,0,0, - 0,114,127,0,0,0,114,130,0,0,0,114,91,0,0,0, - 114,80,0,0,0,114,134,0,0,0,114,135,0,0,0,114, - 81,0,0,0,114,136,0,0,0,114,146,0,0,0,114,151, - 0,0,0,114,157,0,0,0,114,159,0,0,0,114,164,0, - 0,0,114,168,0,0,0,90,15,95,69,82,82,95,77,83, - 71,95,80,82,69,70,73,88,114,170,0,0,0,114,173,0, - 0,0,218,6,111,98,106,101,99,116,114,174,0,0,0,114, - 175,0,0,0,114,176,0,0,0,114,180,0,0,0,114,186, - 0,0,0,114,189,0,0,0,114,190,0,0,0,114,194,0, - 0,0,114,195,0,0,0,114,197,0,0,0,114,10,0,0, + 46,95,95,101,120,105,116,95,95,78,41,6,114,1,0,0, + 0,114,0,0,0,0,114,2,0,0,0,114,3,0,0,0, + 114,54,0,0,0,114,56,0,0,0,114,10,0,0,0,114, + 10,0,0,0,114,10,0,0,0,114,11,0,0,0,114,177, + 0,0,0,89,3,0,0,115,6,0,0,0,8,2,4,2, + 8,4,114,177,0,0,0,99,3,0,0,0,0,0,0,0, + 5,0,0,0,5,0,0,0,67,0,0,0,115,64,0,0, + 0,124,1,160,0,100,1,124,2,100,2,24,0,161,2,125, + 3,116,1,124,3,131,1,124,2,107,0,114,36,116,2,100, + 3,131,1,130,1,124,3,100,4,25,0,125,4,124,0,114, + 60,100,5,160,3,124,4,124,0,161,2,83,0,124,4,83, + 0,41,6,122,50,82,101,115,111,108,118,101,32,97,32,114, + 101,108,97,116,105,118,101,32,109,111,100,117,108,101,32,110, + 97,109,101,32,116,111,32,97,110,32,97,98,115,111,108,117, + 116,101,32,111,110,101,46,114,128,0,0,0,114,37,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,22,0,0,0,250,5,123,125,46,123, + 125,41,4,218,6,114,115,112,108,105,116,218,3,108,101,110, + 218,10,86,97,108,117,101,69,114,114,111,114,114,45,0,0, + 0,41,5,114,17,0,0,0,218,7,112,97,99,107,97,103, + 101,218,5,108,101,118,101,108,90,4,98,105,116,115,90,4, + 98,97,115,101,114,10,0,0,0,114,10,0,0,0,114,11, + 0,0,0,218,13,95,114,101,115,111,108,118,101,95,110,97, + 109,101,102,3,0,0,115,10,0,0,0,0,2,16,1,12, + 1,8,1,8,1,114,184,0,0,0,99,3,0,0,0,0, + 0,0,0,4,0,0,0,4,0,0,0,67,0,0,0,115, + 34,0,0,0,124,0,160,0,124,1,124,2,161,2,125,3, + 124,3,100,0,107,8,114,24,100,0,83,0,116,1,124,1, + 124,3,131,2,83,0,114,13,0,0,0,41,2,114,166,0, + 0,0,114,91,0,0,0,41,4,218,6,102,105,110,100,101, + 114,114,17,0,0,0,114,163,0,0,0,114,109,0,0,0, + 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,218, + 17,95,102,105,110,100,95,115,112,101,99,95,108,101,103,97, + 99,121,111,3,0,0,115,8,0,0,0,0,3,12,1,8, + 1,4,1,114,186,0,0,0,99,3,0,0,0,0,0,0, + 0,10,0,0,0,10,0,0,0,67,0,0,0,115,12,1, + 0,0,116,0,106,1,125,3,124,3,100,1,107,8,114,22, + 116,2,100,2,131,1,130,1,124,3,115,38,116,3,160,4, + 100,3,116,5,161,2,1,0,124,0,116,0,106,6,107,6, + 125,4,124,3,68,0,93,210,125,5,116,7,131,0,143,84, + 1,0,122,10,124,5,106,8,125,6,87,0,110,54,4,0, + 116,9,107,10,114,128,1,0,1,0,1,0,116,10,124,5, + 124,0,124,1,131,3,125,7,124,7,100,1,107,8,114,124, + 89,0,87,0,53,0,81,0,82,0,163,0,113,52,89,0, + 110,14,88,0,124,6,124,0,124,1,124,2,131,3,125,7, + 87,0,53,0,81,0,82,0,88,0,124,7,100,1,107,9, + 114,52,124,4,144,0,115,254,124,0,116,0,106,6,107,6, + 144,0,114,254,116,0,106,6,124,0,25,0,125,8,122,10, + 124,8,106,11,125,9,87,0,110,28,4,0,116,9,107,10, + 114,226,1,0,1,0,1,0,124,7,6,0,89,0,2,0, + 1,0,83,0,88,0,124,9,100,1,107,8,114,244,124,7, + 2,0,1,0,83,0,124,9,2,0,1,0,83,0,113,52, + 124,7,2,0,1,0,83,0,113,52,100,1,83,0,41,4, + 122,21,70,105,110,100,32,97,32,109,111,100,117,108,101,39, + 115,32,115,112,101,99,46,78,122,53,115,121,115,46,109,101, + 116,97,95,112,97,116,104,32,105,115,32,78,111,110,101,44, + 32,80,121,116,104,111,110,32,105,115,32,108,105,107,101,108, + 121,32,115,104,117,116,116,105,110,103,32,100,111,119,110,122, + 22,115,121,115,46,109,101,116,97,95,112,97,116,104,32,105, + 115,32,101,109,112,116,121,41,12,114,15,0,0,0,218,9, + 109,101,116,97,95,112,97,116,104,114,79,0,0,0,218,9, + 95,119,97,114,110,105,110,103,115,218,4,119,97,114,110,218, + 13,73,109,112,111,114,116,87,97,114,110,105,110,103,114,92, + 0,0,0,114,177,0,0,0,114,165,0,0,0,114,106,0, + 0,0,114,186,0,0,0,114,105,0,0,0,41,10,114,17, + 0,0,0,114,163,0,0,0,114,164,0,0,0,114,187,0, + 0,0,90,9,105,115,95,114,101,108,111,97,100,114,185,0, + 0,0,114,165,0,0,0,114,95,0,0,0,114,96,0,0, + 0,114,105,0,0,0,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,218,10,95,102,105,110,100,95,115,112,101, + 99,120,3,0,0,115,54,0,0,0,0,2,6,1,8,2, + 8,3,4,1,12,5,10,1,8,1,8,1,2,1,10,1, + 14,1,12,1,8,1,20,2,22,1,8,2,18,1,10,1, + 2,1,10,1,14,4,14,2,8,1,8,2,10,2,10,2, + 114,191,0,0,0,99,3,0,0,0,0,0,0,0,3,0, + 0,0,5,0,0,0,67,0,0,0,115,108,0,0,0,116, + 0,124,0,116,1,131,2,115,28,116,2,100,1,160,3,116, + 4,124,0,131,1,161,1,131,1,130,1,124,2,100,2,107, + 0,114,44,116,5,100,3,131,1,130,1,124,2,100,2,107, + 4,114,84,116,0,124,1,116,1,131,2,115,72,116,2,100, + 4,131,1,130,1,110,12,124,1,115,84,116,6,100,5,131, + 1,130,1,124,0,115,104,124,2,100,2,107,2,114,104,116, + 5,100,6,131,1,130,1,100,7,83,0,41,8,122,28,86, + 101,114,105,102,121,32,97,114,103,117,109,101,110,116,115,32, + 97,114,101,32,34,115,97,110,101,34,46,122,31,109,111,100, + 117,108,101,32,110,97,109,101,32,109,117,115,116,32,98,101, + 32,115,116,114,44,32,110,111,116,32,123,125,114,22,0,0, + 0,122,18,108,101,118,101,108,32,109,117,115,116,32,98,101, + 32,62,61,32,48,122,31,95,95,112,97,99,107,97,103,101, + 95,95,32,110,111,116,32,115,101,116,32,116,111,32,97,32, + 115,116,114,105,110,103,122,54,97,116,116,101,109,112,116,101, + 100,32,114,101,108,97,116,105,118,101,32,105,109,112,111,114, + 116,32,119,105,116,104,32,110,111,32,107,110,111,119,110,32, + 112,97,114,101,110,116,32,112,97,99,107,97,103,101,122,17, + 69,109,112,116,121,32,109,111,100,117,108,101,32,110,97,109, + 101,78,41,7,218,10,105,115,105,110,115,116,97,110,99,101, + 218,3,115,116,114,218,9,84,121,112,101,69,114,114,111,114, + 114,45,0,0,0,114,14,0,0,0,114,181,0,0,0,114, + 79,0,0,0,169,3,114,17,0,0,0,114,182,0,0,0, + 114,183,0,0,0,114,10,0,0,0,114,10,0,0,0,114, + 11,0,0,0,218,13,95,115,97,110,105,116,121,95,99,104, + 101,99,107,167,3,0,0,115,22,0,0,0,0,2,10,1, + 18,1,8,1,8,1,8,1,10,1,10,1,4,1,8,2, + 12,1,114,196,0,0,0,122,16,78,111,32,109,111,100,117, + 108,101,32,110,97,109,101,100,32,122,4,123,33,114,125,99, + 2,0,0,0,0,0,0,0,8,0,0,0,8,0,0,0, + 67,0,0,0,115,220,0,0,0,100,0,125,2,124,0,160, + 0,100,1,161,1,100,2,25,0,125,3,124,3,114,134,124, + 3,116,1,106,2,107,7,114,42,116,3,124,1,124,3,131, + 2,1,0,124,0,116,1,106,2,107,6,114,62,116,1,106, + 2,124,0,25,0,83,0,116,1,106,2,124,3,25,0,125, + 4,122,10,124,4,106,4,125,2,87,0,110,50,4,0,116, + 5,107,10,114,132,1,0,1,0,1,0,116,6,100,3,23, + 0,160,7,124,0,124,3,161,2,125,5,116,8,124,5,124, + 0,100,4,141,2,100,0,130,2,89,0,110,2,88,0,116, + 9,124,0,124,2,131,2,125,6,124,6,100,0,107,8,114, + 172,116,8,116,6,160,7,124,0,161,1,124,0,100,4,141, + 2,130,1,110,8,116,10,124,6,131,1,125,7,124,3,114, + 216,116,1,106,2,124,3,25,0,125,4,116,11,124,4,124, + 0,160,0,100,1,161,1,100,5,25,0,124,7,131,3,1, + 0,124,7,83,0,41,6,78,114,128,0,0,0,114,22,0, + 0,0,122,23,59,32,123,33,114,125,32,105,115,32,110,111, + 116,32,97,32,112,97,99,107,97,103,101,114,16,0,0,0, + 233,2,0,0,0,41,12,114,129,0,0,0,114,15,0,0, + 0,114,92,0,0,0,114,67,0,0,0,114,140,0,0,0, + 114,106,0,0,0,218,8,95,69,82,82,95,77,83,71,114, + 45,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,191,0,0,0,114,157, + 0,0,0,114,5,0,0,0,41,8,114,17,0,0,0,218, + 7,105,109,112,111,114,116,95,114,163,0,0,0,114,130,0, + 0,0,90,13,112,97,114,101,110,116,95,109,111,100,117,108, + 101,114,155,0,0,0,114,95,0,0,0,114,96,0,0,0, + 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,218, + 23,95,102,105,110,100,95,97,110,100,95,108,111,97,100,95, + 117,110,108,111,99,107,101,100,186,3,0,0,115,42,0,0, + 0,0,1,4,1,14,1,4,1,10,1,10,2,10,1,10, + 1,10,1,2,1,10,1,14,1,16,1,20,1,10,1,8, + 1,20,2,8,1,4,2,10,1,22,1,114,201,0,0,0, + 99,2,0,0,0,0,0,0,0,4,0,0,0,10,0,0, + 0,67,0,0,0,115,106,0,0,0,116,0,124,0,131,1, + 143,50,1,0,116,1,106,2,160,3,124,0,116,4,161,2, + 125,2,124,2,116,4,107,8,114,54,116,5,124,0,124,1, + 131,2,87,0,2,0,53,0,81,0,82,0,163,0,83,0, + 87,0,53,0,81,0,82,0,88,0,124,2,100,1,107,8, + 114,94,100,2,160,6,124,0,161,1,125,3,116,7,124,3, + 124,0,100,3,141,2,130,1,116,8,124,0,131,1,1,0, + 124,2,83,0,41,4,122,25,70,105,110,100,32,97,110,100, + 32,108,111,97,100,32,116,104,101,32,109,111,100,117,108,101, + 46,78,122,40,105,109,112,111,114,116,32,111,102,32,123,125, + 32,104,97,108,116,101,100,59,32,78,111,110,101,32,105,110, + 32,115,121,115,46,109,111,100,117,108,101,115,114,16,0,0, + 0,41,9,114,50,0,0,0,114,15,0,0,0,114,92,0, + 0,0,114,34,0,0,0,218,14,95,78,69,69,68,83,95, + 76,79,65,68,73,78,71,114,201,0,0,0,114,45,0,0, + 0,114,199,0,0,0,114,65,0,0,0,41,4,114,17,0, + 0,0,114,200,0,0,0,114,96,0,0,0,114,75,0,0, 0,114,10,0,0,0,114,10,0,0,0,114,11,0,0,0, - 218,8,60,109,111,100,117,108,101,62,8,0,0,0,115,94, - 0,0,0,4,17,4,2,8,8,8,8,4,2,4,3,16, - 4,14,68,14,21,14,16,8,37,8,17,8,11,14,8,8, - 11,8,12,8,16,8,36,14,101,16,26,10,45,14,72,8, - 17,8,17,8,30,8,37,8,42,8,15,14,73,14,77,14, - 13,8,9,8,9,10,47,8,16,4,1,8,2,8,27,6, - 3,8,16,10,15,14,37,8,27,10,37,8,7,8,35,8, - 8, + 218,14,95,102,105,110,100,95,97,110,100,95,108,111,97,100, + 216,3,0,0,115,22,0,0,0,0,2,10,1,14,1,8, + 1,32,2,8,1,4,1,2,255,4,2,12,2,8,1,114, + 203,0,0,0,114,22,0,0,0,99,3,0,0,0,0,0, + 0,0,3,0,0,0,4,0,0,0,67,0,0,0,115,42, + 0,0,0,116,0,124,0,124,1,124,2,131,3,1,0,124, + 2,100,1,107,4,114,32,116,1,124,0,124,1,124,2,131, + 3,125,0,116,2,124,0,116,3,131,2,83,0,41,2,97, + 50,1,0,0,73,109,112,111,114,116,32,97,110,100,32,114, + 101,116,117,114,110,32,116,104,101,32,109,111,100,117,108,101, + 32,98,97,115,101,100,32,111,110,32,105,116,115,32,110,97, + 109,101,44,32,116,104,101,32,112,97,99,107,97,103,101,32, + 116,104,101,32,99,97,108,108,32,105,115,10,32,32,32,32, + 98,101,105,110,103,32,109,97,100,101,32,102,114,111,109,44, + 32,97,110,100,32,116,104,101,32,108,101,118,101,108,32,97, + 100,106,117,115,116,109,101,110,116,46,10,10,32,32,32,32, + 84,104,105,115,32,102,117,110,99,116,105,111,110,32,114,101, + 112,114,101,115,101,110,116,115,32,116,104,101,32,103,114,101, + 97,116,101,115,116,32,99,111,109,109,111,110,32,100,101,110, + 111,109,105,110,97,116,111,114,32,111,102,32,102,117,110,99, + 116,105,111,110,97,108,105,116,121,10,32,32,32,32,98,101, + 116,119,101,101,110,32,105,109,112,111,114,116,95,109,111,100, + 117,108,101,32,97,110,100,32,95,95,105,109,112,111,114,116, + 95,95,46,32,84,104,105,115,32,105,110,99,108,117,100,101, + 115,32,115,101,116,116,105,110,103,32,95,95,112,97,99,107, + 97,103,101,95,95,32,105,102,10,32,32,32,32,116,104,101, + 32,108,111,97,100,101,114,32,100,105,100,32,110,111,116,46, + 10,10,32,32,32,32,114,22,0,0,0,41,4,114,196,0, + 0,0,114,184,0,0,0,114,203,0,0,0,218,11,95,103, + 99,100,95,105,109,112,111,114,116,114,195,0,0,0,114,10, + 0,0,0,114,10,0,0,0,114,11,0,0,0,114,204,0, + 0,0,232,3,0,0,115,8,0,0,0,0,9,12,1,8, + 1,12,1,114,204,0,0,0,169,1,218,9,114,101,99,117, + 114,115,105,118,101,99,3,0,0,0,1,0,0,0,8,0, + 0,0,11,0,0,0,67,0,0,0,115,226,0,0,0,124, + 1,68,0,93,216,125,4,116,0,124,4,116,1,131,2,115, + 66,124,3,114,34,124,0,106,2,100,1,23,0,125,5,110, + 4,100,2,125,5,116,3,100,3,124,5,155,0,100,4,116, + 4,124,4,131,1,106,2,155,0,157,4,131,1,130,1,110, + 154,124,4,100,5,107,2,114,108,124,3,115,106,116,5,124, + 0,100,6,131,2,114,106,116,6,124,0,124,0,106,7,124, + 2,100,7,100,8,141,4,1,0,110,112,116,5,124,0,124, + 4,131,2,115,220,100,9,160,8,124,0,106,2,124,4,161, + 2,125,6,122,14,116,9,124,2,124,6,131,2,1,0,87, + 0,110,72,4,0,116,10,107,10,114,218,1,0,125,7,1, + 0,122,42,124,7,106,11,124,6,107,2,114,200,116,12,106, + 13,160,14,124,6,116,15,161,2,100,10,107,9,114,200,87, + 0,89,0,162,8,113,4,130,0,87,0,53,0,100,10,125, + 7,126,7,88,0,89,0,110,2,88,0,113,4,124,0,83, + 0,41,11,122,238,70,105,103,117,114,101,32,111,117,116,32, + 119,104,97,116,32,95,95,105,109,112,111,114,116,95,95,32, + 115,104,111,117,108,100,32,114,101,116,117,114,110,46,10,10, + 32,32,32,32,84,104,101,32,105,109,112,111,114,116,95,32, + 112,97,114,97,109,101,116,101,114,32,105,115,32,97,32,99, + 97,108,108,97,98,108,101,32,119,104,105,99,104,32,116,97, + 107,101,115,32,116,104,101,32,110,97,109,101,32,111,102,32, + 109,111,100,117,108,101,32,116,111,10,32,32,32,32,105,109, + 112,111,114,116,46,32,73,116,32,105,115,32,114,101,113,117, + 105,114,101,100,32,116,111,32,100,101,99,111,117,112,108,101, + 32,116,104,101,32,102,117,110,99,116,105,111,110,32,102,114, + 111,109,32,97,115,115,117,109,105,110,103,32,105,109,112,111, + 114,116,108,105,98,39,115,10,32,32,32,32,105,109,112,111, + 114,116,32,105,109,112,108,101,109,101,110,116,97,116,105,111, + 110,32,105,115,32,100,101,115,105,114,101,100,46,10,10,32, + 32,32,32,122,8,46,95,95,97,108,108,95,95,122,13,96, + 96,102,114,111,109,32,108,105,115,116,39,39,122,8,73,116, + 101,109,32,105,110,32,122,18,32,109,117,115,116,32,98,101, + 32,115,116,114,44,32,110,111,116,32,250,1,42,218,7,95, + 95,97,108,108,95,95,84,114,205,0,0,0,114,178,0,0, + 0,78,41,16,114,192,0,0,0,114,193,0,0,0,114,1, + 0,0,0,114,194,0,0,0,114,14,0,0,0,114,4,0, + 0,0,218,16,95,104,97,110,100,108,101,95,102,114,111,109, + 108,105,115,116,114,208,0,0,0,114,45,0,0,0,114,67, + 0,0,0,114,199,0,0,0,114,17,0,0,0,114,15,0, + 0,0,114,92,0,0,0,114,34,0,0,0,114,202,0,0, + 0,41,8,114,96,0,0,0,218,8,102,114,111,109,108,105, + 115,116,114,200,0,0,0,114,206,0,0,0,218,1,120,90, + 5,119,104,101,114,101,90,9,102,114,111,109,95,110,97,109, + 101,90,3,101,120,99,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,114,209,0,0,0,247,3,0,0,115,44, + 0,0,0,0,10,8,1,10,1,4,1,12,2,4,1,28, + 2,8,1,14,1,10,1,2,255,8,2,10,1,14,1,2, + 1,14,1,16,4,10,1,16,255,2,2,8,1,22,1,114, + 209,0,0,0,99,1,0,0,0,0,0,0,0,3,0,0, + 0,6,0,0,0,67,0,0,0,115,146,0,0,0,124,0, + 160,0,100,1,161,1,125,1,124,0,160,0,100,2,161,1, + 125,2,124,1,100,3,107,9,114,82,124,2,100,3,107,9, + 114,78,124,1,124,2,106,1,107,3,114,78,116,2,106,3, + 100,4,124,1,155,2,100,5,124,2,106,1,155,2,100,6, + 157,5,116,4,100,7,100,8,141,3,1,0,124,1,83,0, + 124,2,100,3,107,9,114,96,124,2,106,1,83,0,116,2, + 106,3,100,9,116,4,100,7,100,8,141,3,1,0,124,0, + 100,10,25,0,125,1,100,11,124,0,107,7,114,142,124,1, + 160,5,100,12,161,1,100,13,25,0,125,1,124,1,83,0, + 41,14,122,167,67,97,108,99,117,108,97,116,101,32,119,104, + 97,116,32,95,95,112,97,99,107,97,103,101,95,95,32,115, + 104,111,117,108,100,32,98,101,46,10,10,32,32,32,32,95, + 95,112,97,99,107,97,103,101,95,95,32,105,115,32,110,111, + 116,32,103,117,97,114,97,110,116,101,101,100,32,116,111,32, + 98,101,32,100,101,102,105,110,101,100,32,111,114,32,99,111, + 117,108,100,32,98,101,32,115,101,116,32,116,111,32,78,111, + 110,101,10,32,32,32,32,116,111,32,114,101,112,114,101,115, + 101,110,116,32,116,104,97,116,32,105,116,115,32,112,114,111, + 112,101,114,32,118,97,108,117,101,32,105,115,32,117,110,107, + 110,111,119,110,46,10,10,32,32,32,32,114,144,0,0,0, + 114,105,0,0,0,78,122,32,95,95,112,97,99,107,97,103, + 101,95,95,32,33,61,32,95,95,115,112,101,99,95,95,46, + 112,97,114,101,110,116,32,40,122,4,32,33,61,32,250,1, + 41,233,3,0,0,0,41,1,90,10,115,116,97,99,107,108, + 101,118,101,108,122,89,99,97,110,39,116,32,114,101,115,111, + 108,118,101,32,112,97,99,107,97,103,101,32,102,114,111,109, + 32,95,95,115,112,101,99,95,95,32,111,114,32,95,95,112, + 97,99,107,97,103,101,95,95,44,32,102,97,108,108,105,110, + 103,32,98,97,99,107,32,111,110,32,95,95,110,97,109,101, + 95,95,32,97,110,100,32,95,95,112,97,116,104,95,95,114, + 1,0,0,0,114,140,0,0,0,114,128,0,0,0,114,22, + 0,0,0,41,6,114,34,0,0,0,114,130,0,0,0,114, + 188,0,0,0,114,189,0,0,0,114,190,0,0,0,114,129, + 0,0,0,41,3,218,7,103,108,111,98,97,108,115,114,182, + 0,0,0,114,95,0,0,0,114,10,0,0,0,114,10,0, + 0,0,114,11,0,0,0,218,17,95,99,97,108,99,95,95, + 95,112,97,99,107,97,103,101,95,95,28,4,0,0,115,38, + 0,0,0,0,7,10,1,10,1,8,1,18,1,22,2,2, + 0,2,254,6,3,4,1,8,1,6,2,6,2,2,0,2, + 254,6,3,8,1,8,1,14,1,114,215,0,0,0,114,10, + 0,0,0,99,5,0,0,0,0,0,0,0,9,0,0,0, + 5,0,0,0,67,0,0,0,115,180,0,0,0,124,4,100, + 1,107,2,114,18,116,0,124,0,131,1,125,5,110,36,124, + 1,100,2,107,9,114,30,124,1,110,2,105,0,125,6,116, + 1,124,6,131,1,125,7,116,0,124,0,124,7,124,4,131, + 3,125,5,124,3,115,150,124,4,100,1,107,2,114,84,116, + 0,124,0,160,2,100,3,161,1,100,1,25,0,131,1,83, + 0,124,0,115,92,124,5,83,0,116,3,124,0,131,1,116, + 3,124,0,160,2,100,3,161,1,100,1,25,0,131,1,24, + 0,125,8,116,4,106,5,124,5,106,6,100,2,116,3,124, + 5,106,6,131,1,124,8,24,0,133,2,25,0,25,0,83, + 0,110,26,116,7,124,5,100,4,131,2,114,172,116,8,124, + 5,124,3,116,0,131,3,83,0,124,5,83,0,100,2,83, + 0,41,5,97,215,1,0,0,73,109,112,111,114,116,32,97, + 32,109,111,100,117,108,101,46,10,10,32,32,32,32,84,104, + 101,32,39,103,108,111,98,97,108,115,39,32,97,114,103,117, + 109,101,110,116,32,105,115,32,117,115,101,100,32,116,111,32, + 105,110,102,101,114,32,119,104,101,114,101,32,116,104,101,32, + 105,109,112,111,114,116,32,105,115,32,111,99,99,117,114,114, + 105,110,103,32,102,114,111,109,10,32,32,32,32,116,111,32, + 104,97,110,100,108,101,32,114,101,108,97,116,105,118,101,32, + 105,109,112,111,114,116,115,46,32,84,104,101,32,39,108,111, + 99,97,108,115,39,32,97,114,103,117,109,101,110,116,32,105, + 115,32,105,103,110,111,114,101,100,46,32,84,104,101,10,32, + 32,32,32,39,102,114,111,109,108,105,115,116,39,32,97,114, + 103,117,109,101,110,116,32,115,112,101,99,105,102,105,101,115, + 32,119,104,97,116,32,115,104,111,117,108,100,32,101,120,105, + 115,116,32,97,115,32,97,116,116,114,105,98,117,116,101,115, + 32,111,110,32,116,104,101,32,109,111,100,117,108,101,10,32, + 32,32,32,98,101,105,110,103,32,105,109,112,111,114,116,101, + 100,32,40,101,46,103,46,32,96,96,102,114,111,109,32,109, + 111,100,117,108,101,32,105,109,112,111,114,116,32,60,102,114, + 111,109,108,105,115,116,62,96,96,41,46,32,32,84,104,101, + 32,39,108,101,118,101,108,39,10,32,32,32,32,97,114,103, + 117,109,101,110,116,32,114,101,112,114,101,115,101,110,116,115, + 32,116,104,101,32,112,97,99,107,97,103,101,32,108,111,99, + 97,116,105,111,110,32,116,111,32,105,109,112,111,114,116,32, + 102,114,111,109,32,105,110,32,97,32,114,101,108,97,116,105, + 118,101,10,32,32,32,32,105,109,112,111,114,116,32,40,101, + 46,103,46,32,96,96,102,114,111,109,32,46,46,112,107,103, + 32,105,109,112,111,114,116,32,109,111,100,96,96,32,119,111, + 117,108,100,32,104,97,118,101,32,97,32,39,108,101,118,101, + 108,39,32,111,102,32,50,41,46,10,10,32,32,32,32,114, + 22,0,0,0,78,114,128,0,0,0,114,140,0,0,0,41, + 9,114,204,0,0,0,114,215,0,0,0,218,9,112,97,114, + 116,105,116,105,111,110,114,180,0,0,0,114,15,0,0,0, + 114,92,0,0,0,114,1,0,0,0,114,4,0,0,0,114, + 209,0,0,0,41,9,114,17,0,0,0,114,214,0,0,0, + 218,6,108,111,99,97,108,115,114,210,0,0,0,114,183,0, + 0,0,114,96,0,0,0,90,8,103,108,111,98,97,108,115, + 95,114,182,0,0,0,90,7,99,117,116,95,111,102,102,114, + 10,0,0,0,114,10,0,0,0,114,11,0,0,0,218,10, + 95,95,105,109,112,111,114,116,95,95,55,4,0,0,115,30, + 0,0,0,0,11,8,1,10,2,16,1,8,1,12,1,4, + 3,8,1,18,1,4,1,4,4,26,3,32,1,10,1,12, + 2,114,218,0,0,0,99,1,0,0,0,0,0,0,0,2, + 0,0,0,3,0,0,0,67,0,0,0,115,38,0,0,0, + 116,0,160,1,124,0,161,1,125,1,124,1,100,0,107,8, + 114,30,116,2,100,1,124,0,23,0,131,1,130,1,116,3, + 124,1,131,1,83,0,41,2,78,122,25,110,111,32,98,117, + 105,108,116,45,105,110,32,109,111,100,117,108,101,32,110,97, + 109,101,100,32,41,4,114,158,0,0,0,114,165,0,0,0, + 114,79,0,0,0,114,157,0,0,0,41,2,114,17,0,0, + 0,114,95,0,0,0,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,218,18,95,98,117,105,108,116,105,110,95, + 102,114,111,109,95,110,97,109,101,92,4,0,0,115,8,0, + 0,0,0,1,10,1,8,1,12,1,114,219,0,0,0,99, + 2,0,0,0,0,0,0,0,10,0,0,0,5,0,0,0, + 67,0,0,0,115,166,0,0,0,124,1,97,0,124,0,97, + 1,116,2,116,1,131,1,125,2,116,1,106,3,160,4,161, + 0,68,0,93,72,92,2,125,3,125,4,116,5,124,4,124, + 2,131,2,114,26,124,3,116,1,106,6,107,6,114,60,116, + 7,125,5,110,18,116,0,160,8,124,3,161,1,114,26,116, + 9,125,5,110,2,113,26,116,10,124,4,124,5,131,2,125, + 6,116,11,124,6,124,4,131,2,1,0,113,26,116,1,106, + 3,116,12,25,0,125,7,100,1,68,0,93,46,125,8,124, + 8,116,1,106,3,107,7,114,138,116,13,124,8,131,1,125, + 9,110,10,116,1,106,3,124,8,25,0,125,9,116,14,124, + 7,124,8,124,9,131,3,1,0,113,114,100,2,83,0,41, + 3,122,250,83,101,116,117,112,32,105,109,112,111,114,116,108, + 105,98,32,98,121,32,105,109,112,111,114,116,105,110,103,32, + 110,101,101,100,101,100,32,98,117,105,108,116,45,105,110,32, + 109,111,100,117,108,101,115,32,97,110,100,32,105,110,106,101, + 99,116,105,110,103,32,116,104,101,109,10,32,32,32,32,105, + 110,116,111,32,116,104,101,32,103,108,111,98,97,108,32,110, + 97,109,101,115,112,97,99,101,46,10,10,32,32,32,32,65, + 115,32,115,121,115,32,105,115,32,110,101,101,100,101,100,32, + 102,111,114,32,115,121,115,46,109,111,100,117,108,101,115,32, + 97,99,99,101,115,115,32,97,110,100,32,95,105,109,112,32, + 105,115,32,110,101,101,100,101,100,32,116,111,32,108,111,97, + 100,32,98,117,105,108,116,45,105,110,10,32,32,32,32,109, + 111,100,117,108,101,115,44,32,116,104,111,115,101,32,116,119, + 111,32,109,111,100,117,108,101,115,32,109,117,115,116,32,98, + 101,32,101,120,112,108,105,99,105,116,108,121,32,112,97,115, + 115,101,100,32,105,110,46,10,10,32,32,32,32,41,3,114, + 23,0,0,0,114,188,0,0,0,114,64,0,0,0,78,41, + 15,114,57,0,0,0,114,15,0,0,0,114,14,0,0,0, + 114,92,0,0,0,218,5,105,116,101,109,115,114,192,0,0, + 0,114,78,0,0,0,114,158,0,0,0,114,88,0,0,0, + 114,172,0,0,0,114,141,0,0,0,114,147,0,0,0,114, + 1,0,0,0,114,219,0,0,0,114,5,0,0,0,41,10, + 218,10,115,121,115,95,109,111,100,117,108,101,218,11,95,105, + 109,112,95,109,111,100,117,108,101,90,11,109,111,100,117,108, + 101,95,116,121,112,101,114,17,0,0,0,114,96,0,0,0, + 114,109,0,0,0,114,95,0,0,0,90,11,115,101,108,102, + 95,109,111,100,117,108,101,90,12,98,117,105,108,116,105,110, + 95,110,97,109,101,90,14,98,117,105,108,116,105,110,95,109, + 111,100,117,108,101,114,10,0,0,0,114,10,0,0,0,114, + 11,0,0,0,218,6,95,115,101,116,117,112,99,4,0,0, + 115,36,0,0,0,0,9,4,1,4,3,8,1,18,1,10, + 1,10,1,6,1,10,1,6,2,2,1,10,1,12,3,10, + 1,8,1,10,1,10,2,10,1,114,223,0,0,0,99,2, + 0,0,0,0,0,0,0,2,0,0,0,3,0,0,0,67, + 0,0,0,115,38,0,0,0,116,0,124,0,124,1,131,2, + 1,0,116,1,106,2,160,3,116,4,161,1,1,0,116,1, + 106,2,160,3,116,5,161,1,1,0,100,1,83,0,41,2, + 122,48,73,110,115,116,97,108,108,32,105,109,112,111,114,116, + 101,114,115,32,102,111,114,32,98,117,105,108,116,105,110,32, + 97,110,100,32,102,114,111,122,101,110,32,109,111,100,117,108, + 101,115,78,41,6,114,223,0,0,0,114,15,0,0,0,114, + 187,0,0,0,114,120,0,0,0,114,158,0,0,0,114,172, + 0,0,0,41,2,114,221,0,0,0,114,222,0,0,0,114, + 10,0,0,0,114,10,0,0,0,114,11,0,0,0,218,8, + 95,105,110,115,116,97,108,108,134,4,0,0,115,6,0,0, + 0,0,2,10,2,12,1,114,224,0,0,0,99,0,0,0, + 0,0,0,0,0,1,0,0,0,4,0,0,0,67,0,0, + 0,115,32,0,0,0,100,1,100,2,108,0,125,0,124,0, + 97,1,124,0,160,2,116,3,106,4,116,5,25,0,161,1, + 1,0,100,2,83,0,41,3,122,57,73,110,115,116,97,108, + 108,32,105,109,112,111,114,116,101,114,115,32,116,104,97,116, + 32,114,101,113,117,105,114,101,32,101,120,116,101,114,110,97, + 108,32,102,105,108,101,115,121,115,116,101,109,32,97,99,99, + 101,115,115,114,22,0,0,0,78,41,6,218,26,95,102,114, + 111,122,101,110,95,105,109,112,111,114,116,108,105,98,95,101, + 120,116,101,114,110,97,108,114,126,0,0,0,114,224,0,0, + 0,114,15,0,0,0,114,92,0,0,0,114,1,0,0,0, + 41,1,114,225,0,0,0,114,10,0,0,0,114,10,0,0, + 0,114,11,0,0,0,218,27,95,105,110,115,116,97,108,108, + 95,101,120,116,101,114,110,97,108,95,105,109,112,111,114,116, + 101,114,115,142,4,0,0,115,6,0,0,0,0,3,8,1, + 4,1,114,226,0,0,0,41,2,78,78,41,1,78,41,2, + 78,114,22,0,0,0,41,4,78,78,114,10,0,0,0,114, + 22,0,0,0,41,50,114,3,0,0,0,114,126,0,0,0, + 114,12,0,0,0,114,18,0,0,0,114,59,0,0,0,114, + 33,0,0,0,114,42,0,0,0,114,19,0,0,0,114,20, + 0,0,0,114,49,0,0,0,114,50,0,0,0,114,53,0, + 0,0,114,65,0,0,0,114,67,0,0,0,114,76,0,0, + 0,114,86,0,0,0,114,90,0,0,0,114,97,0,0,0, + 114,111,0,0,0,114,112,0,0,0,114,91,0,0,0,114, + 141,0,0,0,114,147,0,0,0,114,151,0,0,0,114,107, + 0,0,0,114,93,0,0,0,114,156,0,0,0,114,157,0, + 0,0,114,94,0,0,0,114,158,0,0,0,114,172,0,0, + 0,114,177,0,0,0,114,184,0,0,0,114,186,0,0,0, + 114,191,0,0,0,114,196,0,0,0,90,15,95,69,82,82, + 95,77,83,71,95,80,82,69,70,73,88,114,198,0,0,0, + 114,201,0,0,0,218,6,111,98,106,101,99,116,114,202,0, + 0,0,114,203,0,0,0,114,204,0,0,0,114,209,0,0, + 0,114,215,0,0,0,114,218,0,0,0,114,219,0,0,0, + 114,223,0,0,0,114,224,0,0,0,114,226,0,0,0,114, + 10,0,0,0,114,10,0,0,0,114,10,0,0,0,114,11, + 0,0,0,218,8,60,109,111,100,117,108,101,62,8,0,0, + 0,115,94,0,0,0,4,17,4,2,8,8,8,8,4,2, + 4,3,16,4,14,68,14,21,14,16,8,37,8,17,8,11, + 14,8,8,11,8,12,8,16,8,36,14,101,16,26,10,45, + 14,72,8,17,8,17,8,30,8,37,8,42,8,15,14,73, + 14,77,14,13,8,9,8,9,10,47,8,16,4,1,8,2, + 8,27,6,3,8,16,10,15,14,37,8,27,10,37,8,7, + 8,35,8,8, }; diff --git a/Python/importlib_external.h b/Python/importlib_external.h index 0443298d036d..791bfc413221 100644 --- a/Python/importlib_external.h +++ b/Python/importlib_external.h @@ -70,12 +70,12 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 69,79,75,115,12,0,0,0,80,89,84,72,79,78,67,65, 83,69,79,75,99,0,0,0,0,0,0,0,0,0,0,0, 0,2,0,0,0,19,0,0,0,115,10,0,0,0,136,0, - 116,0,106,1,107,6,83,0,41,1,122,53,84,114,117,101, + 116,0,106,1,107,6,83,0,41,1,250,53,84,114,117,101, 32,105,102,32,102,105,108,101,110,97,109,101,115,32,109,117, 115,116,32,98,101,32,99,104,101,99,107,101,100,32,99,97, 115,101,45,105,110,115,101,110,115,105,116,105,118,101,108,121, 46,41,2,218,3,95,111,115,90,7,101,110,118,105,114,111, - 110,169,0,41,1,218,3,107,101,121,114,2,0,0,0,250, + 110,169,0,169,1,218,3,107,101,121,114,3,0,0,0,250, 38,60,102,114,111,122,101,110,32,105,109,112,111,114,116,108, 105,98,46,95,98,111,111,116,115,116,114,97,112,95,101,120, 116,101,114,110,97,108,62,218,11,95,114,101,108,97,120,95, @@ -84,527 +84,520 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 101,46,60,108,111,99,97,108,115,62,46,95,114,101,108,97, 120,95,99,97,115,101,99,0,0,0,0,0,0,0,0,0, 0,0,0,1,0,0,0,83,0,0,0,115,4,0,0,0, - 100,1,83,0,41,2,122,53,84,114,117,101,32,105,102,32, - 102,105,108,101,110,97,109,101,115,32,109,117,115,116,32,98, - 101,32,99,104,101,99,107,101,100,32,99,97,115,101,45,105, - 110,115,101,110,115,105,116,105,118,101,108,121,46,70,114,2, - 0,0,0,114,2,0,0,0,114,2,0,0,0,114,2,0, - 0,0,114,4,0,0,0,114,5,0,0,0,40,0,0,0, - 115,2,0,0,0,0,2,41,5,218,3,115,121,115,218,8, - 112,108,97,116,102,111,114,109,218,10,115,116,97,114,116,115, - 119,105,116,104,218,27,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,218,35,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,83, - 84,82,95,75,69,89,41,1,114,5,0,0,0,114,2,0, - 0,0,41,1,114,3,0,0,0,114,4,0,0,0,218,16, - 95,109,97,107,101,95,114,101,108,97,120,95,99,97,115,101, - 29,0,0,0,115,14,0,0,0,0,1,12,1,12,1,6, - 2,4,2,14,4,8,3,114,11,0,0,0,99,1,0,0, - 0,0,0,0,0,1,0,0,0,4,0,0,0,67,0,0, - 0,115,20,0,0,0,116,0,124,0,131,1,100,1,64,0, - 160,1,100,2,100,3,161,2,83,0,41,4,122,42,67,111, - 110,118,101,114,116,32,97,32,51,50,45,98,105,116,32,105, - 110,116,101,103,101,114,32,116,111,32,108,105,116,116,108,101, - 45,101,110,100,105,97,110,46,108,3,0,0,0,255,127,255, - 127,3,0,233,4,0,0,0,218,6,108,105,116,116,108,101, - 41,2,218,3,105,110,116,218,8,116,111,95,98,121,116,101, - 115,41,1,218,1,120,114,2,0,0,0,114,2,0,0,0, - 114,4,0,0,0,218,12,95,112,97,99,107,95,117,105,110, - 116,51,50,46,0,0,0,115,2,0,0,0,0,2,114,17, + 100,1,83,0,41,2,114,1,0,0,0,70,114,3,0,0, + 0,114,3,0,0,0,114,3,0,0,0,114,3,0,0,0, + 114,6,0,0,0,114,7,0,0,0,40,0,0,0,115,2, + 0,0,0,0,2,41,5,218,3,115,121,115,218,8,112,108, + 97,116,102,111,114,109,218,10,115,116,97,114,116,115,119,105, + 116,104,218,27,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,218, + 35,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,83,84,82, + 95,75,69,89,41,1,114,7,0,0,0,114,3,0,0,0, + 114,4,0,0,0,114,6,0,0,0,218,16,95,109,97,107, + 101,95,114,101,108,97,120,95,99,97,115,101,29,0,0,0, + 115,14,0,0,0,0,1,12,1,12,1,6,2,4,2,14, + 4,8,3,114,13,0,0,0,99,1,0,0,0,0,0,0, + 0,1,0,0,0,4,0,0,0,67,0,0,0,115,20,0, + 0,0,116,0,124,0,131,1,100,1,64,0,160,1,100,2, + 100,3,161,2,83,0,41,4,122,42,67,111,110,118,101,114, + 116,32,97,32,51,50,45,98,105,116,32,105,110,116,101,103, + 101,114,32,116,111,32,108,105,116,116,108,101,45,101,110,100, + 105,97,110,46,236,3,0,0,0,255,127,255,127,3,0,233, + 4,0,0,0,218,6,108,105,116,116,108,101,41,2,218,3, + 105,110,116,218,8,116,111,95,98,121,116,101,115,41,1,218, + 1,120,114,3,0,0,0,114,3,0,0,0,114,6,0,0, + 0,218,12,95,112,97,99,107,95,117,105,110,116,51,50,46, + 0,0,0,115,2,0,0,0,0,2,114,20,0,0,0,99, + 1,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,124,0,131,1,100, + 1,107,2,115,16,116,1,130,1,116,2,160,3,124,0,100, + 2,161,2,83,0,41,3,122,47,67,111,110,118,101,114,116, + 32,52,32,98,121,116,101,115,32,105,110,32,108,105,116,116, + 108,101,45,101,110,100,105,97,110,32,116,111,32,97,110,32, + 105,110,116,101,103,101,114,46,114,15,0,0,0,114,16,0, + 0,0,169,4,218,3,108,101,110,218,14,65,115,115,101,114, + 116,105,111,110,69,114,114,111,114,114,17,0,0,0,218,10, + 102,114,111,109,95,98,121,116,101,115,169,1,218,4,100,97, + 116,97,114,3,0,0,0,114,3,0,0,0,114,6,0,0, + 0,218,14,95,117,110,112,97,99,107,95,117,105,110,116,51, + 50,51,0,0,0,115,4,0,0,0,0,2,16,1,114,27, 0,0,0,99,1,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,124, 0,131,1,100,1,107,2,115,16,116,1,130,1,116,2,160, 3,124,0,100,2,161,2,83,0,41,3,122,47,67,111,110, - 118,101,114,116,32,52,32,98,121,116,101,115,32,105,110,32, + 118,101,114,116,32,50,32,98,121,116,101,115,32,105,110,32, 108,105,116,116,108,101,45,101,110,100,105,97,110,32,116,111, - 32,97,110,32,105,110,116,101,103,101,114,46,114,12,0,0, - 0,114,13,0,0,0,41,4,218,3,108,101,110,218,14,65, - 115,115,101,114,116,105,111,110,69,114,114,111,114,114,14,0, - 0,0,218,10,102,114,111,109,95,98,121,116,101,115,41,1, - 218,4,100,97,116,97,114,2,0,0,0,114,2,0,0,0, - 114,4,0,0,0,218,14,95,117,110,112,97,99,107,95,117, - 105,110,116,51,50,51,0,0,0,115,4,0,0,0,0,2, - 16,1,114,22,0,0,0,99,1,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,124,0,131,1,100,1,107,2,115,16,116,1,130, - 1,116,2,160,3,124,0,100,2,161,2,83,0,41,3,122, - 47,67,111,110,118,101,114,116,32,50,32,98,121,116,101,115, - 32,105,110,32,108,105,116,116,108,101,45,101,110,100,105,97, - 110,32,116,111,32,97,110,32,105,110,116,101,103,101,114,46, - 233,2,0,0,0,114,13,0,0,0,41,4,114,18,0,0, - 0,114,19,0,0,0,114,14,0,0,0,114,20,0,0,0, - 41,1,114,21,0,0,0,114,2,0,0,0,114,2,0,0, - 0,114,4,0,0,0,218,14,95,117,110,112,97,99,107,95, - 117,105,110,116,49,54,56,0,0,0,115,4,0,0,0,0, - 2,16,1,114,24,0,0,0,99,0,0,0,0,0,0,0, - 0,1,0,0,0,4,0,0,0,71,0,0,0,115,20,0, - 0,0,116,0,160,1,100,1,100,2,132,0,124,0,68,0, - 131,1,161,1,83,0,41,3,122,31,82,101,112,108,97,99, - 101,109,101,110,116,32,102,111,114,32,111,115,46,112,97,116, - 104,46,106,111,105,110,40,41,46,99,1,0,0,0,0,0, - 0,0,2,0,0,0,5,0,0,0,83,0,0,0,115,26, - 0,0,0,103,0,124,0,93,18,125,1,124,1,114,22,124, - 1,160,0,116,1,161,1,145,2,113,4,83,0,114,2,0, - 0,0,41,2,218,6,114,115,116,114,105,112,218,15,112,97, - 116,104,95,115,101,112,97,114,97,116,111,114,115,41,2,218, - 2,46,48,218,4,112,97,114,116,114,2,0,0,0,114,2, - 0,0,0,114,4,0,0,0,218,10,60,108,105,115,116,99, - 111,109,112,62,64,0,0,0,115,6,0,0,0,6,1,2, - 0,4,255,122,30,95,112,97,116,104,95,106,111,105,110,46, - 60,108,111,99,97,108,115,62,46,60,108,105,115,116,99,111, - 109,112,62,41,2,218,8,112,97,116,104,95,115,101,112,218, - 4,106,111,105,110,41,1,218,10,112,97,116,104,95,112,97, - 114,116,115,114,2,0,0,0,114,2,0,0,0,114,4,0, - 0,0,218,10,95,112,97,116,104,95,106,111,105,110,62,0, - 0,0,115,6,0,0,0,0,2,10,1,2,255,114,33,0, - 0,0,99,1,0,0,0,0,0,0,0,5,0,0,0,5, - 0,0,0,67,0,0,0,115,96,0,0,0,116,0,116,1, - 131,1,100,1,107,2,114,36,124,0,160,2,116,3,161,1, - 92,3,125,1,125,2,125,3,124,1,124,3,102,2,83,0, - 116,4,124,0,131,1,68,0,93,42,125,4,124,4,116,1, - 107,6,114,44,124,0,106,5,124,4,100,1,100,2,141,2, - 92,2,125,1,125,3,124,1,124,3,102,2,2,0,1,0, - 83,0,113,44,100,3,124,0,102,2,83,0,41,4,122,32, - 82,101,112,108,97,99,101,109,101,110,116,32,102,111,114,32, - 111,115,46,112,97,116,104,46,115,112,108,105,116,40,41,46, - 233,1,0,0,0,41,1,90,8,109,97,120,115,112,108,105, - 116,218,0,41,6,114,18,0,0,0,114,26,0,0,0,218, - 10,114,112,97,114,116,105,116,105,111,110,114,30,0,0,0, - 218,8,114,101,118,101,114,115,101,100,218,6,114,115,112,108, - 105,116,41,5,218,4,112,97,116,104,90,5,102,114,111,110, - 116,218,1,95,218,4,116,97,105,108,114,16,0,0,0,114, - 2,0,0,0,114,2,0,0,0,114,4,0,0,0,218,11, - 95,112,97,116,104,95,115,112,108,105,116,68,0,0,0,115, - 16,0,0,0,0,2,12,1,16,1,8,1,12,1,8,1, - 18,1,14,1,114,42,0,0,0,99,1,0,0,0,0,0, - 0,0,1,0,0,0,3,0,0,0,67,0,0,0,115,10, - 0,0,0,116,0,160,1,124,0,161,1,83,0,41,1,122, - 126,83,116,97,116,32,116,104,101,32,112,97,116,104,46,10, - 10,32,32,32,32,77,97,100,101,32,97,32,115,101,112,97, - 114,97,116,101,32,102,117,110,99,116,105,111,110,32,116,111, - 32,109,97,107,101,32,105,116,32,101,97,115,105,101,114,32, - 116,111,32,111,118,101,114,114,105,100,101,32,105,110,32,101, - 120,112,101,114,105,109,101,110,116,115,10,32,32,32,32,40, - 101,46,103,46,32,99,97,99,104,101,32,115,116,97,116,32, - 114,101,115,117,108,116,115,41,46,10,10,32,32,32,32,41, - 2,114,1,0,0,0,90,4,115,116,97,116,41,1,114,39, - 0,0,0,114,2,0,0,0,114,2,0,0,0,114,4,0, - 0,0,218,10,95,112,97,116,104,95,115,116,97,116,80,0, - 0,0,115,2,0,0,0,0,7,114,43,0,0,0,99,2, - 0,0,0,0,0,0,0,3,0,0,0,8,0,0,0,67, - 0,0,0,115,50,0,0,0,122,12,116,0,124,0,131,1, - 125,2,87,0,110,22,4,0,116,1,107,10,114,34,1,0, - 1,0,1,0,89,0,100,1,83,0,88,0,124,2,106,2, - 100,2,64,0,124,1,107,2,83,0,41,3,122,49,84,101, - 115,116,32,119,104,101,116,104,101,114,32,116,104,101,32,112, - 97,116,104,32,105,115,32,116,104,101,32,115,112,101,99,105, - 102,105,101,100,32,109,111,100,101,32,116,121,112,101,46,70, - 105,0,240,0,0,41,3,114,43,0,0,0,218,7,79,83, - 69,114,114,111,114,218,7,115,116,95,109,111,100,101,41,3, - 114,39,0,0,0,218,4,109,111,100,101,90,9,115,116,97, - 116,95,105,110,102,111,114,2,0,0,0,114,2,0,0,0, - 114,4,0,0,0,218,18,95,112,97,116,104,95,105,115,95, - 109,111,100,101,95,116,121,112,101,90,0,0,0,115,10,0, - 0,0,0,2,2,1,12,1,14,1,8,1,114,47,0,0, - 0,99,1,0,0,0,0,0,0,0,1,0,0,0,3,0, - 0,0,67,0,0,0,115,10,0,0,0,116,0,124,0,100, - 1,131,2,83,0,41,2,122,31,82,101,112,108,97,99,101, + 32,97,110,32,105,110,116,101,103,101,114,46,233,2,0,0, + 0,114,16,0,0,0,114,21,0,0,0,114,25,0,0,0, + 114,3,0,0,0,114,3,0,0,0,114,6,0,0,0,218, + 14,95,117,110,112,97,99,107,95,117,105,110,116,49,54,56, + 0,0,0,115,4,0,0,0,0,2,16,1,114,29,0,0, + 0,99,0,0,0,0,0,0,0,0,1,0,0,0,4,0, + 0,0,71,0,0,0,115,20,0,0,0,116,0,160,1,100, + 1,100,2,132,0,124,0,68,0,131,1,161,1,83,0,41, + 3,122,31,82,101,112,108,97,99,101,109,101,110,116,32,102, + 111,114,32,111,115,46,112,97,116,104,46,106,111,105,110,40, + 41,46,99,1,0,0,0,0,0,0,0,2,0,0,0,5, + 0,0,0,83,0,0,0,115,26,0,0,0,103,0,124,0, + 93,18,125,1,124,1,114,22,124,1,160,0,116,1,161,1, + 145,2,113,4,83,0,114,3,0,0,0,41,2,218,6,114, + 115,116,114,105,112,218,15,112,97,116,104,95,115,101,112,97, + 114,97,116,111,114,115,41,2,218,2,46,48,218,4,112,97, + 114,116,114,3,0,0,0,114,3,0,0,0,114,6,0,0, + 0,218,10,60,108,105,115,116,99,111,109,112,62,64,0,0, + 0,115,6,0,0,0,6,1,2,0,4,255,122,30,95,112, + 97,116,104,95,106,111,105,110,46,60,108,111,99,97,108,115, + 62,46,60,108,105,115,116,99,111,109,112,62,41,2,218,8, + 112,97,116,104,95,115,101,112,218,4,106,111,105,110,41,1, + 218,10,112,97,116,104,95,112,97,114,116,115,114,3,0,0, + 0,114,3,0,0,0,114,6,0,0,0,218,10,95,112,97, + 116,104,95,106,111,105,110,62,0,0,0,115,6,0,0,0, + 0,2,10,1,2,255,114,38,0,0,0,99,1,0,0,0, + 0,0,0,0,5,0,0,0,5,0,0,0,67,0,0,0, + 115,96,0,0,0,116,0,116,1,131,1,100,1,107,2,114, + 36,124,0,160,2,116,3,161,1,92,3,125,1,125,2,125, + 3,124,1,124,3,102,2,83,0,116,4,124,0,131,1,68, + 0,93,42,125,4,124,4,116,1,107,6,114,44,124,0,106, + 5,124,4,100,1,100,2,141,2,92,2,125,1,125,3,124, + 1,124,3,102,2,2,0,1,0,83,0,113,44,100,3,124, + 0,102,2,83,0,41,4,122,32,82,101,112,108,97,99,101, 109,101,110,116,32,102,111,114,32,111,115,46,112,97,116,104, - 46,105,115,102,105,108,101,46,105,0,128,0,0,41,1,114, - 47,0,0,0,41,1,114,39,0,0,0,114,2,0,0,0, - 114,2,0,0,0,114,4,0,0,0,218,12,95,112,97,116, - 104,95,105,115,102,105,108,101,99,0,0,0,115,2,0,0, - 0,0,2,114,48,0,0,0,99,1,0,0,0,0,0,0, - 0,1,0,0,0,3,0,0,0,67,0,0,0,115,22,0, - 0,0,124,0,115,12,116,0,160,1,161,0,125,0,116,2, - 124,0,100,1,131,2,83,0,41,2,122,30,82,101,112,108, - 97,99,101,109,101,110,116,32,102,111,114,32,111,115,46,112, - 97,116,104,46,105,115,100,105,114,46,105,0,64,0,0,41, - 3,114,1,0,0,0,218,6,103,101,116,99,119,100,114,47, - 0,0,0,41,1,114,39,0,0,0,114,2,0,0,0,114, - 2,0,0,0,114,4,0,0,0,218,11,95,112,97,116,104, - 95,105,115,100,105,114,104,0,0,0,115,6,0,0,0,0, - 2,4,1,8,1,114,50,0,0,0,99,1,0,0,0,0, + 46,115,112,108,105,116,40,41,46,233,1,0,0,0,41,1, + 90,8,109,97,120,115,112,108,105,116,218,0,41,6,114,22, + 0,0,0,114,31,0,0,0,218,10,114,112,97,114,116,105, + 116,105,111,110,114,35,0,0,0,218,8,114,101,118,101,114, + 115,101,100,218,6,114,115,112,108,105,116,41,5,218,4,112, + 97,116,104,90,5,102,114,111,110,116,218,1,95,218,4,116, + 97,105,108,114,19,0,0,0,114,3,0,0,0,114,3,0, + 0,0,114,6,0,0,0,218,11,95,112,97,116,104,95,115, + 112,108,105,116,68,0,0,0,115,16,0,0,0,0,2,12, + 1,16,1,8,1,12,1,8,1,18,1,14,1,114,47,0, + 0,0,99,1,0,0,0,0,0,0,0,1,0,0,0,3, + 0,0,0,67,0,0,0,115,10,0,0,0,116,0,160,1, + 124,0,161,1,83,0,41,1,122,126,83,116,97,116,32,116, + 104,101,32,112,97,116,104,46,10,10,32,32,32,32,77,97, + 100,101,32,97,32,115,101,112,97,114,97,116,101,32,102,117, + 110,99,116,105,111,110,32,116,111,32,109,97,107,101,32,105, + 116,32,101,97,115,105,101,114,32,116,111,32,111,118,101,114, + 114,105,100,101,32,105,110,32,101,120,112,101,114,105,109,101, + 110,116,115,10,32,32,32,32,40,101,46,103,46,32,99,97, + 99,104,101,32,115,116,97,116,32,114,101,115,117,108,116,115, + 41,46,10,10,32,32,32,32,41,2,114,2,0,0,0,90, + 4,115,116,97,116,169,1,114,44,0,0,0,114,3,0,0, + 0,114,3,0,0,0,114,6,0,0,0,218,10,95,112,97, + 116,104,95,115,116,97,116,80,0,0,0,115,2,0,0,0, + 0,7,114,49,0,0,0,99,2,0,0,0,0,0,0,0, + 3,0,0,0,8,0,0,0,67,0,0,0,115,50,0,0, + 0,122,12,116,0,124,0,131,1,125,2,87,0,110,22,4, + 0,116,1,107,10,114,34,1,0,1,0,1,0,89,0,100, + 1,83,0,88,0,124,2,106,2,100,2,64,0,124,1,107, + 2,83,0,41,3,122,49,84,101,115,116,32,119,104,101,116, + 104,101,114,32,116,104,101,32,112,97,116,104,32,105,115,32, + 116,104,101,32,115,112,101,99,105,102,105,101,100,32,109,111, + 100,101,32,116,121,112,101,46,70,105,0,240,0,0,41,3, + 114,49,0,0,0,218,7,79,83,69,114,114,111,114,218,7, + 115,116,95,109,111,100,101,41,3,114,44,0,0,0,218,4, + 109,111,100,101,90,9,115,116,97,116,95,105,110,102,111,114, + 3,0,0,0,114,3,0,0,0,114,6,0,0,0,218,18, + 95,112,97,116,104,95,105,115,95,109,111,100,101,95,116,121, + 112,101,90,0,0,0,115,10,0,0,0,0,2,2,1,12, + 1,14,1,8,1,114,53,0,0,0,99,1,0,0,0,0, 0,0,0,1,0,0,0,3,0,0,0,67,0,0,0,115, - 26,0,0,0,124,0,160,0,116,1,161,1,112,24,124,0, - 100,1,100,2,133,2,25,0,116,2,107,6,83,0,41,3, - 122,142,82,101,112,108,97,99,101,109,101,110,116,32,102,111, - 114,32,111,115,46,112,97,116,104,46,105,115,97,98,115,46, - 10,10,32,32,32,32,67,111,110,115,105,100,101,114,115,32, - 97,32,87,105,110,100,111,119,115,32,100,114,105,118,101,45, - 114,101,108,97,116,105,118,101,32,112,97,116,104,32,40,110, - 111,32,100,114,105,118,101,44,32,98,117,116,32,115,116,97, - 114,116,115,32,119,105,116,104,32,115,108,97,115,104,41,32, - 116,111,10,32,32,32,32,115,116,105,108,108,32,98,101,32, - 34,97,98,115,111,108,117,116,101,34,46,10,32,32,32,32, - 114,34,0,0,0,233,3,0,0,0,41,3,114,8,0,0, - 0,114,26,0,0,0,218,20,95,112,97,116,104,115,101,112, - 115,95,119,105,116,104,95,99,111,108,111,110,41,1,114,39, - 0,0,0,114,2,0,0,0,114,2,0,0,0,114,4,0, - 0,0,218,11,95,112,97,116,104,95,105,115,97,98,115,111, - 0,0,0,115,2,0,0,0,0,6,114,53,0,0,0,105, - 182,1,0,0,99,3,0,0,0,0,0,0,0,6,0,0, - 0,11,0,0,0,67,0,0,0,115,162,0,0,0,100,1, - 160,0,124,0,116,1,124,0,131,1,161,2,125,3,116,2, - 160,3,124,3,116,2,106,4,116,2,106,5,66,0,116,2, - 106,6,66,0,124,2,100,2,64,0,161,3,125,4,122,50, - 116,7,160,8,124,4,100,3,161,2,143,16,125,5,124,5, - 160,9,124,1,161,1,1,0,87,0,53,0,81,0,82,0, - 88,0,116,2,160,10,124,3,124,0,161,2,1,0,87,0, - 110,58,4,0,116,11,107,10,114,156,1,0,1,0,1,0, - 122,14,116,2,160,12,124,3,161,1,1,0,87,0,110,20, - 4,0,116,11,107,10,114,148,1,0,1,0,1,0,89,0, - 110,2,88,0,130,0,89,0,110,2,88,0,100,4,83,0, - 41,5,122,162,66,101,115,116,45,101,102,102,111,114,116,32, - 102,117,110,99,116,105,111,110,32,116,111,32,119,114,105,116, - 101,32,100,97,116,97,32,116,111,32,97,32,112,97,116,104, - 32,97,116,111,109,105,99,97,108,108,121,46,10,32,32,32, - 32,66,101,32,112,114,101,112,97,114,101,100,32,116,111,32, - 104,97,110,100,108,101,32,97,32,70,105,108,101,69,120,105, - 115,116,115,69,114,114,111,114,32,105,102,32,99,111,110,99, - 117,114,114,101,110,116,32,119,114,105,116,105,110,103,32,111, - 102,32,116,104,101,10,32,32,32,32,116,101,109,112,111,114, - 97,114,121,32,102,105,108,101,32,105,115,32,97,116,116,101, - 109,112,116,101,100,46,122,5,123,125,46,123,125,105,182,1, - 0,0,90,2,119,98,78,41,13,218,6,102,111,114,109,97, - 116,218,2,105,100,114,1,0,0,0,90,4,111,112,101,110, - 90,6,79,95,69,88,67,76,90,7,79,95,67,82,69,65, - 84,90,8,79,95,87,82,79,78,76,89,218,3,95,105,111, - 218,6,70,105,108,101,73,79,218,5,119,114,105,116,101,218, - 7,114,101,112,108,97,99,101,114,44,0,0,0,90,6,117, - 110,108,105,110,107,41,6,114,39,0,0,0,114,21,0,0, - 0,114,46,0,0,0,90,8,112,97,116,104,95,116,109,112, - 90,2,102,100,218,4,102,105,108,101,114,2,0,0,0,114, - 2,0,0,0,114,4,0,0,0,218,13,95,119,114,105,116, - 101,95,97,116,111,109,105,99,120,0,0,0,115,30,0,0, - 0,0,5,16,1,6,1,16,0,6,255,4,2,2,3,14, - 1,20,1,16,1,14,1,2,1,14,1,14,1,6,1,114, - 61,0,0,0,105,73,13,0,0,114,23,0,0,0,114,13, - 0,0,0,115,2,0,0,0,13,10,90,11,95,95,112,121, - 99,97,99,104,101,95,95,122,4,111,112,116,45,122,3,46, - 112,121,122,4,46,112,121,99,78,41,1,218,12,111,112,116, - 105,109,105,122,97,116,105,111,110,99,2,0,0,0,1,0, - 0,0,12,0,0,0,5,0,0,0,67,0,0,0,115,88, - 1,0,0,124,1,100,1,107,9,114,52,116,0,160,1,100, - 2,116,2,161,2,1,0,124,2,100,1,107,9,114,40,100, - 3,125,3,116,3,124,3,131,1,130,1,124,1,114,48,100, - 4,110,2,100,5,125,2,116,4,160,5,124,0,161,1,125, - 0,116,6,124,0,131,1,92,2,125,4,125,5,124,5,160, - 7,100,6,161,1,92,3,125,6,125,7,125,8,116,8,106, - 9,106,10,125,9,124,9,100,1,107,8,114,114,116,11,100, - 7,131,1,130,1,100,4,160,12,124,6,114,126,124,6,110, - 2,124,8,124,7,124,9,103,3,161,1,125,10,124,2,100, - 1,107,8,114,172,116,8,106,13,106,14,100,8,107,2,114, - 164,100,4,125,2,110,8,116,8,106,13,106,14,125,2,116, - 15,124,2,131,1,125,2,124,2,100,4,107,3,114,224,124, - 2,160,16,161,0,115,210,116,17,100,9,160,18,124,2,161, - 1,131,1,130,1,100,10,160,18,124,10,116,19,124,2,161, - 3,125,10,124,10,116,20,100,8,25,0,23,0,125,11,116, - 8,106,21,100,1,107,9,144,1,114,76,116,22,124,4,131, - 1,144,1,115,16,116,23,116,4,160,24,161,0,124,4,131, - 2,125,4,124,4,100,5,25,0,100,11,107,2,144,1,114, - 56,124,4,100,8,25,0,116,25,107,7,144,1,114,56,124, - 4,100,12,100,1,133,2,25,0,125,4,116,23,116,8,106, - 21,124,4,160,26,116,25,161,1,124,11,131,3,83,0,116, - 23,124,4,116,27,124,11,131,3,83,0,41,13,97,254,2, - 0,0,71,105,118,101,110,32,116,104,101,32,112,97,116,104, - 32,116,111,32,97,32,46,112,121,32,102,105,108,101,44,32, - 114,101,116,117,114,110,32,116,104,101,32,112,97,116,104,32, - 116,111,32,105,116,115,32,46,112,121,99,32,102,105,108,101, - 46,10,10,32,32,32,32,84,104,101,32,46,112,121,32,102, - 105,108,101,32,100,111,101,115,32,110,111,116,32,110,101,101, - 100,32,116,111,32,101,120,105,115,116,59,32,116,104,105,115, - 32,115,105,109,112,108,121,32,114,101,116,117,114,110,115,32, - 116,104,101,32,112,97,116,104,32,116,111,32,116,104,101,10, - 32,32,32,32,46,112,121,99,32,102,105,108,101,32,99,97, - 108,99,117,108,97,116,101,100,32,97,115,32,105,102,32,116, - 104,101,32,46,112,121,32,102,105,108,101,32,119,101,114,101, - 32,105,109,112,111,114,116,101,100,46,10,10,32,32,32,32, - 84,104,101,32,39,111,112,116,105,109,105,122,97,116,105,111, - 110,39,32,112,97,114,97,109,101,116,101,114,32,99,111,110, - 116,114,111,108,115,32,116,104,101,32,112,114,101,115,117,109, - 101,100,32,111,112,116,105,109,105,122,97,116,105,111,110,32, - 108,101,118,101,108,32,111,102,10,32,32,32,32,116,104,101, - 32,98,121,116,101,99,111,100,101,32,102,105,108,101,46,32, - 73,102,32,39,111,112,116,105,109,105,122,97,116,105,111,110, - 39,32,105,115,32,110,111,116,32,78,111,110,101,44,32,116, - 104,101,32,115,116,114,105,110,103,32,114,101,112,114,101,115, - 101,110,116,97,116,105,111,110,10,32,32,32,32,111,102,32, - 116,104,101,32,97,114,103,117,109,101,110,116,32,105,115,32, - 116,97,107,101,110,32,97,110,100,32,118,101,114,105,102,105, - 101,100,32,116,111,32,98,101,32,97,108,112,104,97,110,117, - 109,101,114,105,99,32,40,101,108,115,101,32,86,97,108,117, - 101,69,114,114,111,114,10,32,32,32,32,105,115,32,114,97, - 105,115,101,100,41,46,10,10,32,32,32,32,84,104,101,32, - 100,101,98,117,103,95,111,118,101,114,114,105,100,101,32,112, - 97,114,97,109,101,116,101,114,32,105,115,32,100,101,112,114, - 101,99,97,116,101,100,46,32,73,102,32,100,101,98,117,103, - 95,111,118,101,114,114,105,100,101,32,105,115,32,110,111,116, - 32,78,111,110,101,44,10,32,32,32,32,97,32,84,114,117, - 101,32,118,97,108,117,101,32,105,115,32,116,104,101,32,115, - 97,109,101,32,97,115,32,115,101,116,116,105,110,103,32,39, - 111,112,116,105,109,105,122,97,116,105,111,110,39,32,116,111, - 32,116,104,101,32,101,109,112,116,121,32,115,116,114,105,110, - 103,10,32,32,32,32,119,104,105,108,101,32,97,32,70,97, - 108,115,101,32,118,97,108,117,101,32,105,115,32,101,113,117, - 105,118,97,108,101,110,116,32,116,111,32,115,101,116,116,105, - 110,103,32,39,111,112,116,105,109,105,122,97,116,105,111,110, - 39,32,116,111,32,39,49,39,46,10,10,32,32,32,32,73, - 102,32,115,121,115,46,105,109,112,108,101,109,101,110,116,97, - 116,105,111,110,46,99,97,99,104,101,95,116,97,103,32,105, - 115,32,78,111,110,101,32,116,104,101,110,32,78,111,116,73, - 109,112,108,101,109,101,110,116,101,100,69,114,114,111,114,32, - 105,115,32,114,97,105,115,101,100,46,10,10,32,32,32,32, - 78,122,70,116,104,101,32,100,101,98,117,103,95,111,118,101, - 114,114,105,100,101,32,112,97,114,97,109,101,116,101,114,32, - 105,115,32,100,101,112,114,101,99,97,116,101,100,59,32,117, - 115,101,32,39,111,112,116,105,109,105,122,97,116,105,111,110, - 39,32,105,110,115,116,101,97,100,122,50,100,101,98,117,103, - 95,111,118,101,114,114,105,100,101,32,111,114,32,111,112,116, - 105,109,105,122,97,116,105,111,110,32,109,117,115,116,32,98, - 101,32,115,101,116,32,116,111,32,78,111,110,101,114,35,0, - 0,0,114,34,0,0,0,218,1,46,122,36,115,121,115,46, - 105,109,112,108,101,109,101,110,116,97,116,105,111,110,46,99, - 97,99,104,101,95,116,97,103,32,105,115,32,78,111,110,101, - 233,0,0,0,0,122,24,123,33,114,125,32,105,115,32,110, - 111,116,32,97,108,112,104,97,110,117,109,101,114,105,99,122, - 7,123,125,46,123,125,123,125,250,1,58,114,23,0,0,0, - 41,28,218,9,95,119,97,114,110,105,110,103,115,218,4,119, - 97,114,110,218,18,68,101,112,114,101,99,97,116,105,111,110, - 87,97,114,110,105,110,103,218,9,84,121,112,101,69,114,114, - 111,114,114,1,0,0,0,218,6,102,115,112,97,116,104,114, - 42,0,0,0,114,36,0,0,0,114,6,0,0,0,218,14, - 105,109,112,108,101,109,101,110,116,97,116,105,111,110,218,9, - 99,97,99,104,101,95,116,97,103,218,19,78,111,116,73,109, - 112,108,101,109,101,110,116,101,100,69,114,114,111,114,114,31, - 0,0,0,218,5,102,108,97,103,115,218,8,111,112,116,105, - 109,105,122,101,218,3,115,116,114,218,7,105,115,97,108,110, - 117,109,218,10,86,97,108,117,101,69,114,114,111,114,114,54, - 0,0,0,218,4,95,79,80,84,218,17,66,89,84,69,67, - 79,68,69,95,83,85,70,70,73,88,69,83,218,14,112,121, - 99,97,99,104,101,95,112,114,101,102,105,120,114,53,0,0, - 0,114,33,0,0,0,114,49,0,0,0,114,26,0,0,0, - 218,6,108,115,116,114,105,112,218,8,95,80,89,67,65,67, - 72,69,41,12,114,39,0,0,0,90,14,100,101,98,117,103, - 95,111,118,101,114,114,105,100,101,114,62,0,0,0,218,7, - 109,101,115,115,97,103,101,218,4,104,101,97,100,114,41,0, - 0,0,90,4,98,97,115,101,218,3,115,101,112,218,4,114, - 101,115,116,90,3,116,97,103,90,15,97,108,109,111,115,116, - 95,102,105,108,101,110,97,109,101,218,8,102,105,108,101,110, - 97,109,101,114,2,0,0,0,114,2,0,0,0,114,4,0, - 0,0,218,17,99,97,99,104,101,95,102,114,111,109,95,115, - 111,117,114,99,101,32,1,0,0,115,72,0,0,0,0,18, - 8,1,6,1,2,255,4,2,8,1,4,1,8,1,12,1, - 10,1,12,1,16,1,8,1,8,1,8,1,24,1,8,1, - 12,1,6,2,8,1,8,1,8,1,8,1,14,1,14,1, - 12,1,12,9,10,1,14,5,28,1,12,4,2,1,4,1, - 8,1,2,253,4,5,114,89,0,0,0,99,1,0,0,0, - 0,0,0,0,10,0,0,0,5,0,0,0,67,0,0,0, - 115,46,1,0,0,116,0,106,1,106,2,100,1,107,8,114, - 20,116,3,100,2,131,1,130,1,116,4,160,5,124,0,161, - 1,125,0,116,6,124,0,131,1,92,2,125,1,125,2,100, - 3,125,3,116,0,106,7,100,1,107,9,114,102,116,0,106, - 7,160,8,116,9,161,1,125,4,124,1,160,10,124,4,116, - 11,23,0,161,1,114,102,124,1,116,12,124,4,131,1,100, - 1,133,2,25,0,125,1,100,4,125,3,124,3,115,144,116, - 6,124,1,131,1,92,2,125,1,125,5,124,5,116,13,107, - 3,114,144,116,14,116,13,155,0,100,5,124,0,155,2,157, - 3,131,1,130,1,124,2,160,15,100,6,161,1,125,6,124, - 6,100,7,107,7,114,178,116,14,100,8,124,2,155,2,157, - 2,131,1,130,1,110,92,124,6,100,9,107,2,144,1,114, - 14,124,2,160,16,100,6,100,10,161,2,100,11,25,0,125, - 7,124,7,160,10,116,17,161,1,115,228,116,14,100,12,116, - 17,155,2,157,2,131,1,130,1,124,7,116,12,116,17,131, - 1,100,1,133,2,25,0,125,8,124,8,160,18,161,0,144, - 1,115,14,116,14,100,13,124,7,155,2,100,14,157,3,131, - 1,130,1,124,2,160,19,100,6,161,1,100,15,25,0,125, - 9,116,20,124,1,124,9,116,21,100,15,25,0,23,0,131, - 2,83,0,41,16,97,110,1,0,0,71,105,118,101,110,32, - 116,104,101,32,112,97,116,104,32,116,111,32,97,32,46,112, - 121,99,46,32,102,105,108,101,44,32,114,101,116,117,114,110, - 32,116,104,101,32,112,97,116,104,32,116,111,32,105,116,115, - 32,46,112,121,32,102,105,108,101,46,10,10,32,32,32,32, - 84,104,101,32,46,112,121,99,32,102,105,108,101,32,100,111, - 101,115,32,110,111,116,32,110,101,101,100,32,116,111,32,101, - 120,105,115,116,59,32,116,104,105,115,32,115,105,109,112,108, - 121,32,114,101,116,117,114,110,115,32,116,104,101,32,112,97, - 116,104,32,116,111,10,32,32,32,32,116,104,101,32,46,112, - 121,32,102,105,108,101,32,99,97,108,99,117,108,97,116,101, - 100,32,116,111,32,99,111,114,114,101,115,112,111,110,100,32, - 116,111,32,116,104,101,32,46,112,121,99,32,102,105,108,101, - 46,32,32,73,102,32,112,97,116,104,32,100,111,101,115,10, - 32,32,32,32,110,111,116,32,99,111,110,102,111,114,109,32, - 116,111,32,80,69,80,32,51,49,52,55,47,52,56,56,32, - 102,111,114,109,97,116,44,32,86,97,108,117,101,69,114,114, - 111,114,32,119,105,108,108,32,98,101,32,114,97,105,115,101, - 100,46,32,73,102,10,32,32,32,32,115,121,115,46,105,109, - 112,108,101,109,101,110,116,97,116,105,111,110,46,99,97,99, - 104,101,95,116,97,103,32,105,115,32,78,111,110,101,32,116, - 104,101,110,32,78,111,116,73,109,112,108,101,109,101,110,116, - 101,100,69,114,114,111,114,32,105,115,32,114,97,105,115,101, - 100,46,10,10,32,32,32,32,78,122,36,115,121,115,46,105, - 109,112,108,101,109,101,110,116,97,116,105,111,110,46,99,97, - 99,104,101,95,116,97,103,32,105,115,32,78,111,110,101,70, - 84,122,31,32,110,111,116,32,98,111,116,116,111,109,45,108, - 101,118,101,108,32,100,105,114,101,99,116,111,114,121,32,105, - 110,32,114,63,0,0,0,62,2,0,0,0,114,23,0,0, - 0,114,51,0,0,0,122,29,101,120,112,101,99,116,101,100, - 32,111,110,108,121,32,50,32,111,114,32,51,32,100,111,116, - 115,32,105,110,32,114,51,0,0,0,114,23,0,0,0,233, - 254,255,255,255,122,53,111,112,116,105,109,105,122,97,116,105, - 111,110,32,112,111,114,116,105,111,110,32,111,102,32,102,105, - 108,101,110,97,109,101,32,100,111,101,115,32,110,111,116,32, - 115,116,97,114,116,32,119,105,116,104,32,122,19,111,112,116, - 105,109,105,122,97,116,105,111,110,32,108,101,118,101,108,32, - 122,29,32,105,115,32,110,111,116,32,97,110,32,97,108,112, - 104,97,110,117,109,101,114,105,99,32,118,97,108,117,101,114, - 64,0,0,0,41,22,114,6,0,0,0,114,71,0,0,0, - 114,72,0,0,0,114,73,0,0,0,114,1,0,0,0,114, - 70,0,0,0,114,42,0,0,0,114,81,0,0,0,114,25, - 0,0,0,114,26,0,0,0,114,8,0,0,0,114,30,0, - 0,0,114,18,0,0,0,114,83,0,0,0,114,78,0,0, - 0,218,5,99,111,117,110,116,114,38,0,0,0,114,79,0, - 0,0,114,77,0,0,0,218,9,112,97,114,116,105,116,105, - 111,110,114,33,0,0,0,218,15,83,79,85,82,67,69,95, - 83,85,70,70,73,88,69,83,41,10,114,39,0,0,0,114, - 85,0,0,0,90,16,112,121,99,97,99,104,101,95,102,105, - 108,101,110,97,109,101,90,23,102,111,117,110,100,95,105,110, - 95,112,121,99,97,99,104,101,95,112,114,101,102,105,120,90, - 13,115,116,114,105,112,112,101,100,95,112,97,116,104,90,7, - 112,121,99,97,99,104,101,90,9,100,111,116,95,99,111,117, - 110,116,114,62,0,0,0,90,9,111,112,116,95,108,101,118, - 101,108,90,13,98,97,115,101,95,102,105,108,101,110,97,109, - 101,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, - 218,17,115,111,117,114,99,101,95,102,114,111,109,95,99,97, - 99,104,101,103,1,0,0,115,52,0,0,0,0,9,12,1, - 8,1,10,1,12,1,4,1,10,1,12,1,14,1,16,1, - 4,1,4,1,12,1,8,1,18,2,10,1,8,1,16,1, - 10,1,16,1,10,1,14,2,16,1,10,1,16,2,14,1, - 114,94,0,0,0,99,1,0,0,0,0,0,0,0,5,0, - 0,0,9,0,0,0,67,0,0,0,115,126,0,0,0,116, - 0,124,0,131,1,100,1,107,2,114,16,100,2,83,0,124, - 0,160,1,100,3,161,1,92,3,125,1,125,2,125,3,124, - 1,114,56,124,3,160,2,161,0,100,4,100,5,133,2,25, - 0,100,6,107,3,114,60,124,0,83,0,122,12,116,3,124, - 0,131,1,125,4,87,0,110,36,4,0,116,4,116,5,102, - 2,107,10,114,108,1,0,1,0,1,0,124,0,100,2,100, - 5,133,2,25,0,125,4,89,0,110,2,88,0,116,6,124, - 4,131,1,114,122,124,4,83,0,124,0,83,0,41,7,122, - 188,67,111,110,118,101,114,116,32,97,32,98,121,116,101,99, - 111,100,101,32,102,105,108,101,32,112,97,116,104,32,116,111, - 32,97,32,115,111,117,114,99,101,32,112,97,116,104,32,40, - 105,102,32,112,111,115,115,105,98,108,101,41,46,10,10,32, - 32,32,32,84,104,105,115,32,102,117,110,99,116,105,111,110, - 32,101,120,105,115,116,115,32,112,117,114,101,108,121,32,102, - 111,114,32,98,97,99,107,119,97,114,100,115,45,99,111,109, - 112,97,116,105,98,105,108,105,116,121,32,102,111,114,10,32, - 32,32,32,80,121,73,109,112,111,114,116,95,69,120,101,99, - 67,111,100,101,77,111,100,117,108,101,87,105,116,104,70,105, - 108,101,110,97,109,101,115,40,41,32,105,110,32,116,104,101, - 32,67,32,65,80,73,46,10,10,32,32,32,32,114,64,0, - 0,0,78,114,63,0,0,0,233,253,255,255,255,233,255,255, - 255,255,90,2,112,121,41,7,114,18,0,0,0,114,36,0, - 0,0,218,5,108,111,119,101,114,114,94,0,0,0,114,73, - 0,0,0,114,78,0,0,0,114,48,0,0,0,41,5,218, - 13,98,121,116,101,99,111,100,101,95,112,97,116,104,114,87, - 0,0,0,114,40,0,0,0,90,9,101,120,116,101,110,115, - 105,111,110,218,11,115,111,117,114,99,101,95,112,97,116,104, - 114,2,0,0,0,114,2,0,0,0,114,4,0,0,0,218, - 15,95,103,101,116,95,115,111,117,114,99,101,102,105,108,101, - 143,1,0,0,115,20,0,0,0,0,7,12,1,4,1,16, - 1,24,1,4,1,2,1,12,1,18,1,18,1,114,100,0, - 0,0,99,1,0,0,0,0,0,0,0,1,0,0,0,8, - 0,0,0,67,0,0,0,115,74,0,0,0,124,0,160,0, - 116,1,116,2,131,1,161,1,114,48,122,10,116,3,124,0, - 131,1,87,0,83,0,4,0,116,4,107,10,114,44,1,0, - 1,0,1,0,89,0,113,70,88,0,110,22,124,0,160,0, - 116,1,116,5,131,1,161,1,114,66,124,0,83,0,100,0, - 83,0,100,0,83,0,41,1,78,41,6,218,8,101,110,100, - 115,119,105,116,104,218,5,116,117,112,108,101,114,93,0,0, - 0,114,89,0,0,0,114,73,0,0,0,114,80,0,0,0, - 41,1,114,88,0,0,0,114,2,0,0,0,114,2,0,0, - 0,114,4,0,0,0,218,11,95,103,101,116,95,99,97,99, - 104,101,100,162,1,0,0,115,16,0,0,0,0,1,14,1, - 2,1,10,1,14,1,8,1,14,1,4,2,114,103,0,0, - 0,99,1,0,0,0,0,0,0,0,2,0,0,0,8,0, - 0,0,67,0,0,0,115,52,0,0,0,122,14,116,0,124, - 0,131,1,106,1,125,1,87,0,110,24,4,0,116,2,107, - 10,114,38,1,0,1,0,1,0,100,1,125,1,89,0,110, - 2,88,0,124,1,100,2,79,0,125,1,124,1,83,0,41, - 3,122,51,67,97,108,99,117,108,97,116,101,32,116,104,101, - 32,109,111,100,101,32,112,101,114,109,105,115,115,105,111,110, - 115,32,102,111,114,32,97,32,98,121,116,101,99,111,100,101, - 32,102,105,108,101,46,105,182,1,0,0,233,128,0,0,0, - 41,3,114,43,0,0,0,114,45,0,0,0,114,44,0,0, - 0,41,2,114,39,0,0,0,114,46,0,0,0,114,2,0, - 0,0,114,2,0,0,0,114,4,0,0,0,218,10,95,99, - 97,108,99,95,109,111,100,101,174,1,0,0,115,12,0,0, - 0,0,2,2,1,14,1,14,1,10,3,8,1,114,105,0, - 0,0,99,1,0,0,0,0,0,0,0,3,0,0,0,8, - 0,0,0,3,0,0,0,115,68,0,0,0,100,6,135,0, - 102,1,100,2,100,3,132,9,125,1,122,10,116,0,106,1, - 125,2,87,0,110,28,4,0,116,2,107,10,114,52,1,0, - 1,0,1,0,100,4,100,5,132,0,125,2,89,0,110,2, - 88,0,124,2,124,1,136,0,131,2,1,0,124,1,83,0, - 41,7,122,252,68,101,99,111,114,97,116,111,114,32,116,111, - 32,118,101,114,105,102,121,32,116,104,97,116,32,116,104,101, - 32,109,111,100,117,108,101,32,98,101,105,110,103,32,114,101, - 113,117,101,115,116,101,100,32,109,97,116,99,104,101,115,32, - 116,104,101,32,111,110,101,32,116,104,101,10,32,32,32,32, - 108,111,97,100,101,114,32,99,97,110,32,104,97,110,100,108, - 101,46,10,10,32,32,32,32,84,104,101,32,102,105,114,115, - 116,32,97,114,103,117,109,101,110,116,32,40,115,101,108,102, - 41,32,109,117,115,116,32,100,101,102,105,110,101,32,95,110, - 97,109,101,32,119,104,105,99,104,32,116,104,101,32,115,101, - 99,111,110,100,32,97,114,103,117,109,101,110,116,32,105,115, - 10,32,32,32,32,99,111,109,112,97,114,101,100,32,97,103, - 97,105,110,115,116,46,32,73,102,32,116,104,101,32,99,111, - 109,112,97,114,105,115,111,110,32,102,97,105,108,115,32,116, - 104,101,110,32,73,109,112,111,114,116,69,114,114,111,114,32, - 105,115,32,114,97,105,115,101,100,46,10,10,32,32,32,32, - 78,99,2,0,0,0,0,0,0,0,4,0,0,0,4,0, - 0,0,31,0,0,0,115,66,0,0,0,124,1,100,0,107, - 8,114,16,124,0,106,0,125,1,110,32,124,0,106,0,124, - 1,107,3,114,48,116,1,100,1,124,0,106,0,124,1,102, - 2,22,0,124,1,100,2,141,2,130,1,136,0,124,0,124, - 1,102,2,124,2,158,2,124,3,142,1,83,0,41,3,78, - 122,30,108,111,97,100,101,114,32,102,111,114,32,37,115,32, - 99,97,110,110,111,116,32,104,97,110,100,108,101,32,37,115, - 41,1,218,4,110,97,109,101,41,2,114,106,0,0,0,218, - 11,73,109,112,111,114,116,69,114,114,111,114,41,4,218,4, - 115,101,108,102,114,106,0,0,0,218,4,97,114,103,115,90, - 6,107,119,97,114,103,115,41,1,218,6,109,101,116,104,111, - 100,114,2,0,0,0,114,4,0,0,0,218,19,95,99,104, - 101,99,107,95,110,97,109,101,95,119,114,97,112,112,101,114, - 194,1,0,0,115,18,0,0,0,0,1,8,1,8,1,10, - 1,4,1,8,255,2,1,2,255,6,2,122,40,95,99,104, - 101,99,107,95,110,97,109,101,46,60,108,111,99,97,108,115, - 62,46,95,99,104,101,99,107,95,110,97,109,101,95,119,114, - 97,112,112,101,114,99,2,0,0,0,0,0,0,0,3,0, - 0,0,7,0,0,0,83,0,0,0,115,56,0,0,0,100, - 1,68,0,93,32,125,2,116,0,124,1,124,2,131,2,114, - 4,116,1,124,0,124,2,116,2,124,1,124,2,131,2,131, - 3,1,0,113,4,124,0,106,3,160,4,124,1,106,3,161, - 1,1,0,100,0,83,0,41,2,78,41,4,218,10,95,95, - 109,111,100,117,108,101,95,95,218,8,95,95,110,97,109,101, - 95,95,218,12,95,95,113,117,97,108,110,97,109,101,95,95, - 218,7,95,95,100,111,99,95,95,41,5,218,7,104,97,115, - 97,116,116,114,218,7,115,101,116,97,116,116,114,218,7,103, - 101,116,97,116,116,114,218,8,95,95,100,105,99,116,95,95, - 218,6,117,112,100,97,116,101,41,3,90,3,110,101,119,90, - 3,111,108,100,114,59,0,0,0,114,2,0,0,0,114,2, - 0,0,0,114,4,0,0,0,218,5,95,119,114,97,112,205, - 1,0,0,115,8,0,0,0,0,1,8,1,10,1,20,1, - 122,26,95,99,104,101,99,107,95,110,97,109,101,46,60,108, - 111,99,97,108,115,62,46,95,119,114,97,112,41,1,78,41, - 3,218,10,95,98,111,111,116,115,116,114,97,112,114,121,0, - 0,0,218,9,78,97,109,101,69,114,114,111,114,41,3,114, - 110,0,0,0,114,111,0,0,0,114,121,0,0,0,114,2, - 0,0,0,41,1,114,110,0,0,0,114,4,0,0,0,218, + 10,0,0,0,116,0,124,0,100,1,131,2,83,0,41,2, + 122,31,82,101,112,108,97,99,101,109,101,110,116,32,102,111, + 114,32,111,115,46,112,97,116,104,46,105,115,102,105,108,101, + 46,105,0,128,0,0,41,1,114,53,0,0,0,114,48,0, + 0,0,114,3,0,0,0,114,3,0,0,0,114,6,0,0, + 0,218,12,95,112,97,116,104,95,105,115,102,105,108,101,99, + 0,0,0,115,2,0,0,0,0,2,114,54,0,0,0,99, + 1,0,0,0,0,0,0,0,1,0,0,0,3,0,0,0, + 67,0,0,0,115,22,0,0,0,124,0,115,12,116,0,160, + 1,161,0,125,0,116,2,124,0,100,1,131,2,83,0,41, + 2,122,30,82,101,112,108,97,99,101,109,101,110,116,32,102, + 111,114,32,111,115,46,112,97,116,104,46,105,115,100,105,114, + 46,105,0,64,0,0,41,3,114,2,0,0,0,218,6,103, + 101,116,99,119,100,114,53,0,0,0,114,48,0,0,0,114, + 3,0,0,0,114,3,0,0,0,114,6,0,0,0,218,11, + 95,112,97,116,104,95,105,115,100,105,114,104,0,0,0,115, + 6,0,0,0,0,2,4,1,8,1,114,56,0,0,0,99, + 1,0,0,0,0,0,0,0,1,0,0,0,3,0,0,0, + 67,0,0,0,115,26,0,0,0,124,0,160,0,116,1,161, + 1,112,24,124,0,100,1,100,2,133,2,25,0,116,2,107, + 6,83,0,41,3,122,142,82,101,112,108,97,99,101,109,101, + 110,116,32,102,111,114,32,111,115,46,112,97,116,104,46,105, + 115,97,98,115,46,10,10,32,32,32,32,67,111,110,115,105, + 100,101,114,115,32,97,32,87,105,110,100,111,119,115,32,100, + 114,105,118,101,45,114,101,108,97,116,105,118,101,32,112,97, + 116,104,32,40,110,111,32,100,114,105,118,101,44,32,98,117, + 116,32,115,116,97,114,116,115,32,119,105,116,104,32,115,108, + 97,115,104,41,32,116,111,10,32,32,32,32,115,116,105,108, + 108,32,98,101,32,34,97,98,115,111,108,117,116,101,34,46, + 10,32,32,32,32,114,39,0,0,0,233,3,0,0,0,41, + 3,114,10,0,0,0,114,31,0,0,0,218,20,95,112,97, + 116,104,115,101,112,115,95,119,105,116,104,95,99,111,108,111, + 110,114,48,0,0,0,114,3,0,0,0,114,3,0,0,0, + 114,6,0,0,0,218,11,95,112,97,116,104,95,105,115,97, + 98,115,111,0,0,0,115,2,0,0,0,0,6,114,59,0, + 0,0,233,182,1,0,0,99,3,0,0,0,0,0,0,0, + 6,0,0,0,11,0,0,0,67,0,0,0,115,162,0,0, + 0,100,1,160,0,124,0,116,1,124,0,131,1,161,2,125, + 3,116,2,160,3,124,3,116,2,106,4,116,2,106,5,66, + 0,116,2,106,6,66,0,124,2,100,2,64,0,161,3,125, + 4,122,50,116,7,160,8,124,4,100,3,161,2,143,16,125, + 5,124,5,160,9,124,1,161,1,1,0,87,0,53,0,81, + 0,82,0,88,0,116,2,160,10,124,3,124,0,161,2,1, + 0,87,0,110,58,4,0,116,11,107,10,114,156,1,0,1, + 0,1,0,122,14,116,2,160,12,124,3,161,1,1,0,87, + 0,110,20,4,0,116,11,107,10,114,148,1,0,1,0,1, + 0,89,0,110,2,88,0,130,0,89,0,110,2,88,0,100, + 4,83,0,41,5,122,162,66,101,115,116,45,101,102,102,111, + 114,116,32,102,117,110,99,116,105,111,110,32,116,111,32,119, + 114,105,116,101,32,100,97,116,97,32,116,111,32,97,32,112, + 97,116,104,32,97,116,111,109,105,99,97,108,108,121,46,10, + 32,32,32,32,66,101,32,112,114,101,112,97,114,101,100,32, + 116,111,32,104,97,110,100,108,101,32,97,32,70,105,108,101, + 69,120,105,115,116,115,69,114,114,111,114,32,105,102,32,99, + 111,110,99,117,114,114,101,110,116,32,119,114,105,116,105,110, + 103,32,111,102,32,116,104,101,10,32,32,32,32,116,101,109, + 112,111,114,97,114,121,32,102,105,108,101,32,105,115,32,97, + 116,116,101,109,112,116,101,100,46,250,5,123,125,46,123,125, + 114,60,0,0,0,90,2,119,98,78,41,13,218,6,102,111, + 114,109,97,116,218,2,105,100,114,2,0,0,0,90,4,111, + 112,101,110,90,6,79,95,69,88,67,76,90,7,79,95,67, + 82,69,65,84,90,8,79,95,87,82,79,78,76,89,218,3, + 95,105,111,218,6,70,105,108,101,73,79,218,5,119,114,105, + 116,101,218,7,114,101,112,108,97,99,101,114,50,0,0,0, + 90,6,117,110,108,105,110,107,41,6,114,44,0,0,0,114, + 26,0,0,0,114,52,0,0,0,90,8,112,97,116,104,95, + 116,109,112,90,2,102,100,218,4,102,105,108,101,114,3,0, + 0,0,114,3,0,0,0,114,6,0,0,0,218,13,95,119, + 114,105,116,101,95,97,116,111,109,105,99,120,0,0,0,115, + 30,0,0,0,0,5,16,1,6,1,16,0,6,255,4,2, + 2,3,14,1,20,1,16,1,14,1,2,1,14,1,14,1, + 6,1,114,69,0,0,0,105,73,13,0,0,114,28,0,0, + 0,114,16,0,0,0,115,2,0,0,0,13,10,90,11,95, + 95,112,121,99,97,99,104,101,95,95,122,4,111,112,116,45, + 122,3,46,112,121,122,4,46,112,121,99,78,41,1,218,12, + 111,112,116,105,109,105,122,97,116,105,111,110,99,2,0,0, + 0,1,0,0,0,12,0,0,0,5,0,0,0,67,0,0, + 0,115,88,1,0,0,124,1,100,1,107,9,114,52,116,0, + 160,1,100,2,116,2,161,2,1,0,124,2,100,1,107,9, + 114,40,100,3,125,3,116,3,124,3,131,1,130,1,124,1, + 114,48,100,4,110,2,100,5,125,2,116,4,160,5,124,0, + 161,1,125,0,116,6,124,0,131,1,92,2,125,4,125,5, + 124,5,160,7,100,6,161,1,92,3,125,6,125,7,125,8, + 116,8,106,9,106,10,125,9,124,9,100,1,107,8,114,114, + 116,11,100,7,131,1,130,1,100,4,160,12,124,6,114,126, + 124,6,110,2,124,8,124,7,124,9,103,3,161,1,125,10, + 124,2,100,1,107,8,114,172,116,8,106,13,106,14,100,8, + 107,2,114,164,100,4,125,2,110,8,116,8,106,13,106,14, + 125,2,116,15,124,2,131,1,125,2,124,2,100,4,107,3, + 114,224,124,2,160,16,161,0,115,210,116,17,100,9,160,18, + 124,2,161,1,131,1,130,1,100,10,160,18,124,10,116,19, + 124,2,161,3,125,10,124,10,116,20,100,8,25,0,23,0, + 125,11,116,8,106,21,100,1,107,9,144,1,114,76,116,22, + 124,4,131,1,144,1,115,16,116,23,116,4,160,24,161,0, + 124,4,131,2,125,4,124,4,100,5,25,0,100,11,107,2, + 144,1,114,56,124,4,100,8,25,0,116,25,107,7,144,1, + 114,56,124,4,100,12,100,1,133,2,25,0,125,4,116,23, + 116,8,106,21,124,4,160,26,116,25,161,1,124,11,131,3, + 83,0,116,23,124,4,116,27,124,11,131,3,83,0,41,13, + 97,254,2,0,0,71,105,118,101,110,32,116,104,101,32,112, + 97,116,104,32,116,111,32,97,32,46,112,121,32,102,105,108, + 101,44,32,114,101,116,117,114,110,32,116,104,101,32,112,97, + 116,104,32,116,111,32,105,116,115,32,46,112,121,99,32,102, + 105,108,101,46,10,10,32,32,32,32,84,104,101,32,46,112, + 121,32,102,105,108,101,32,100,111,101,115,32,110,111,116,32, + 110,101,101,100,32,116,111,32,101,120,105,115,116,59,32,116, + 104,105,115,32,115,105,109,112,108,121,32,114,101,116,117,114, + 110,115,32,116,104,101,32,112,97,116,104,32,116,111,32,116, + 104,101,10,32,32,32,32,46,112,121,99,32,102,105,108,101, + 32,99,97,108,99,117,108,97,116,101,100,32,97,115,32,105, + 102,32,116,104,101,32,46,112,121,32,102,105,108,101,32,119, + 101,114,101,32,105,109,112,111,114,116,101,100,46,10,10,32, + 32,32,32,84,104,101,32,39,111,112,116,105,109,105,122,97, + 116,105,111,110,39,32,112,97,114,97,109,101,116,101,114,32, + 99,111,110,116,114,111,108,115,32,116,104,101,32,112,114,101, + 115,117,109,101,100,32,111,112,116,105,109,105,122,97,116,105, + 111,110,32,108,101,118,101,108,32,111,102,10,32,32,32,32, + 116,104,101,32,98,121,116,101,99,111,100,101,32,102,105,108, + 101,46,32,73,102,32,39,111,112,116,105,109,105,122,97,116, + 105,111,110,39,32,105,115,32,110,111,116,32,78,111,110,101, + 44,32,116,104,101,32,115,116,114,105,110,103,32,114,101,112, + 114,101,115,101,110,116,97,116,105,111,110,10,32,32,32,32, + 111,102,32,116,104,101,32,97,114,103,117,109,101,110,116,32, + 105,115,32,116,97,107,101,110,32,97,110,100,32,118,101,114, + 105,102,105,101,100,32,116,111,32,98,101,32,97,108,112,104, + 97,110,117,109,101,114,105,99,32,40,101,108,115,101,32,86, + 97,108,117,101,69,114,114,111,114,10,32,32,32,32,105,115, + 32,114,97,105,115,101,100,41,46,10,10,32,32,32,32,84, + 104,101,32,100,101,98,117,103,95,111,118,101,114,114,105,100, + 101,32,112,97,114,97,109,101,116,101,114,32,105,115,32,100, + 101,112,114,101,99,97,116,101,100,46,32,73,102,32,100,101, + 98,117,103,95,111,118,101,114,114,105,100,101,32,105,115,32, + 110,111,116,32,78,111,110,101,44,10,32,32,32,32,97,32, + 84,114,117,101,32,118,97,108,117,101,32,105,115,32,116,104, + 101,32,115,97,109,101,32,97,115,32,115,101,116,116,105,110, + 103,32,39,111,112,116,105,109,105,122,97,116,105,111,110,39, + 32,116,111,32,116,104,101,32,101,109,112,116,121,32,115,116, + 114,105,110,103,10,32,32,32,32,119,104,105,108,101,32,97, + 32,70,97,108,115,101,32,118,97,108,117,101,32,105,115,32, + 101,113,117,105,118,97,108,101,110,116,32,116,111,32,115,101, + 116,116,105,110,103,32,39,111,112,116,105,109,105,122,97,116, + 105,111,110,39,32,116,111,32,39,49,39,46,10,10,32,32, + 32,32,73,102,32,115,121,115,46,105,109,112,108,101,109,101, + 110,116,97,116,105,111,110,46,99,97,99,104,101,95,116,97, + 103,32,105,115,32,78,111,110,101,32,116,104,101,110,32,78, + 111,116,73,109,112,108,101,109,101,110,116,101,100,69,114,114, + 111,114,32,105,115,32,114,97,105,115,101,100,46,10,10,32, + 32,32,32,78,122,70,116,104,101,32,100,101,98,117,103,95, + 111,118,101,114,114,105,100,101,32,112,97,114,97,109,101,116, + 101,114,32,105,115,32,100,101,112,114,101,99,97,116,101,100, + 59,32,117,115,101,32,39,111,112,116,105,109,105,122,97,116, + 105,111,110,39,32,105,110,115,116,101,97,100,122,50,100,101, + 98,117,103,95,111,118,101,114,114,105,100,101,32,111,114,32, + 111,112,116,105,109,105,122,97,116,105,111,110,32,109,117,115, + 116,32,98,101,32,115,101,116,32,116,111,32,78,111,110,101, + 114,40,0,0,0,114,39,0,0,0,218,1,46,250,36,115, + 121,115,46,105,109,112,108,101,109,101,110,116,97,116,105,111, + 110,46,99,97,99,104,101,95,116,97,103,32,105,115,32,78, + 111,110,101,233,0,0,0,0,122,24,123,33,114,125,32,105, + 115,32,110,111,116,32,97,108,112,104,97,110,117,109,101,114, + 105,99,122,7,123,125,46,123,125,123,125,250,1,58,114,28, + 0,0,0,41,28,218,9,95,119,97,114,110,105,110,103,115, + 218,4,119,97,114,110,218,18,68,101,112,114,101,99,97,116, + 105,111,110,87,97,114,110,105,110,103,218,9,84,121,112,101, + 69,114,114,111,114,114,2,0,0,0,218,6,102,115,112,97, + 116,104,114,47,0,0,0,114,41,0,0,0,114,8,0,0, + 0,218,14,105,109,112,108,101,109,101,110,116,97,116,105,111, + 110,218,9,99,97,99,104,101,95,116,97,103,218,19,78,111, + 116,73,109,112,108,101,109,101,110,116,101,100,69,114,114,111, + 114,114,36,0,0,0,218,5,102,108,97,103,115,218,8,111, + 112,116,105,109,105,122,101,218,3,115,116,114,218,7,105,115, + 97,108,110,117,109,218,10,86,97,108,117,101,69,114,114,111, + 114,114,62,0,0,0,218,4,95,79,80,84,218,17,66,89, + 84,69,67,79,68,69,95,83,85,70,70,73,88,69,83,218, + 14,112,121,99,97,99,104,101,95,112,114,101,102,105,120,114, + 59,0,0,0,114,38,0,0,0,114,55,0,0,0,114,31, + 0,0,0,218,6,108,115,116,114,105,112,218,8,95,80,89, + 67,65,67,72,69,41,12,114,44,0,0,0,90,14,100,101, + 98,117,103,95,111,118,101,114,114,105,100,101,114,70,0,0, + 0,218,7,109,101,115,115,97,103,101,218,4,104,101,97,100, + 114,46,0,0,0,90,4,98,97,115,101,218,3,115,101,112, + 218,4,114,101,115,116,90,3,116,97,103,90,15,97,108,109, + 111,115,116,95,102,105,108,101,110,97,109,101,218,8,102,105, + 108,101,110,97,109,101,114,3,0,0,0,114,3,0,0,0, + 114,6,0,0,0,218,17,99,97,99,104,101,95,102,114,111, + 109,95,115,111,117,114,99,101,32,1,0,0,115,72,0,0, + 0,0,18,8,1,6,1,2,255,4,2,8,1,4,1,8, + 1,12,1,10,1,12,1,16,1,8,1,8,1,8,1,24, + 1,8,1,12,1,6,2,8,1,8,1,8,1,8,1,14, + 1,14,1,12,1,12,9,10,1,14,5,28,1,12,4,2, + 1,4,1,8,1,2,253,4,5,114,98,0,0,0,99,1, + 0,0,0,0,0,0,0,10,0,0,0,5,0,0,0,67, + 0,0,0,115,46,1,0,0,116,0,106,1,106,2,100,1, + 107,8,114,20,116,3,100,2,131,1,130,1,116,4,160,5, + 124,0,161,1,125,0,116,6,124,0,131,1,92,2,125,1, + 125,2,100,3,125,3,116,0,106,7,100,1,107,9,114,102, + 116,0,106,7,160,8,116,9,161,1,125,4,124,1,160,10, + 124,4,116,11,23,0,161,1,114,102,124,1,116,12,124,4, + 131,1,100,1,133,2,25,0,125,1,100,4,125,3,124,3, + 115,144,116,6,124,1,131,1,92,2,125,1,125,5,124,5, + 116,13,107,3,114,144,116,14,116,13,155,0,100,5,124,0, + 155,2,157,3,131,1,130,1,124,2,160,15,100,6,161,1, + 125,6,124,6,100,7,107,7,114,178,116,14,100,8,124,2, + 155,2,157,2,131,1,130,1,110,92,124,6,100,9,107,2, + 144,1,114,14,124,2,160,16,100,6,100,10,161,2,100,11, + 25,0,125,7,124,7,160,10,116,17,161,1,115,228,116,14, + 100,12,116,17,155,2,157,2,131,1,130,1,124,7,116,12, + 116,17,131,1,100,1,133,2,25,0,125,8,124,8,160,18, + 161,0,144,1,115,14,116,14,100,13,124,7,155,2,100,14, + 157,3,131,1,130,1,124,2,160,19,100,6,161,1,100,15, + 25,0,125,9,116,20,124,1,124,9,116,21,100,15,25,0, + 23,0,131,2,83,0,41,16,97,110,1,0,0,71,105,118, + 101,110,32,116,104,101,32,112,97,116,104,32,116,111,32,97, + 32,46,112,121,99,46,32,102,105,108,101,44,32,114,101,116, + 117,114,110,32,116,104,101,32,112,97,116,104,32,116,111,32, + 105,116,115,32,46,112,121,32,102,105,108,101,46,10,10,32, + 32,32,32,84,104,101,32,46,112,121,99,32,102,105,108,101, + 32,100,111,101,115,32,110,111,116,32,110,101,101,100,32,116, + 111,32,101,120,105,115,116,59,32,116,104,105,115,32,115,105, + 109,112,108,121,32,114,101,116,117,114,110,115,32,116,104,101, + 32,112,97,116,104,32,116,111,10,32,32,32,32,116,104,101, + 32,46,112,121,32,102,105,108,101,32,99,97,108,99,117,108, + 97,116,101,100,32,116,111,32,99,111,114,114,101,115,112,111, + 110,100,32,116,111,32,116,104,101,32,46,112,121,99,32,102, + 105,108,101,46,32,32,73,102,32,112,97,116,104,32,100,111, + 101,115,10,32,32,32,32,110,111,116,32,99,111,110,102,111, + 114,109,32,116,111,32,80,69,80,32,51,49,52,55,47,52, + 56,56,32,102,111,114,109,97,116,44,32,86,97,108,117,101, + 69,114,114,111,114,32,119,105,108,108,32,98,101,32,114,97, + 105,115,101,100,46,32,73,102,10,32,32,32,32,115,121,115, + 46,105,109,112,108,101,109,101,110,116,97,116,105,111,110,46, + 99,97,99,104,101,95,116,97,103,32,105,115,32,78,111,110, + 101,32,116,104,101,110,32,78,111,116,73,109,112,108,101,109, + 101,110,116,101,100,69,114,114,111,114,32,105,115,32,114,97, + 105,115,101,100,46,10,10,32,32,32,32,78,114,72,0,0, + 0,70,84,122,31,32,110,111,116,32,98,111,116,116,111,109, + 45,108,101,118,101,108,32,100,105,114,101,99,116,111,114,121, + 32,105,110,32,114,71,0,0,0,62,2,0,0,0,114,28, + 0,0,0,114,57,0,0,0,122,29,101,120,112,101,99,116, + 101,100,32,111,110,108,121,32,50,32,111,114,32,51,32,100, + 111,116,115,32,105,110,32,114,57,0,0,0,114,28,0,0, + 0,233,254,255,255,255,122,53,111,112,116,105,109,105,122,97, + 116,105,111,110,32,112,111,114,116,105,111,110,32,111,102,32, + 102,105,108,101,110,97,109,101,32,100,111,101,115,32,110,111, + 116,32,115,116,97,114,116,32,119,105,116,104,32,122,19,111, + 112,116,105,109,105,122,97,116,105,111,110,32,108,101,118,101, + 108,32,122,29,32,105,115,32,110,111,116,32,97,110,32,97, + 108,112,104,97,110,117,109,101,114,105,99,32,118,97,108,117, + 101,114,73,0,0,0,41,22,114,8,0,0,0,114,80,0, + 0,0,114,81,0,0,0,114,82,0,0,0,114,2,0,0, + 0,114,79,0,0,0,114,47,0,0,0,114,90,0,0,0, + 114,30,0,0,0,114,31,0,0,0,114,10,0,0,0,114, + 35,0,0,0,114,22,0,0,0,114,92,0,0,0,114,87, + 0,0,0,218,5,99,111,117,110,116,114,43,0,0,0,114, + 88,0,0,0,114,86,0,0,0,218,9,112,97,114,116,105, + 116,105,111,110,114,38,0,0,0,218,15,83,79,85,82,67, + 69,95,83,85,70,70,73,88,69,83,41,10,114,44,0,0, + 0,114,94,0,0,0,90,16,112,121,99,97,99,104,101,95, + 102,105,108,101,110,97,109,101,90,23,102,111,117,110,100,95, + 105,110,95,112,121,99,97,99,104,101,95,112,114,101,102,105, + 120,90,13,115,116,114,105,112,112,101,100,95,112,97,116,104, + 90,7,112,121,99,97,99,104,101,90,9,100,111,116,95,99, + 111,117,110,116,114,70,0,0,0,90,9,111,112,116,95,108, + 101,118,101,108,90,13,98,97,115,101,95,102,105,108,101,110, + 97,109,101,114,3,0,0,0,114,3,0,0,0,114,6,0, + 0,0,218,17,115,111,117,114,99,101,95,102,114,111,109,95, + 99,97,99,104,101,103,1,0,0,115,52,0,0,0,0,9, + 12,1,8,1,10,1,12,1,4,1,10,1,12,1,14,1, + 16,1,4,1,4,1,12,1,8,1,18,2,10,1,8,1, + 16,1,10,1,16,1,10,1,14,2,16,1,10,1,16,2, + 14,1,114,103,0,0,0,99,1,0,0,0,0,0,0,0, + 5,0,0,0,9,0,0,0,67,0,0,0,115,126,0,0, + 0,116,0,124,0,131,1,100,1,107,2,114,16,100,2,83, + 0,124,0,160,1,100,3,161,1,92,3,125,1,125,2,125, + 3,124,1,114,56,124,3,160,2,161,0,100,4,100,5,133, + 2,25,0,100,6,107,3,114,60,124,0,83,0,122,12,116, + 3,124,0,131,1,125,4,87,0,110,36,4,0,116,4,116, + 5,102,2,107,10,114,108,1,0,1,0,1,0,124,0,100, + 2,100,5,133,2,25,0,125,4,89,0,110,2,88,0,116, + 6,124,4,131,1,114,122,124,4,83,0,124,0,83,0,41, + 7,122,188,67,111,110,118,101,114,116,32,97,32,98,121,116, + 101,99,111,100,101,32,102,105,108,101,32,112,97,116,104,32, + 116,111,32,97,32,115,111,117,114,99,101,32,112,97,116,104, + 32,40,105,102,32,112,111,115,115,105,98,108,101,41,46,10, + 10,32,32,32,32,84,104,105,115,32,102,117,110,99,116,105, + 111,110,32,101,120,105,115,116,115,32,112,117,114,101,108,121, + 32,102,111,114,32,98,97,99,107,119,97,114,100,115,45,99, + 111,109,112,97,116,105,98,105,108,105,116,121,32,102,111,114, + 10,32,32,32,32,80,121,73,109,112,111,114,116,95,69,120, + 101,99,67,111,100,101,77,111,100,117,108,101,87,105,116,104, + 70,105,108,101,110,97,109,101,115,40,41,32,105,110,32,116, + 104,101,32,67,32,65,80,73,46,10,10,32,32,32,32,114, + 73,0,0,0,78,114,71,0,0,0,233,253,255,255,255,233, + 255,255,255,255,90,2,112,121,41,7,114,22,0,0,0,114, + 41,0,0,0,218,5,108,111,119,101,114,114,103,0,0,0, + 114,82,0,0,0,114,87,0,0,0,114,54,0,0,0,41, + 5,218,13,98,121,116,101,99,111,100,101,95,112,97,116,104, + 114,96,0,0,0,114,45,0,0,0,90,9,101,120,116,101, + 110,115,105,111,110,218,11,115,111,117,114,99,101,95,112,97, + 116,104,114,3,0,0,0,114,3,0,0,0,114,6,0,0, + 0,218,15,95,103,101,116,95,115,111,117,114,99,101,102,105, + 108,101,143,1,0,0,115,20,0,0,0,0,7,12,1,4, + 1,16,1,24,1,4,1,2,1,12,1,18,1,18,1,114, + 109,0,0,0,99,1,0,0,0,0,0,0,0,1,0,0, + 0,8,0,0,0,67,0,0,0,115,74,0,0,0,124,0, + 160,0,116,1,116,2,131,1,161,1,114,48,122,10,116,3, + 124,0,131,1,87,0,83,0,4,0,116,4,107,10,114,44, + 1,0,1,0,1,0,89,0,113,70,88,0,110,22,124,0, + 160,0,116,1,116,5,131,1,161,1,114,66,124,0,83,0, + 100,0,83,0,100,0,83,0,169,1,78,41,6,218,8,101, + 110,100,115,119,105,116,104,218,5,116,117,112,108,101,114,102, + 0,0,0,114,98,0,0,0,114,82,0,0,0,114,89,0, + 0,0,41,1,114,97,0,0,0,114,3,0,0,0,114,3, + 0,0,0,114,6,0,0,0,218,11,95,103,101,116,95,99, + 97,99,104,101,100,162,1,0,0,115,16,0,0,0,0,1, + 14,1,2,1,10,1,14,1,8,1,14,1,4,2,114,113, + 0,0,0,99,1,0,0,0,0,0,0,0,2,0,0,0, + 8,0,0,0,67,0,0,0,115,52,0,0,0,122,14,116, + 0,124,0,131,1,106,1,125,1,87,0,110,24,4,0,116, + 2,107,10,114,38,1,0,1,0,1,0,100,1,125,1,89, + 0,110,2,88,0,124,1,100,2,79,0,125,1,124,1,83, + 0,41,3,122,51,67,97,108,99,117,108,97,116,101,32,116, + 104,101,32,109,111,100,101,32,112,101,114,109,105,115,115,105, + 111,110,115,32,102,111,114,32,97,32,98,121,116,101,99,111, + 100,101,32,102,105,108,101,46,114,60,0,0,0,233,128,0, + 0,0,41,3,114,49,0,0,0,114,51,0,0,0,114,50, + 0,0,0,41,2,114,44,0,0,0,114,52,0,0,0,114, + 3,0,0,0,114,3,0,0,0,114,6,0,0,0,218,10, + 95,99,97,108,99,95,109,111,100,101,174,1,0,0,115,12, + 0,0,0,0,2,2,1,14,1,14,1,10,3,8,1,114, + 115,0,0,0,99,1,0,0,0,0,0,0,0,3,0,0, + 0,8,0,0,0,3,0,0,0,115,68,0,0,0,100,6, + 135,0,102,1,100,2,100,3,132,9,125,1,122,10,116,0, + 106,1,125,2,87,0,110,28,4,0,116,2,107,10,114,52, + 1,0,1,0,1,0,100,4,100,5,132,0,125,2,89,0, + 110,2,88,0,124,2,124,1,136,0,131,2,1,0,124,1, + 83,0,41,7,122,252,68,101,99,111,114,97,116,111,114,32, + 116,111,32,118,101,114,105,102,121,32,116,104,97,116,32,116, + 104,101,32,109,111,100,117,108,101,32,98,101,105,110,103,32, + 114,101,113,117,101,115,116,101,100,32,109,97,116,99,104,101, + 115,32,116,104,101,32,111,110,101,32,116,104,101,10,32,32, + 32,32,108,111,97,100,101,114,32,99,97,110,32,104,97,110, + 100,108,101,46,10,10,32,32,32,32,84,104,101,32,102,105, + 114,115,116,32,97,114,103,117,109,101,110,116,32,40,115,101, + 108,102,41,32,109,117,115,116,32,100,101,102,105,110,101,32, + 95,110,97,109,101,32,119,104,105,99,104,32,116,104,101,32, + 115,101,99,111,110,100,32,97,114,103,117,109,101,110,116,32, + 105,115,10,32,32,32,32,99,111,109,112,97,114,101,100,32, + 97,103,97,105,110,115,116,46,32,73,102,32,116,104,101,32, + 99,111,109,112,97,114,105,115,111,110,32,102,97,105,108,115, + 32,116,104,101,110,32,73,109,112,111,114,116,69,114,114,111, + 114,32,105,115,32,114,97,105,115,101,100,46,10,10,32,32, + 32,32,78,99,2,0,0,0,0,0,0,0,4,0,0,0, + 4,0,0,0,31,0,0,0,115,66,0,0,0,124,1,100, + 0,107,8,114,16,124,0,106,0,125,1,110,32,124,0,106, + 0,124,1,107,3,114,48,116,1,100,1,124,0,106,0,124, + 1,102,2,22,0,124,1,100,2,141,2,130,1,136,0,124, + 0,124,1,102,2,124,2,158,2,124,3,142,1,83,0,41, + 3,78,122,30,108,111,97,100,101,114,32,102,111,114,32,37, + 115,32,99,97,110,110,111,116,32,104,97,110,100,108,101,32, + 37,115,169,1,218,4,110,97,109,101,41,2,114,117,0,0, + 0,218,11,73,109,112,111,114,116,69,114,114,111,114,41,4, + 218,4,115,101,108,102,114,117,0,0,0,218,4,97,114,103, + 115,90,6,107,119,97,114,103,115,169,1,218,6,109,101,116, + 104,111,100,114,3,0,0,0,114,6,0,0,0,218,19,95, + 99,104,101,99,107,95,110,97,109,101,95,119,114,97,112,112, + 101,114,194,1,0,0,115,18,0,0,0,0,1,8,1,8, + 1,10,1,4,1,8,255,2,1,2,255,6,2,122,40,95, + 99,104,101,99,107,95,110,97,109,101,46,60,108,111,99,97, + 108,115,62,46,95,99,104,101,99,107,95,110,97,109,101,95, + 119,114,97,112,112,101,114,99,2,0,0,0,0,0,0,0, + 3,0,0,0,7,0,0,0,83,0,0,0,115,56,0,0, + 0,100,1,68,0,93,32,125,2,116,0,124,1,124,2,131, + 2,114,4,116,1,124,0,124,2,116,2,124,1,124,2,131, + 2,131,3,1,0,113,4,124,0,106,3,160,4,124,1,106, + 3,161,1,1,0,100,0,83,0,41,2,78,41,4,218,10, + 95,95,109,111,100,117,108,101,95,95,218,8,95,95,110,97, + 109,101,95,95,218,12,95,95,113,117,97,108,110,97,109,101, + 95,95,218,7,95,95,100,111,99,95,95,41,5,218,7,104, + 97,115,97,116,116,114,218,7,115,101,116,97,116,116,114,218, + 7,103,101,116,97,116,116,114,218,8,95,95,100,105,99,116, + 95,95,218,6,117,112,100,97,116,101,41,3,90,3,110,101, + 119,90,3,111,108,100,114,67,0,0,0,114,3,0,0,0, + 114,3,0,0,0,114,6,0,0,0,218,5,95,119,114,97, + 112,205,1,0,0,115,8,0,0,0,0,1,8,1,10,1, + 20,1,122,26,95,99,104,101,99,107,95,110,97,109,101,46, + 60,108,111,99,97,108,115,62,46,95,119,114,97,112,41,1, + 78,41,3,218,10,95,98,111,111,116,115,116,114,97,112,114, + 133,0,0,0,218,9,78,97,109,101,69,114,114,111,114,41, + 3,114,122,0,0,0,114,123,0,0,0,114,133,0,0,0, + 114,3,0,0,0,114,121,0,0,0,114,6,0,0,0,218, 11,95,99,104,101,99,107,95,110,97,109,101,186,1,0,0, 115,14,0,0,0,0,8,14,7,2,1,10,1,14,2,14, - 5,10,1,114,124,0,0,0,99,2,0,0,0,0,0,0, + 5,10,1,114,136,0,0,0,99,2,0,0,0,0,0,0, 0,5,0,0,0,6,0,0,0,67,0,0,0,115,60,0, 0,0,124,0,160,0,124,1,161,1,92,2,125,2,125,3, 124,2,100,1,107,8,114,56,116,1,124,3,131,1,114,56, @@ -622,17 +615,17 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 115,112,101,99,40,41,46,10,10,32,32,32,32,78,122,44, 78,111,116,32,105,109,112,111,114,116,105,110,103,32,100,105, 114,101,99,116,111,114,121,32,123,125,58,32,109,105,115,115, - 105,110,103,32,95,95,105,110,105,116,95,95,114,64,0,0, + 105,110,103,32,95,95,105,110,105,116,95,95,114,73,0,0, 0,41,6,218,11,102,105,110,100,95,108,111,97,100,101,114, - 114,18,0,0,0,114,66,0,0,0,114,67,0,0,0,114, - 54,0,0,0,218,13,73,109,112,111,114,116,87,97,114,110, - 105,110,103,41,5,114,108,0,0,0,218,8,102,117,108,108, + 114,22,0,0,0,114,75,0,0,0,114,76,0,0,0,114, + 62,0,0,0,218,13,73,109,112,111,114,116,87,97,114,110, + 105,110,103,41,5,114,119,0,0,0,218,8,102,117,108,108, 110,97,109,101,218,6,108,111,97,100,101,114,218,8,112,111, - 114,116,105,111,110,115,218,3,109,115,103,114,2,0,0,0, - 114,2,0,0,0,114,4,0,0,0,218,17,95,102,105,110, + 114,116,105,111,110,115,218,3,109,115,103,114,3,0,0,0, + 114,3,0,0,0,114,6,0,0,0,218,17,95,102,105,110, 100,95,109,111,100,117,108,101,95,115,104,105,109,214,1,0, 0,115,10,0,0,0,0,10,14,1,16,1,4,1,22,1, - 114,131,0,0,0,99,3,0,0,0,0,0,0,0,6,0, + 114,143,0,0,0,99,3,0,0,0,0,0,0,0,6,0, 0,0,4,0,0,0,67,0,0,0,115,158,0,0,0,124, 0,100,1,100,2,133,2,25,0,125,3,124,3,116,0,107, 3,114,60,100,3,124,1,155,2,100,4,124,3,155,2,157, @@ -681,25 +674,25 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 32,105,115,32,114,97,105,115,101,100,32,119,104,101,110,32, 116,104,101,32,100,97,116,97,32,105,115,32,102,111,117,110, 100,32,116,111,32,98,101,32,116,114,117,110,99,97,116,101, - 100,46,10,10,32,32,32,32,78,114,12,0,0,0,122,20, + 100,46,10,10,32,32,32,32,78,114,15,0,0,0,122,20, 98,97,100,32,109,97,103,105,99,32,110,117,109,98,101,114, - 32,105,110,32,122,2,58,32,122,2,123,125,233,16,0,0, + 32,105,110,32,122,2,58,32,250,2,123,125,233,16,0,0, 0,122,40,114,101,97,99,104,101,100,32,69,79,70,32,119, 104,105,108,101,32,114,101,97,100,105,110,103,32,112,121,99, 32,104,101,97,100,101,114,32,111,102,32,233,8,0,0,0, 233,252,255,255,255,122,14,105,110,118,97,108,105,100,32,102, 108,97,103,115,32,122,4,32,105,110,32,41,7,218,12,77, - 65,71,73,67,95,78,85,77,66,69,82,114,122,0,0,0, + 65,71,73,67,95,78,85,77,66,69,82,114,134,0,0,0, 218,16,95,118,101,114,98,111,115,101,95,109,101,115,115,97, - 103,101,114,107,0,0,0,114,18,0,0,0,218,8,69,79, - 70,69,114,114,111,114,114,22,0,0,0,41,6,114,21,0, - 0,0,114,106,0,0,0,218,11,101,120,99,95,100,101,116, - 97,105,108,115,90,5,109,97,103,105,99,114,84,0,0,0, - 114,74,0,0,0,114,2,0,0,0,114,2,0,0,0,114, - 4,0,0,0,218,13,95,99,108,97,115,115,105,102,121,95, + 103,101,114,118,0,0,0,114,22,0,0,0,218,8,69,79, + 70,69,114,114,111,114,114,27,0,0,0,41,6,114,26,0, + 0,0,114,117,0,0,0,218,11,101,120,99,95,100,101,116, + 97,105,108,115,90,5,109,97,103,105,99,114,93,0,0,0, + 114,83,0,0,0,114,3,0,0,0,114,3,0,0,0,114, + 6,0,0,0,218,13,95,99,108,97,115,115,105,102,121,95, 112,121,99,231,1,0,0,115,28,0,0,0,0,16,12,1, 8,1,16,1,12,1,12,1,12,1,10,1,12,1,8,1, - 16,2,8,1,16,1,12,1,114,139,0,0,0,99,5,0, + 16,2,8,1,16,1,12,1,114,152,0,0,0,99,5,0, 0,0,0,0,0,0,6,0,0,0,4,0,0,0,67,0, 0,0,115,112,0,0,0,116,0,124,0,100,1,100,2,133, 2,25,0,131,1,124,1,100,3,64,0,107,3,114,58,100, @@ -741,1095 +734,1082 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 73,109,112,111,114,116,69,114,114,111,114,32,105,115,32,114, 97,105,115,101,100,32,105,102,32,116,104,101,32,98,121,116, 101,99,111,100,101,32,105,115,32,115,116,97,108,101,46,10, - 10,32,32,32,32,114,133,0,0,0,233,12,0,0,0,108, - 3,0,0,0,255,127,255,127,3,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,2,123,125,78,114,132,0,0,0,41,4,114,22, - 0,0,0,114,122,0,0,0,114,136,0,0,0,114,107,0, - 0,0,41,6,114,21,0,0,0,218,12,115,111,117,114,99, - 101,95,109,116,105,109,101,218,11,115,111,117,114,99,101,95, - 115,105,122,101,114,106,0,0,0,114,138,0,0,0,114,84, - 0,0,0,114,2,0,0,0,114,2,0,0,0,114,4,0, - 0,0,218,23,95,118,97,108,105,100,97,116,101,95,116,105, - 109,101,115,116,97,109,112,95,112,121,99,8,2,0,0,115, - 16,0,0,0,0,19,24,1,10,1,12,1,12,1,8,1, - 22,255,2,2,114,143,0,0,0,99,4,0,0,0,0,0, - 0,0,4,0,0,0,3,0,0,0,67,0,0,0,115,38, - 0,0,0,124,0,100,1,100,2,133,2,25,0,124,1,107, - 3,114,34,116,0,100,3,124,2,155,2,157,2,102,1,124, - 3,142,1,130,1,100,4,83,0,41,5,97,243,1,0,0, - 86,97,108,105,100,97,116,101,32,97,32,104,97,115,104,45, - 98,97,115,101,100,32,112,121,99,32,98,121,32,99,104,101, - 99,107,105,110,103,32,116,104,101,32,114,101,97,108,32,115, - 111,117,114,99,101,32,104,97,115,104,32,97,103,97,105,110, - 115,116,32,116,104,101,32,111,110,101,32,105,110,10,32,32, - 32,32,116,104,101,32,112,121,99,32,104,101,97,100,101,114, - 46,10,10,32,32,32,32,42,100,97,116,97,42,32,105,115, - 32,116,104,101,32,99,111,110,116,101,110,116,115,32,111,102, - 32,116,104,101,32,112,121,99,32,102,105,108,101,46,32,40, - 79,110,108,121,32,116,104,101,32,102,105,114,115,116,32,49, - 54,32,98,121,116,101,115,32,97,114,101,10,32,32,32,32, - 114,101,113,117,105,114,101,100,46,41,10,10,32,32,32,32, - 42,115,111,117,114,99,101,95,104,97,115,104,42,32,105,115, - 32,116,104,101,32,105,109,112,111,114,116,108,105,98,46,117, - 116,105,108,46,115,111,117,114,99,101,95,104,97,115,104,40, - 41,32,111,102,32,116,104,101,32,115,111,117,114,99,101,32, - 102,105,108,101,46,10,10,32,32,32,32,42,110,97,109,101, - 42,32,105,115,32,116,104,101,32,110,97,109,101,32,111,102, - 32,116,104,101,32,109,111,100,117,108,101,32,98,101,105,110, - 103,32,105,109,112,111,114,116,101,100,46,32,73,116,32,105, - 115,32,117,115,101,100,32,102,111,114,32,108,111,103,103,105, - 110,103,46,10,10,32,32,32,32,42,101,120,99,95,100,101, - 116,97,105,108,115,42,32,105,115,32,97,32,100,105,99,116, - 105,111,110,97,114,121,32,112,97,115,115,101,100,32,116,111, - 32,73,109,112,111,114,116,69,114,114,111,114,32,105,102,32, - 105,116,32,114,97,105,115,101,100,32,102,111,114,10,32,32, - 32,32,105,109,112,114,111,118,101,100,32,100,101,98,117,103, - 103,105,110,103,46,10,10,32,32,32,32,65,110,32,73,109, - 112,111,114,116,69,114,114,111,114,32,105,115,32,114,97,105, - 115,101,100,32,105,102,32,116,104,101,32,98,121,116,101,99, - 111,100,101,32,105,115,32,115,116,97,108,101,46,10,10,32, - 32,32,32,114,133,0,0,0,114,132,0,0,0,122,46,104, - 97,115,104,32,105,110,32,98,121,116,101,99,111,100,101,32, - 100,111,101,115,110,39,116,32,109,97,116,99,104,32,104,97, - 115,104,32,111,102,32,115,111,117,114,99,101,32,78,41,1, - 114,107,0,0,0,41,4,114,21,0,0,0,218,11,115,111, - 117,114,99,101,95,104,97,115,104,114,106,0,0,0,114,138, - 0,0,0,114,2,0,0,0,114,2,0,0,0,114,4,0, - 0,0,218,18,95,118,97,108,105,100,97,116,101,95,104,97, - 115,104,95,112,121,99,36,2,0,0,115,12,0,0,0,0, - 17,16,1,2,1,8,255,2,2,2,254,114,145,0,0,0, - 99,4,0,0,0,0,0,0,0,5,0,0,0,5,0,0, - 0,67,0,0,0,115,82,0,0,0,116,0,160,1,124,0, - 161,1,125,4,116,2,124,4,116,3,131,2,114,58,116,4, - 160,5,100,1,124,2,161,2,1,0,124,3,100,2,107,9, - 114,52,116,6,160,7,124,4,124,3,161,2,1,0,124,4, - 83,0,110,20,116,8,100,3,160,9,124,2,161,1,124,1, - 124,2,100,4,141,3,130,1,100,2,83,0,41,5,122,35, - 67,111,109,112,105,108,101,32,98,121,116,101,99,111,100,101, - 32,97,115,32,102,111,117,110,100,32,105,110,32,97,32,112, - 121,99,46,122,21,99,111,100,101,32,111,98,106,101,99,116, - 32,102,114,111,109,32,123,33,114,125,78,122,23,78,111,110, - 45,99,111,100,101,32,111,98,106,101,99,116,32,105,110,32, - 123,33,114,125,41,2,114,106,0,0,0,114,39,0,0,0, - 41,10,218,7,109,97,114,115,104,97,108,90,5,108,111,97, - 100,115,218,10,105,115,105,110,115,116,97,110,99,101,218,10, - 95,99,111,100,101,95,116,121,112,101,114,122,0,0,0,114, - 136,0,0,0,218,4,95,105,109,112,90,16,95,102,105,120, - 95,99,111,95,102,105,108,101,110,97,109,101,114,107,0,0, - 0,114,54,0,0,0,41,5,114,21,0,0,0,114,106,0, - 0,0,114,98,0,0,0,114,99,0,0,0,218,4,99,111, - 100,101,114,2,0,0,0,114,2,0,0,0,114,4,0,0, - 0,218,17,95,99,111,109,112,105,108,101,95,98,121,116,101, - 99,111,100,101,60,2,0,0,115,20,0,0,0,0,2,10, - 1,10,1,12,1,8,1,12,1,6,2,10,1,2,0,2, - 255,114,151,0,0,0,114,64,0,0,0,99,3,0,0,0, - 0,0,0,0,4,0,0,0,5,0,0,0,67,0,0,0, - 115,70,0,0,0,116,0,116,1,131,1,125,3,124,3,160, - 2,116,3,100,1,131,1,161,1,1,0,124,3,160,2,116, - 3,124,1,131,1,161,1,1,0,124,3,160,2,116,3,124, - 2,131,1,161,1,1,0,124,3,160,2,116,4,160,5,124, - 0,161,1,161,1,1,0,124,3,83,0,41,2,122,43,80, - 114,111,100,117,99,101,32,116,104,101,32,100,97,116,97,32, - 102,111,114,32,97,32,116,105,109,101,115,116,97,109,112,45, - 98,97,115,101,100,32,112,121,99,46,114,64,0,0,0,41, - 6,218,9,98,121,116,101,97,114,114,97,121,114,135,0,0, - 0,218,6,101,120,116,101,110,100,114,17,0,0,0,114,146, - 0,0,0,218,5,100,117,109,112,115,41,4,114,150,0,0, - 0,218,5,109,116,105,109,101,114,142,0,0,0,114,21,0, - 0,0,114,2,0,0,0,114,2,0,0,0,114,4,0,0, - 0,218,22,95,99,111,100,101,95,116,111,95,116,105,109,101, - 115,116,97,109,112,95,112,121,99,73,2,0,0,115,12,0, - 0,0,0,2,8,1,14,1,14,1,14,1,16,1,114,156, - 0,0,0,84,99,3,0,0,0,0,0,0,0,5,0,0, - 0,5,0,0,0,67,0,0,0,115,80,0,0,0,116,0, - 116,1,131,1,125,3,100,1,124,2,100,1,62,0,66,0, - 125,4,124,3,160,2,116,3,124,4,131,1,161,1,1,0, - 116,4,124,1,131,1,100,2,107,2,115,50,116,5,130,1, - 124,3,160,2,124,1,161,1,1,0,124,3,160,2,116,6, - 160,7,124,0,161,1,161,1,1,0,124,3,83,0,41,3, - 122,38,80,114,111,100,117,99,101,32,116,104,101,32,100,97, - 116,97,32,102,111,114,32,97,32,104,97,115,104,45,98,97, - 115,101,100,32,112,121,99,46,114,34,0,0,0,114,133,0, - 0,0,41,8,114,152,0,0,0,114,135,0,0,0,114,153, - 0,0,0,114,17,0,0,0,114,18,0,0,0,114,19,0, - 0,0,114,146,0,0,0,114,154,0,0,0,41,5,114,150, - 0,0,0,114,144,0,0,0,90,7,99,104,101,99,107,101, - 100,114,21,0,0,0,114,74,0,0,0,114,2,0,0,0, - 114,2,0,0,0,114,4,0,0,0,218,17,95,99,111,100, - 101,95,116,111,95,104,97,115,104,95,112,121,99,83,2,0, - 0,115,14,0,0,0,0,2,8,1,12,1,14,1,16,1, - 10,1,16,1,114,157,0,0,0,99,1,0,0,0,0,0, - 0,0,5,0,0,0,6,0,0,0,67,0,0,0,115,62, - 0,0,0,100,1,100,2,108,0,125,1,116,1,160,2,124, - 0,161,1,106,3,125,2,124,1,160,4,124,2,161,1,125, - 3,116,1,160,5,100,2,100,3,161,2,125,4,124,4,160, - 6,124,0,160,6,124,3,100,1,25,0,161,1,161,1,83, - 0,41,4,122,121,68,101,99,111,100,101,32,98,121,116,101, - 115,32,114,101,112,114,101,115,101,110,116,105,110,103,32,115, - 111,117,114,99,101,32,99,111,100,101,32,97,110,100,32,114, - 101,116,117,114,110,32,116,104,101,32,115,116,114,105,110,103, - 46,10,10,32,32,32,32,85,110,105,118,101,114,115,97,108, - 32,110,101,119,108,105,110,101,32,115,117,112,112,111,114,116, - 32,105,115,32,117,115,101,100,32,105,110,32,116,104,101,32, - 100,101,99,111,100,105,110,103,46,10,32,32,32,32,114,64, - 0,0,0,78,84,41,7,218,8,116,111,107,101,110,105,122, - 101,114,56,0,0,0,90,7,66,121,116,101,115,73,79,90, - 8,114,101,97,100,108,105,110,101,90,15,100,101,116,101,99, - 116,95,101,110,99,111,100,105,110,103,90,25,73,110,99,114, - 101,109,101,110,116,97,108,78,101,119,108,105,110,101,68,101, - 99,111,100,101,114,218,6,100,101,99,111,100,101,41,5,218, - 12,115,111,117,114,99,101,95,98,121,116,101,115,114,158,0, - 0,0,90,21,115,111,117,114,99,101,95,98,121,116,101,115, - 95,114,101,97,100,108,105,110,101,218,8,101,110,99,111,100, - 105,110,103,90,15,110,101,119,108,105,110,101,95,100,101,99, - 111,100,101,114,114,2,0,0,0,114,2,0,0,0,114,4, - 0,0,0,218,13,100,101,99,111,100,101,95,115,111,117,114, - 99,101,94,2,0,0,115,10,0,0,0,0,5,8,1,12, - 1,10,1,12,1,114,162,0,0,0,41,2,114,128,0,0, - 0,218,26,115,117,98,109,111,100,117,108,101,95,115,101,97, - 114,99,104,95,108,111,99,97,116,105,111,110,115,99,2,0, - 0,0,2,0,0,0,9,0,0,0,8,0,0,0,67,0, - 0,0,115,16,1,0,0,124,1,100,1,107,8,114,60,100, - 2,125,1,116,0,124,2,100,3,131,2,114,70,122,14,124, - 2,160,1,124,0,161,1,125,1,87,0,113,70,4,0,116, - 2,107,10,114,56,1,0,1,0,1,0,89,0,113,70,88, - 0,110,10,116,3,160,4,124,1,161,1,125,1,116,5,106, - 6,124,0,124,2,124,1,100,4,141,3,125,4,100,5,124, - 4,95,7,124,2,100,1,107,8,114,154,116,8,131,0,68, - 0,93,42,92,2,125,5,125,6,124,1,160,9,116,10,124, - 6,131,1,161,1,114,106,124,5,124,0,124,1,131,2,125, - 2,124,2,124,4,95,11,1,0,113,154,113,106,100,1,83, - 0,124,3,116,12,107,8,114,220,116,0,124,2,100,6,131, - 2,114,226,122,14,124,2,160,13,124,0,161,1,125,7,87, - 0,110,20,4,0,116,2,107,10,114,206,1,0,1,0,1, - 0,89,0,113,226,88,0,124,7,114,226,103,0,124,4,95, - 14,110,6,124,3,124,4,95,14,124,4,106,14,103,0,107, - 2,144,1,114,12,124,1,144,1,114,12,116,15,124,1,131, - 1,100,7,25,0,125,8,124,4,106,14,160,16,124,8,161, - 1,1,0,124,4,83,0,41,8,97,61,1,0,0,82,101, - 116,117,114,110,32,97,32,109,111,100,117,108,101,32,115,112, - 101,99,32,98,97,115,101,100,32,111,110,32,97,32,102,105, - 108,101,32,108,111,99,97,116,105,111,110,46,10,10,32,32, - 32,32,84,111,32,105,110,100,105,99,97,116,101,32,116,104, - 97,116,32,116,104,101,32,109,111,100,117,108,101,32,105,115, - 32,97,32,112,97,99,107,97,103,101,44,32,115,101,116,10, - 32,32,32,32,115,117,98,109,111,100,117,108,101,95,115,101, - 97,114,99,104,95,108,111,99,97,116,105,111,110,115,32,116, - 111,32,97,32,108,105,115,116,32,111,102,32,100,105,114,101, - 99,116,111,114,121,32,112,97,116,104,115,46,32,32,65,110, - 10,32,32,32,32,101,109,112,116,121,32,108,105,115,116,32, - 105,115,32,115,117,102,102,105,99,105,101,110,116,44,32,116, - 104,111,117,103,104,32,105,116,115,32,110,111,116,32,111,116, - 104,101,114,119,105,115,101,32,117,115,101,102,117,108,32,116, - 111,32,116,104,101,10,32,32,32,32,105,109,112,111,114,116, - 32,115,121,115,116,101,109,46,10,10,32,32,32,32,84,104, - 101,32,108,111,97,100,101,114,32,109,117,115,116,32,116,97, - 107,101,32,97,32,115,112,101,99,32,97,115,32,105,116,115, - 32,111,110,108,121,32,95,95,105,110,105,116,95,95,40,41, - 32,97,114,103,46,10,10,32,32,32,32,78,122,9,60,117, - 110,107,110,111,119,110,62,218,12,103,101,116,95,102,105,108, - 101,110,97,109,101,41,1,218,6,111,114,105,103,105,110,84, - 218,10,105,115,95,112,97,99,107,97,103,101,114,64,0,0, - 0,41,17,114,116,0,0,0,114,164,0,0,0,114,107,0, - 0,0,114,1,0,0,0,114,70,0,0,0,114,122,0,0, - 0,218,10,77,111,100,117,108,101,83,112,101,99,90,13,95, - 115,101,116,95,102,105,108,101,97,116,116,114,218,27,95,103, - 101,116,95,115,117,112,112,111,114,116,101,100,95,102,105,108, - 101,95,108,111,97,100,101,114,115,114,101,0,0,0,114,102, - 0,0,0,114,128,0,0,0,218,9,95,80,79,80,85,76, - 65,84,69,114,166,0,0,0,114,163,0,0,0,114,42,0, - 0,0,218,6,97,112,112,101,110,100,41,9,114,106,0,0, - 0,90,8,108,111,99,97,116,105,111,110,114,128,0,0,0, - 114,163,0,0,0,218,4,115,112,101,99,218,12,108,111,97, - 100,101,114,95,99,108,97,115,115,218,8,115,117,102,102,105, - 120,101,115,114,166,0,0,0,90,7,100,105,114,110,97,109, - 101,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, - 218,23,115,112,101,99,95,102,114,111,109,95,102,105,108,101, - 95,108,111,99,97,116,105,111,110,111,2,0,0,115,62,0, - 0,0,0,12,8,4,4,1,10,2,2,1,14,1,14,1, - 8,2,10,8,16,1,6,3,8,1,14,1,14,1,10,1, - 6,1,6,2,4,3,8,2,10,1,2,1,14,1,14,1, - 6,2,4,1,8,2,6,1,12,1,6,1,12,1,12,2, - 114,174,0,0,0,99,0,0,0,0,0,0,0,0,0,0, - 0,0,4,0,0,0,64,0,0,0,115,86,0,0,0,101, - 0,90,1,100,0,90,2,100,1,90,3,100,2,90,4,100, - 3,90,5,100,4,90,6,101,7,100,5,100,6,132,0,131, - 1,90,8,101,7,100,7,100,8,132,0,131,1,90,9,101, - 7,100,9,100,9,102,2,100,10,100,11,132,1,131,1,90, - 10,101,7,100,9,102,1,100,12,100,13,132,1,131,1,90, - 11,100,9,83,0,41,14,218,21,87,105,110,100,111,119,115, - 82,101,103,105,115,116,114,121,70,105,110,100,101,114,122,62, - 77,101,116,97,32,112,97,116,104,32,102,105,110,100,101,114, - 32,102,111,114,32,109,111,100,117,108,101,115,32,100,101,99, - 108,97,114,101,100,32,105,110,32,116,104,101,32,87,105,110, - 100,111,119,115,32,114,101,103,105,115,116,114,121,46,122,59, - 83,111,102,116,119,97,114,101,92,80,121,116,104,111,110,92, - 80,121,116,104,111,110,67,111,114,101,92,123,115,121,115,95, - 118,101,114,115,105,111,110,125,92,77,111,100,117,108,101,115, - 92,123,102,117,108,108,110,97,109,101,125,122,65,83,111,102, - 116,119,97,114,101,92,80,121,116,104,111,110,92,80,121,116, - 104,111,110,67,111,114,101,92,123,115,121,115,95,118,101,114, - 115,105,111,110,125,92,77,111,100,117,108,101,115,92,123,102, - 117,108,108,110,97,109,101,125,92,68,101,98,117,103,70,99, - 2,0,0,0,0,0,0,0,2,0,0,0,8,0,0,0, - 67,0,0,0,115,56,0,0,0,122,16,116,0,160,1,116, - 0,106,2,124,1,161,2,87,0,83,0,4,0,116,3,107, - 10,114,50,1,0,1,0,1,0,116,0,160,1,116,0,106, - 4,124,1,161,2,6,0,89,0,83,0,88,0,100,0,83, - 0,41,1,78,41,5,218,7,95,119,105,110,114,101,103,90, - 7,79,112,101,110,75,101,121,90,17,72,75,69,89,95,67, - 85,82,82,69,78,84,95,85,83,69,82,114,44,0,0,0, - 90,18,72,75,69,89,95,76,79,67,65,76,95,77,65,67, - 72,73,78,69,41,2,218,3,99,108,115,114,3,0,0,0, - 114,2,0,0,0,114,2,0,0,0,114,4,0,0,0,218, - 14,95,111,112,101,110,95,114,101,103,105,115,116,114,121,191, - 2,0,0,115,8,0,0,0,0,2,2,1,16,1,14,1, - 122,36,87,105,110,100,111,119,115,82,101,103,105,115,116,114, - 121,70,105,110,100,101,114,46,95,111,112,101,110,95,114,101, - 103,105,115,116,114,121,99,2,0,0,0,0,0,0,0,6, - 0,0,0,9,0,0,0,67,0,0,0,115,118,0,0,0, - 124,0,106,0,114,14,124,0,106,1,125,2,110,6,124,0, - 106,2,125,2,124,2,106,3,124,1,100,1,116,4,106,5, - 100,0,100,2,133,2,25,0,22,0,100,3,141,2,125,3, - 122,38,124,0,160,6,124,3,161,1,143,18,125,4,116,7, - 160,8,124,4,100,4,161,2,125,5,87,0,53,0,81,0, - 82,0,88,0,87,0,110,26,4,0,116,9,107,10,114,112, - 1,0,1,0,1,0,89,0,100,0,83,0,89,0,110,2, - 88,0,124,5,83,0,41,5,78,122,5,37,100,46,37,100, - 114,23,0,0,0,41,2,114,127,0,0,0,90,11,115,121, - 115,95,118,101,114,115,105,111,110,114,35,0,0,0,41,10, - 218,11,68,69,66,85,71,95,66,85,73,76,68,218,18,82, - 69,71,73,83,84,82,89,95,75,69,89,95,68,69,66,85, - 71,218,12,82,69,71,73,83,84,82,89,95,75,69,89,114, - 54,0,0,0,114,6,0,0,0,218,12,118,101,114,115,105, - 111,110,95,105,110,102,111,114,178,0,0,0,114,176,0,0, - 0,90,10,81,117,101,114,121,86,97,108,117,101,114,44,0, - 0,0,41,6,114,177,0,0,0,114,127,0,0,0,90,12, - 114,101,103,105,115,116,114,121,95,107,101,121,114,3,0,0, - 0,90,4,104,107,101,121,218,8,102,105,108,101,112,97,116, - 104,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, - 218,16,95,115,101,97,114,99,104,95,114,101,103,105,115,116, - 114,121,198,2,0,0,115,24,0,0,0,0,2,6,1,8, - 2,6,1,6,1,16,255,6,2,2,1,12,1,26,1,14, - 1,12,1,122,38,87,105,110,100,111,119,115,82,101,103,105, - 115,116,114,121,70,105,110,100,101,114,46,95,115,101,97,114, - 99,104,95,114,101,103,105,115,116,114,121,78,99,4,0,0, - 0,0,0,0,0,8,0,0,0,8,0,0,0,67,0,0, - 0,115,122,0,0,0,124,0,160,0,124,1,161,1,125,4, - 124,4,100,0,107,8,114,22,100,0,83,0,122,12,116,1, - 124,4,131,1,1,0,87,0,110,22,4,0,116,2,107,10, - 114,56,1,0,1,0,1,0,89,0,100,0,83,0,88,0, - 116,3,131,0,68,0,93,52,92,2,125,5,125,6,124,4, - 160,4,116,5,124,6,131,1,161,1,114,64,116,6,106,7, - 124,1,124,5,124,1,124,4,131,2,124,4,100,1,141,3, - 125,7,124,7,2,0,1,0,83,0,113,64,100,0,83,0, - 41,2,78,41,1,114,165,0,0,0,41,8,114,184,0,0, - 0,114,43,0,0,0,114,44,0,0,0,114,168,0,0,0, - 114,101,0,0,0,114,102,0,0,0,114,122,0,0,0,218, - 16,115,112,101,99,95,102,114,111,109,95,108,111,97,100,101, - 114,41,8,114,177,0,0,0,114,127,0,0,0,114,39,0, - 0,0,218,6,116,97,114,103,101,116,114,183,0,0,0,114, - 128,0,0,0,114,173,0,0,0,114,171,0,0,0,114,2, - 0,0,0,114,2,0,0,0,114,4,0,0,0,218,9,102, - 105,110,100,95,115,112,101,99,213,2,0,0,115,28,0,0, - 0,0,2,10,1,8,1,4,1,2,1,12,1,14,1,8, - 1,14,1,14,1,6,1,8,1,2,254,6,3,122,31,87, + 10,32,32,32,32,114,146,0,0,0,233,12,0,0,0,114, + 14,0,0,0,122,22,98,121,116,101,99,111,100,101,32,105, + 115,32,115,116,97,108,101,32,102,111,114,32,114,144,0,0, + 0,78,114,145,0,0,0,41,4,114,27,0,0,0,114,134, + 0,0,0,114,149,0,0,0,114,118,0,0,0,41,6,114, + 26,0,0,0,218,12,115,111,117,114,99,101,95,109,116,105, + 109,101,218,11,115,111,117,114,99,101,95,115,105,122,101,114, + 117,0,0,0,114,151,0,0,0,114,93,0,0,0,114,3, + 0,0,0,114,3,0,0,0,114,6,0,0,0,218,23,95, + 118,97,108,105,100,97,116,101,95,116,105,109,101,115,116,97, + 109,112,95,112,121,99,8,2,0,0,115,16,0,0,0,0, + 19,24,1,10,1,12,1,12,1,8,1,22,255,2,2,114, + 156,0,0,0,99,4,0,0,0,0,0,0,0,4,0,0, + 0,3,0,0,0,67,0,0,0,115,38,0,0,0,124,0, + 100,1,100,2,133,2,25,0,124,1,107,3,114,34,116,0, + 100,3,124,2,155,2,157,2,102,1,124,3,142,1,130,1, + 100,4,83,0,41,5,97,243,1,0,0,86,97,108,105,100, + 97,116,101,32,97,32,104,97,115,104,45,98,97,115,101,100, + 32,112,121,99,32,98,121,32,99,104,101,99,107,105,110,103, + 32,116,104,101,32,114,101,97,108,32,115,111,117,114,99,101, + 32,104,97,115,104,32,97,103,97,105,110,115,116,32,116,104, + 101,32,111,110,101,32,105,110,10,32,32,32,32,116,104,101, + 32,112,121,99,32,104,101,97,100,101,114,46,10,10,32,32, + 32,32,42,100,97,116,97,42,32,105,115,32,116,104,101,32, + 99,111,110,116,101,110,116,115,32,111,102,32,116,104,101,32, + 112,121,99,32,102,105,108,101,46,32,40,79,110,108,121,32, + 116,104,101,32,102,105,114,115,116,32,49,54,32,98,121,116, + 101,115,32,97,114,101,10,32,32,32,32,114,101,113,117,105, + 114,101,100,46,41,10,10,32,32,32,32,42,115,111,117,114, + 99,101,95,104,97,115,104,42,32,105,115,32,116,104,101,32, + 105,109,112,111,114,116,108,105,98,46,117,116,105,108,46,115, + 111,117,114,99,101,95,104,97,115,104,40,41,32,111,102,32, + 116,104,101,32,115,111,117,114,99,101,32,102,105,108,101,46, + 10,10,32,32,32,32,42,110,97,109,101,42,32,105,115,32, + 116,104,101,32,110,97,109,101,32,111,102,32,116,104,101,32, + 109,111,100,117,108,101,32,98,101,105,110,103,32,105,109,112, + 111,114,116,101,100,46,32,73,116,32,105,115,32,117,115,101, + 100,32,102,111,114,32,108,111,103,103,105,110,103,46,10,10, + 32,32,32,32,42,101,120,99,95,100,101,116,97,105,108,115, + 42,32,105,115,32,97,32,100,105,99,116,105,111,110,97,114, + 121,32,112,97,115,115,101,100,32,116,111,32,73,109,112,111, + 114,116,69,114,114,111,114,32,105,102,32,105,116,32,114,97, + 105,115,101,100,32,102,111,114,10,32,32,32,32,105,109,112, + 114,111,118,101,100,32,100,101,98,117,103,103,105,110,103,46, + 10,10,32,32,32,32,65,110,32,73,109,112,111,114,116,69, + 114,114,111,114,32,105,115,32,114,97,105,115,101,100,32,105, + 102,32,116,104,101,32,98,121,116,101,99,111,100,101,32,105, + 115,32,115,116,97,108,101,46,10,10,32,32,32,32,114,146, + 0,0,0,114,145,0,0,0,122,46,104,97,115,104,32,105, + 110,32,98,121,116,101,99,111,100,101,32,100,111,101,115,110, + 39,116,32,109,97,116,99,104,32,104,97,115,104,32,111,102, + 32,115,111,117,114,99,101,32,78,41,1,114,118,0,0,0, + 41,4,114,26,0,0,0,218,11,115,111,117,114,99,101,95, + 104,97,115,104,114,117,0,0,0,114,151,0,0,0,114,3, + 0,0,0,114,3,0,0,0,114,6,0,0,0,218,18,95, + 118,97,108,105,100,97,116,101,95,104,97,115,104,95,112,121, + 99,36,2,0,0,115,12,0,0,0,0,17,16,1,2,1, + 8,255,2,2,2,254,114,158,0,0,0,99,4,0,0,0, + 0,0,0,0,5,0,0,0,5,0,0,0,67,0,0,0, + 115,82,0,0,0,116,0,160,1,124,0,161,1,125,4,116, + 2,124,4,116,3,131,2,114,58,116,4,160,5,100,1,124, + 2,161,2,1,0,124,3,100,2,107,9,114,52,116,6,160, + 7,124,4,124,3,161,2,1,0,124,4,83,0,110,20,116, + 8,100,3,160,9,124,2,161,1,124,1,124,2,100,4,141, + 3,130,1,100,2,83,0,41,5,122,35,67,111,109,112,105, + 108,101,32,98,121,116,101,99,111,100,101,32,97,115,32,102, + 111,117,110,100,32,105,110,32,97,32,112,121,99,46,122,21, + 99,111,100,101,32,111,98,106,101,99,116,32,102,114,111,109, + 32,123,33,114,125,78,122,23,78,111,110,45,99,111,100,101, + 32,111,98,106,101,99,116,32,105,110,32,123,33,114,125,169, + 2,114,117,0,0,0,114,44,0,0,0,41,10,218,7,109, + 97,114,115,104,97,108,90,5,108,111,97,100,115,218,10,105, + 115,105,110,115,116,97,110,99,101,218,10,95,99,111,100,101, + 95,116,121,112,101,114,134,0,0,0,114,149,0,0,0,218, + 4,95,105,109,112,90,16,95,102,105,120,95,99,111,95,102, + 105,108,101,110,97,109,101,114,118,0,0,0,114,62,0,0, + 0,41,5,114,26,0,0,0,114,117,0,0,0,114,107,0, + 0,0,114,108,0,0,0,218,4,99,111,100,101,114,3,0, + 0,0,114,3,0,0,0,114,6,0,0,0,218,17,95,99, + 111,109,112,105,108,101,95,98,121,116,101,99,111,100,101,60, + 2,0,0,115,20,0,0,0,0,2,10,1,10,1,12,1, + 8,1,12,1,6,2,10,1,2,0,2,255,114,165,0,0, + 0,114,73,0,0,0,99,3,0,0,0,0,0,0,0,4, + 0,0,0,5,0,0,0,67,0,0,0,115,70,0,0,0, + 116,0,116,1,131,1,125,3,124,3,160,2,116,3,100,1, + 131,1,161,1,1,0,124,3,160,2,116,3,124,1,131,1, + 161,1,1,0,124,3,160,2,116,3,124,2,131,1,161,1, + 1,0,124,3,160,2,116,4,160,5,124,0,161,1,161,1, + 1,0,124,3,83,0,41,2,122,43,80,114,111,100,117,99, + 101,32,116,104,101,32,100,97,116,97,32,102,111,114,32,97, + 32,116,105,109,101,115,116,97,109,112,45,98,97,115,101,100, + 32,112,121,99,46,114,73,0,0,0,41,6,218,9,98,121, + 116,101,97,114,114,97,121,114,148,0,0,0,218,6,101,120, + 116,101,110,100,114,20,0,0,0,114,160,0,0,0,218,5, + 100,117,109,112,115,41,4,114,164,0,0,0,218,5,109,116, + 105,109,101,114,155,0,0,0,114,26,0,0,0,114,3,0, + 0,0,114,3,0,0,0,114,6,0,0,0,218,22,95,99, + 111,100,101,95,116,111,95,116,105,109,101,115,116,97,109,112, + 95,112,121,99,73,2,0,0,115,12,0,0,0,0,2,8, + 1,14,1,14,1,14,1,16,1,114,170,0,0,0,84,99, + 3,0,0,0,0,0,0,0,5,0,0,0,5,0,0,0, + 67,0,0,0,115,80,0,0,0,116,0,116,1,131,1,125, + 3,100,1,124,2,100,1,62,0,66,0,125,4,124,3,160, + 2,116,3,124,4,131,1,161,1,1,0,116,4,124,1,131, + 1,100,2,107,2,115,50,116,5,130,1,124,3,160,2,124, + 1,161,1,1,0,124,3,160,2,116,6,160,7,124,0,161, + 1,161,1,1,0,124,3,83,0,41,3,122,38,80,114,111, + 100,117,99,101,32,116,104,101,32,100,97,116,97,32,102,111, + 114,32,97,32,104,97,115,104,45,98,97,115,101,100,32,112, + 121,99,46,114,39,0,0,0,114,146,0,0,0,41,8,114, + 166,0,0,0,114,148,0,0,0,114,167,0,0,0,114,20, + 0,0,0,114,22,0,0,0,114,23,0,0,0,114,160,0, + 0,0,114,168,0,0,0,41,5,114,164,0,0,0,114,157, + 0,0,0,90,7,99,104,101,99,107,101,100,114,26,0,0, + 0,114,83,0,0,0,114,3,0,0,0,114,3,0,0,0, + 114,6,0,0,0,218,17,95,99,111,100,101,95,116,111,95, + 104,97,115,104,95,112,121,99,83,2,0,0,115,14,0,0, + 0,0,2,8,1,12,1,14,1,16,1,10,1,16,1,114, + 171,0,0,0,99,1,0,0,0,0,0,0,0,5,0,0, + 0,6,0,0,0,67,0,0,0,115,62,0,0,0,100,1, + 100,2,108,0,125,1,116,1,160,2,124,0,161,1,106,3, + 125,2,124,1,160,4,124,2,161,1,125,3,116,1,160,5, + 100,2,100,3,161,2,125,4,124,4,160,6,124,0,160,6, + 124,3,100,1,25,0,161,1,161,1,83,0,41,4,122,121, + 68,101,99,111,100,101,32,98,121,116,101,115,32,114,101,112, + 114,101,115,101,110,116,105,110,103,32,115,111,117,114,99,101, + 32,99,111,100,101,32,97,110,100,32,114,101,116,117,114,110, + 32,116,104,101,32,115,116,114,105,110,103,46,10,10,32,32, + 32,32,85,110,105,118,101,114,115,97,108,32,110,101,119,108, + 105,110,101,32,115,117,112,112,111,114,116,32,105,115,32,117, + 115,101,100,32,105,110,32,116,104,101,32,100,101,99,111,100, + 105,110,103,46,10,32,32,32,32,114,73,0,0,0,78,84, + 41,7,218,8,116,111,107,101,110,105,122,101,114,64,0,0, + 0,90,7,66,121,116,101,115,73,79,90,8,114,101,97,100, + 108,105,110,101,90,15,100,101,116,101,99,116,95,101,110,99, + 111,100,105,110,103,90,25,73,110,99,114,101,109,101,110,116, + 97,108,78,101,119,108,105,110,101,68,101,99,111,100,101,114, + 218,6,100,101,99,111,100,101,41,5,218,12,115,111,117,114, + 99,101,95,98,121,116,101,115,114,172,0,0,0,90,21,115, + 111,117,114,99,101,95,98,121,116,101,115,95,114,101,97,100, + 108,105,110,101,218,8,101,110,99,111,100,105,110,103,90,15, + 110,101,119,108,105,110,101,95,100,101,99,111,100,101,114,114, + 3,0,0,0,114,3,0,0,0,114,6,0,0,0,218,13, + 100,101,99,111,100,101,95,115,111,117,114,99,101,94,2,0, + 0,115,10,0,0,0,0,5,8,1,12,1,10,1,12,1, + 114,176,0,0,0,169,2,114,140,0,0,0,218,26,115,117, + 98,109,111,100,117,108,101,95,115,101,97,114,99,104,95,108, + 111,99,97,116,105,111,110,115,99,2,0,0,0,2,0,0, + 0,9,0,0,0,8,0,0,0,67,0,0,0,115,16,1, + 0,0,124,1,100,1,107,8,114,60,100,2,125,1,116,0, + 124,2,100,3,131,2,114,70,122,14,124,2,160,1,124,0, + 161,1,125,1,87,0,113,70,4,0,116,2,107,10,114,56, + 1,0,1,0,1,0,89,0,113,70,88,0,110,10,116,3, + 160,4,124,1,161,1,125,1,116,5,106,6,124,0,124,2, + 124,1,100,4,141,3,125,4,100,5,124,4,95,7,124,2, + 100,1,107,8,114,154,116,8,131,0,68,0,93,42,92,2, + 125,5,125,6,124,1,160,9,116,10,124,6,131,1,161,1, + 114,106,124,5,124,0,124,1,131,2,125,2,124,2,124,4, + 95,11,1,0,113,154,113,106,100,1,83,0,124,3,116,12, + 107,8,114,220,116,0,124,2,100,6,131,2,114,226,122,14, + 124,2,160,13,124,0,161,1,125,7,87,0,110,20,4,0, + 116,2,107,10,114,206,1,0,1,0,1,0,89,0,113,226, + 88,0,124,7,114,226,103,0,124,4,95,14,110,6,124,3, + 124,4,95,14,124,4,106,14,103,0,107,2,144,1,114,12, + 124,1,144,1,114,12,116,15,124,1,131,1,100,7,25,0, + 125,8,124,4,106,14,160,16,124,8,161,1,1,0,124,4, + 83,0,41,8,97,61,1,0,0,82,101,116,117,114,110,32, + 97,32,109,111,100,117,108,101,32,115,112,101,99,32,98,97, + 115,101,100,32,111,110,32,97,32,102,105,108,101,32,108,111, + 99,97,116,105,111,110,46,10,10,32,32,32,32,84,111,32, + 105,110,100,105,99,97,116,101,32,116,104,97,116,32,116,104, + 101,32,109,111,100,117,108,101,32,105,115,32,97,32,112,97, + 99,107,97,103,101,44,32,115,101,116,10,32,32,32,32,115, + 117,98,109,111,100,117,108,101,95,115,101,97,114,99,104,95, + 108,111,99,97,116,105,111,110,115,32,116,111,32,97,32,108, + 105,115,116,32,111,102,32,100,105,114,101,99,116,111,114,121, + 32,112,97,116,104,115,46,32,32,65,110,10,32,32,32,32, + 101,109,112,116,121,32,108,105,115,116,32,105,115,32,115,117, + 102,102,105,99,105,101,110,116,44,32,116,104,111,117,103,104, + 32,105,116,115,32,110,111,116,32,111,116,104,101,114,119,105, + 115,101,32,117,115,101,102,117,108,32,116,111,32,116,104,101, + 10,32,32,32,32,105,109,112,111,114,116,32,115,121,115,116, + 101,109,46,10,10,32,32,32,32,84,104,101,32,108,111,97, + 100,101,114,32,109,117,115,116,32,116,97,107,101,32,97,32, + 115,112,101,99,32,97,115,32,105,116,115,32,111,110,108,121, + 32,95,95,105,110,105,116,95,95,40,41,32,97,114,103,46, + 10,10,32,32,32,32,78,122,9,60,117,110,107,110,111,119, + 110,62,218,12,103,101,116,95,102,105,108,101,110,97,109,101, + 169,1,218,6,111,114,105,103,105,110,84,218,10,105,115,95, + 112,97,99,107,97,103,101,114,73,0,0,0,41,17,114,128, + 0,0,0,114,179,0,0,0,114,118,0,0,0,114,2,0, + 0,0,114,79,0,0,0,114,134,0,0,0,218,10,77,111, + 100,117,108,101,83,112,101,99,90,13,95,115,101,116,95,102, + 105,108,101,97,116,116,114,218,27,95,103,101,116,95,115,117, + 112,112,111,114,116,101,100,95,102,105,108,101,95,108,111,97, + 100,101,114,115,114,111,0,0,0,114,112,0,0,0,114,140, + 0,0,0,218,9,95,80,79,80,85,76,65,84,69,114,182, + 0,0,0,114,178,0,0,0,114,47,0,0,0,218,6,97, + 112,112,101,110,100,41,9,114,117,0,0,0,90,8,108,111, + 99,97,116,105,111,110,114,140,0,0,0,114,178,0,0,0, + 218,4,115,112,101,99,218,12,108,111,97,100,101,114,95,99, + 108,97,115,115,218,8,115,117,102,102,105,120,101,115,114,182, + 0,0,0,90,7,100,105,114,110,97,109,101,114,3,0,0, + 0,114,3,0,0,0,114,6,0,0,0,218,23,115,112,101, + 99,95,102,114,111,109,95,102,105,108,101,95,108,111,99,97, + 116,105,111,110,111,2,0,0,115,62,0,0,0,0,12,8, + 4,4,1,10,2,2,1,14,1,14,1,8,2,10,8,16, + 1,6,3,8,1,14,1,14,1,10,1,6,1,6,2,4, + 3,8,2,10,1,2,1,14,1,14,1,6,2,4,1,8, + 2,6,1,12,1,6,1,12,1,12,2,114,190,0,0,0, + 99,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0, + 0,64,0,0,0,115,86,0,0,0,101,0,90,1,100,0, + 90,2,100,1,90,3,100,2,90,4,100,3,90,5,100,4, + 90,6,101,7,100,5,100,6,132,0,131,1,90,8,101,7, + 100,7,100,8,132,0,131,1,90,9,101,7,100,9,100,9, + 102,2,100,10,100,11,132,1,131,1,90,10,101,7,100,9, + 102,1,100,12,100,13,132,1,131,1,90,11,100,9,83,0, + 41,14,218,21,87,105,110,100,111,119,115,82,101,103,105,115, + 116,114,121,70,105,110,100,101,114,122,62,77,101,116,97,32, + 112,97,116,104,32,102,105,110,100,101,114,32,102,111,114,32, + 109,111,100,117,108,101,115,32,100,101,99,108,97,114,101,100, + 32,105,110,32,116,104,101,32,87,105,110,100,111,119,115,32, + 114,101,103,105,115,116,114,121,46,122,59,83,111,102,116,119, + 97,114,101,92,80,121,116,104,111,110,92,80,121,116,104,111, + 110,67,111,114,101,92,123,115,121,115,95,118,101,114,115,105, + 111,110,125,92,77,111,100,117,108,101,115,92,123,102,117,108, + 108,110,97,109,101,125,122,65,83,111,102,116,119,97,114,101, + 92,80,121,116,104,111,110,92,80,121,116,104,111,110,67,111, + 114,101,92,123,115,121,115,95,118,101,114,115,105,111,110,125, + 92,77,111,100,117,108,101,115,92,123,102,117,108,108,110,97, + 109,101,125,92,68,101,98,117,103,70,99,2,0,0,0,0, + 0,0,0,2,0,0,0,8,0,0,0,67,0,0,0,115, + 56,0,0,0,122,16,116,0,160,1,116,0,106,2,124,1, + 161,2,87,0,83,0,4,0,116,3,107,10,114,50,1,0, + 1,0,1,0,116,0,160,1,116,0,106,4,124,1,161,2, + 6,0,89,0,83,0,88,0,100,0,83,0,114,110,0,0, + 0,41,5,218,7,95,119,105,110,114,101,103,90,7,79,112, + 101,110,75,101,121,90,17,72,75,69,89,95,67,85,82,82, + 69,78,84,95,85,83,69,82,114,50,0,0,0,90,18,72, + 75,69,89,95,76,79,67,65,76,95,77,65,67,72,73,78, + 69,41,2,218,3,99,108,115,114,5,0,0,0,114,3,0, + 0,0,114,3,0,0,0,114,6,0,0,0,218,14,95,111, + 112,101,110,95,114,101,103,105,115,116,114,121,191,2,0,0, + 115,8,0,0,0,0,2,2,1,16,1,14,1,122,36,87, 105,110,100,111,119,115,82,101,103,105,115,116,114,121,70,105, - 110,100,101,114,46,102,105,110,100,95,115,112,101,99,99,3, - 0,0,0,0,0,0,0,4,0,0,0,4,0,0,0,67, - 0,0,0,115,34,0,0,0,124,0,160,0,124,1,124,2, - 161,2,125,3,124,3,100,1,107,9,114,26,124,3,106,1, - 83,0,100,1,83,0,100,1,83,0,41,2,122,108,70,105, - 110,100,32,109,111,100,117,108,101,32,110,97,109,101,100,32, - 105,110,32,116,104,101,32,114,101,103,105,115,116,114,121,46, - 10,10,32,32,32,32,32,32,32,32,84,104,105,115,32,109, - 101,116,104,111,100,32,105,115,32,100,101,112,114,101,99,97, - 116,101,100,46,32,32,85,115,101,32,101,120,101,99,95,109, - 111,100,117,108,101,40,41,32,105,110,115,116,101,97,100,46, - 10,10,32,32,32,32,32,32,32,32,78,41,2,114,187,0, - 0,0,114,128,0,0,0,41,4,114,177,0,0,0,114,127, - 0,0,0,114,39,0,0,0,114,171,0,0,0,114,2,0, - 0,0,114,2,0,0,0,114,4,0,0,0,218,11,102,105, - 110,100,95,109,111,100,117,108,101,229,2,0,0,115,8,0, - 0,0,0,7,12,1,8,1,6,2,122,33,87,105,110,100, - 111,119,115,82,101,103,105,115,116,114,121,70,105,110,100,101, - 114,46,102,105,110,100,95,109,111,100,117,108,101,41,12,114, - 113,0,0,0,114,112,0,0,0,114,114,0,0,0,114,115, - 0,0,0,114,181,0,0,0,114,180,0,0,0,114,179,0, - 0,0,218,11,99,108,97,115,115,109,101,116,104,111,100,114, - 178,0,0,0,114,184,0,0,0,114,187,0,0,0,114,188, - 0,0,0,114,2,0,0,0,114,2,0,0,0,114,2,0, - 0,0,114,4,0,0,0,114,175,0,0,0,179,2,0,0, - 115,28,0,0,0,8,2,4,3,2,255,2,4,2,255,2, - 3,4,2,2,1,10,6,2,1,10,14,2,1,16,15,2, - 1,114,175,0,0,0,99,0,0,0,0,0,0,0,0,0, - 0,0,0,2,0,0,0,64,0,0,0,115,48,0,0,0, - 101,0,90,1,100,0,90,2,100,1,90,3,100,2,100,3, - 132,0,90,4,100,4,100,5,132,0,90,5,100,6,100,7, - 132,0,90,6,100,8,100,9,132,0,90,7,100,10,83,0, - 41,11,218,13,95,76,111,97,100,101,114,66,97,115,105,99, - 115,122,83,66,97,115,101,32,99,108,97,115,115,32,111,102, - 32,99,111,109,109,111,110,32,99,111,100,101,32,110,101,101, - 100,101,100,32,98,121,32,98,111,116,104,32,83,111,117,114, - 99,101,76,111,97,100,101,114,32,97,110,100,10,32,32,32, - 32,83,111,117,114,99,101,108,101,115,115,70,105,108,101,76, - 111,97,100,101,114,46,99,2,0,0,0,0,0,0,0,5, - 0,0,0,4,0,0,0,67,0,0,0,115,64,0,0,0, - 116,0,124,0,160,1,124,1,161,1,131,1,100,1,25,0, - 125,2,124,2,160,2,100,2,100,1,161,2,100,3,25,0, - 125,3,124,1,160,3,100,2,161,1,100,4,25,0,125,4, - 124,3,100,5,107,2,111,62,124,4,100,5,107,3,83,0, - 41,6,122,141,67,111,110,99,114,101,116,101,32,105,109,112, - 108,101,109,101,110,116,97,116,105,111,110,32,111,102,32,73, - 110,115,112,101,99,116,76,111,97,100,101,114,46,105,115,95, - 112,97,99,107,97,103,101,32,98,121,32,99,104,101,99,107, - 105,110,103,32,105,102,10,32,32,32,32,32,32,32,32,116, - 104,101,32,112,97,116,104,32,114,101,116,117,114,110,101,100, - 32,98,121,32,103,101,116,95,102,105,108,101,110,97,109,101, - 32,104,97,115,32,97,32,102,105,108,101,110,97,109,101,32, - 111,102,32,39,95,95,105,110,105,116,95,95,46,112,121,39, - 46,114,34,0,0,0,114,63,0,0,0,114,64,0,0,0, - 114,23,0,0,0,218,8,95,95,105,110,105,116,95,95,41, - 4,114,42,0,0,0,114,164,0,0,0,114,38,0,0,0, - 114,36,0,0,0,41,5,114,108,0,0,0,114,127,0,0, - 0,114,88,0,0,0,90,13,102,105,108,101,110,97,109,101, - 95,98,97,115,101,90,9,116,97,105,108,95,110,97,109,101, - 114,2,0,0,0,114,2,0,0,0,114,4,0,0,0,114, - 166,0,0,0,248,2,0,0,115,8,0,0,0,0,3,18, - 1,16,1,14,1,122,24,95,76,111,97,100,101,114,66,97, - 115,105,99,115,46,105,115,95,112,97,99,107,97,103,101,99, + 110,100,101,114,46,95,111,112,101,110,95,114,101,103,105,115, + 116,114,121,99,2,0,0,0,0,0,0,0,6,0,0,0, + 9,0,0,0,67,0,0,0,115,118,0,0,0,124,0,106, + 0,114,14,124,0,106,1,125,2,110,6,124,0,106,2,125, + 2,124,2,106,3,124,1,100,1,116,4,106,5,100,0,100, + 2,133,2,25,0,22,0,100,3,141,2,125,3,122,38,124, + 0,160,6,124,3,161,1,143,18,125,4,116,7,160,8,124, + 4,100,4,161,2,125,5,87,0,53,0,81,0,82,0,88, + 0,87,0,110,26,4,0,116,9,107,10,114,112,1,0,1, + 0,1,0,89,0,100,0,83,0,89,0,110,2,88,0,124, + 5,83,0,41,5,78,122,5,37,100,46,37,100,114,28,0, + 0,0,41,2,114,139,0,0,0,90,11,115,121,115,95,118, + 101,114,115,105,111,110,114,40,0,0,0,41,10,218,11,68, + 69,66,85,71,95,66,85,73,76,68,218,18,82,69,71,73, + 83,84,82,89,95,75,69,89,95,68,69,66,85,71,218,12, + 82,69,71,73,83,84,82,89,95,75,69,89,114,62,0,0, + 0,114,8,0,0,0,218,12,118,101,114,115,105,111,110,95, + 105,110,102,111,114,194,0,0,0,114,192,0,0,0,90,10, + 81,117,101,114,121,86,97,108,117,101,114,50,0,0,0,41, + 6,114,193,0,0,0,114,139,0,0,0,90,12,114,101,103, + 105,115,116,114,121,95,107,101,121,114,5,0,0,0,90,4, + 104,107,101,121,218,8,102,105,108,101,112,97,116,104,114,3, + 0,0,0,114,3,0,0,0,114,6,0,0,0,218,16,95, + 115,101,97,114,99,104,95,114,101,103,105,115,116,114,121,198, + 2,0,0,115,24,0,0,0,0,2,6,1,8,2,6,1, + 6,1,16,255,6,2,2,1,12,1,26,1,14,1,12,1, + 122,38,87,105,110,100,111,119,115,82,101,103,105,115,116,114, + 121,70,105,110,100,101,114,46,95,115,101,97,114,99,104,95, + 114,101,103,105,115,116,114,121,78,99,4,0,0,0,0,0, + 0,0,8,0,0,0,8,0,0,0,67,0,0,0,115,122, + 0,0,0,124,0,160,0,124,1,161,1,125,4,124,4,100, + 0,107,8,114,22,100,0,83,0,122,12,116,1,124,4,131, + 1,1,0,87,0,110,22,4,0,116,2,107,10,114,56,1, + 0,1,0,1,0,89,0,100,0,83,0,88,0,116,3,131, + 0,68,0,93,52,92,2,125,5,125,6,124,4,160,4,116, + 5,124,6,131,1,161,1,114,64,116,6,106,7,124,1,124, + 5,124,1,124,4,131,2,124,4,100,1,141,3,125,7,124, + 7,2,0,1,0,83,0,113,64,100,0,83,0,41,2,78, + 114,180,0,0,0,41,8,114,200,0,0,0,114,49,0,0, + 0,114,50,0,0,0,114,184,0,0,0,114,111,0,0,0, + 114,112,0,0,0,114,134,0,0,0,218,16,115,112,101,99, + 95,102,114,111,109,95,108,111,97,100,101,114,41,8,114,193, + 0,0,0,114,139,0,0,0,114,44,0,0,0,218,6,116, + 97,114,103,101,116,114,199,0,0,0,114,140,0,0,0,114, + 189,0,0,0,114,187,0,0,0,114,3,0,0,0,114,3, + 0,0,0,114,6,0,0,0,218,9,102,105,110,100,95,115, + 112,101,99,213,2,0,0,115,28,0,0,0,0,2,10,1, + 8,1,4,1,2,1,12,1,14,1,8,1,14,1,14,1, + 6,1,8,1,2,254,6,3,122,31,87,105,110,100,111,119, + 115,82,101,103,105,115,116,114,121,70,105,110,100,101,114,46, + 102,105,110,100,95,115,112,101,99,99,3,0,0,0,0,0, + 0,0,4,0,0,0,4,0,0,0,67,0,0,0,115,34, + 0,0,0,124,0,160,0,124,1,124,2,161,2,125,3,124, + 3,100,1,107,9,114,26,124,3,106,1,83,0,100,1,83, + 0,100,1,83,0,41,2,122,108,70,105,110,100,32,109,111, + 100,117,108,101,32,110,97,109,101,100,32,105,110,32,116,104, + 101,32,114,101,103,105,115,116,114,121,46,10,10,32,32,32, + 32,32,32,32,32,84,104,105,115,32,109,101,116,104,111,100, + 32,105,115,32,100,101,112,114,101,99,97,116,101,100,46,32, + 32,85,115,101,32,101,120,101,99,95,109,111,100,117,108,101, + 40,41,32,105,110,115,116,101,97,100,46,10,10,32,32,32, + 32,32,32,32,32,78,169,2,114,203,0,0,0,114,140,0, + 0,0,169,4,114,193,0,0,0,114,139,0,0,0,114,44, + 0,0,0,114,187,0,0,0,114,3,0,0,0,114,3,0, + 0,0,114,6,0,0,0,218,11,102,105,110,100,95,109,111, + 100,117,108,101,229,2,0,0,115,8,0,0,0,0,7,12, + 1,8,1,6,2,122,33,87,105,110,100,111,119,115,82,101, + 103,105,115,116,114,121,70,105,110,100,101,114,46,102,105,110, + 100,95,109,111,100,117,108,101,41,12,114,125,0,0,0,114, + 124,0,0,0,114,126,0,0,0,114,127,0,0,0,114,197, + 0,0,0,114,196,0,0,0,114,195,0,0,0,218,11,99, + 108,97,115,115,109,101,116,104,111,100,114,194,0,0,0,114, + 200,0,0,0,114,203,0,0,0,114,206,0,0,0,114,3, + 0,0,0,114,3,0,0,0,114,3,0,0,0,114,6,0, + 0,0,114,191,0,0,0,179,2,0,0,115,28,0,0,0, + 8,2,4,3,2,255,2,4,2,255,2,3,4,2,2,1, + 10,6,2,1,10,14,2,1,16,15,2,1,114,191,0,0, + 0,99,0,0,0,0,0,0,0,0,0,0,0,0,2,0, + 0,0,64,0,0,0,115,48,0,0,0,101,0,90,1,100, + 0,90,2,100,1,90,3,100,2,100,3,132,0,90,4,100, + 4,100,5,132,0,90,5,100,6,100,7,132,0,90,6,100, + 8,100,9,132,0,90,7,100,10,83,0,41,11,218,13,95, + 76,111,97,100,101,114,66,97,115,105,99,115,122,83,66,97, + 115,101,32,99,108,97,115,115,32,111,102,32,99,111,109,109, + 111,110,32,99,111,100,101,32,110,101,101,100,101,100,32,98, + 121,32,98,111,116,104,32,83,111,117,114,99,101,76,111,97, + 100,101,114,32,97,110,100,10,32,32,32,32,83,111,117,114, + 99,101,108,101,115,115,70,105,108,101,76,111,97,100,101,114, + 46,99,2,0,0,0,0,0,0,0,5,0,0,0,4,0, + 0,0,67,0,0,0,115,64,0,0,0,116,0,124,0,160, + 1,124,1,161,1,131,1,100,1,25,0,125,2,124,2,160, + 2,100,2,100,1,161,2,100,3,25,0,125,3,124,1,160, + 3,100,2,161,1,100,4,25,0,125,4,124,3,100,5,107, + 2,111,62,124,4,100,5,107,3,83,0,41,6,122,141,67, + 111,110,99,114,101,116,101,32,105,109,112,108,101,109,101,110, + 116,97,116,105,111,110,32,111,102,32,73,110,115,112,101,99, + 116,76,111,97,100,101,114,46,105,115,95,112,97,99,107,97, + 103,101,32,98,121,32,99,104,101,99,107,105,110,103,32,105, + 102,10,32,32,32,32,32,32,32,32,116,104,101,32,112,97, + 116,104,32,114,101,116,117,114,110,101,100,32,98,121,32,103, + 101,116,95,102,105,108,101,110,97,109,101,32,104,97,115,32, + 97,32,102,105,108,101,110,97,109,101,32,111,102,32,39,95, + 95,105,110,105,116,95,95,46,112,121,39,46,114,39,0,0, + 0,114,71,0,0,0,114,73,0,0,0,114,28,0,0,0, + 218,8,95,95,105,110,105,116,95,95,41,4,114,47,0,0, + 0,114,179,0,0,0,114,43,0,0,0,114,41,0,0,0, + 41,5,114,119,0,0,0,114,139,0,0,0,114,97,0,0, + 0,90,13,102,105,108,101,110,97,109,101,95,98,97,115,101, + 90,9,116,97,105,108,95,110,97,109,101,114,3,0,0,0, + 114,3,0,0,0,114,6,0,0,0,114,182,0,0,0,248, + 2,0,0,115,8,0,0,0,0,3,18,1,16,1,14,1, + 122,24,95,76,111,97,100,101,114,66,97,115,105,99,115,46, + 105,115,95,112,97,99,107,97,103,101,99,2,0,0,0,0, + 0,0,0,2,0,0,0,1,0,0,0,67,0,0,0,115, + 4,0,0,0,100,1,83,0,169,2,122,42,85,115,101,32, + 100,101,102,97,117,108,116,32,115,101,109,97,110,116,105,99, + 115,32,102,111,114,32,109,111,100,117,108,101,32,99,114,101, + 97,116,105,111,110,46,78,114,3,0,0,0,169,2,114,119, + 0,0,0,114,187,0,0,0,114,3,0,0,0,114,3,0, + 0,0,114,6,0,0,0,218,13,99,114,101,97,116,101,95, + 109,111,100,117,108,101,0,3,0,0,115,2,0,0,0,0, + 1,122,27,95,76,111,97,100,101,114,66,97,115,105,99,115, + 46,99,114,101,97,116,101,95,109,111,100,117,108,101,99,2, + 0,0,0,0,0,0,0,3,0,0,0,5,0,0,0,67, + 0,0,0,115,56,0,0,0,124,0,160,0,124,1,106,1, + 161,1,125,2,124,2,100,1,107,8,114,36,116,2,100,2, + 160,3,124,1,106,1,161,1,131,1,130,1,116,4,160,5, + 116,6,124,2,124,1,106,7,161,3,1,0,100,1,83,0, + 41,3,122,19,69,120,101,99,117,116,101,32,116,104,101,32, + 109,111,100,117,108,101,46,78,122,52,99,97,110,110,111,116, + 32,108,111,97,100,32,109,111,100,117,108,101,32,123,33,114, + 125,32,119,104,101,110,32,103,101,116,95,99,111,100,101,40, + 41,32,114,101,116,117,114,110,115,32,78,111,110,101,41,8, + 218,8,103,101,116,95,99,111,100,101,114,125,0,0,0,114, + 118,0,0,0,114,62,0,0,0,114,134,0,0,0,218,25, + 95,99,97,108,108,95,119,105,116,104,95,102,114,97,109,101, + 115,95,114,101,109,111,118,101,100,218,4,101,120,101,99,114, + 131,0,0,0,41,3,114,119,0,0,0,218,6,109,111,100, + 117,108,101,114,164,0,0,0,114,3,0,0,0,114,3,0, + 0,0,114,6,0,0,0,218,11,101,120,101,99,95,109,111, + 100,117,108,101,3,3,0,0,115,12,0,0,0,0,2,12, + 1,8,1,6,1,4,255,6,2,122,25,95,76,111,97,100, + 101,114,66,97,115,105,99,115,46,101,120,101,99,95,109,111, + 100,117,108,101,99,2,0,0,0,0,0,0,0,2,0,0, + 0,4,0,0,0,67,0,0,0,115,12,0,0,0,116,0, + 160,1,124,0,124,1,161,2,83,0,41,1,122,26,84,104, + 105,115,32,109,111,100,117,108,101,32,105,115,32,100,101,112, + 114,101,99,97,116,101,100,46,41,2,114,134,0,0,0,218, + 17,95,108,111,97,100,95,109,111,100,117,108,101,95,115,104, + 105,109,169,2,114,119,0,0,0,114,139,0,0,0,114,3, + 0,0,0,114,3,0,0,0,114,6,0,0,0,218,11,108, + 111,97,100,95,109,111,100,117,108,101,11,3,0,0,115,2, + 0,0,0,0,2,122,25,95,76,111,97,100,101,114,66,97, + 115,105,99,115,46,108,111,97,100,95,109,111,100,117,108,101, + 78,41,8,114,125,0,0,0,114,124,0,0,0,114,126,0, + 0,0,114,127,0,0,0,114,182,0,0,0,114,212,0,0, + 0,114,217,0,0,0,114,220,0,0,0,114,3,0,0,0, + 114,3,0,0,0,114,3,0,0,0,114,6,0,0,0,114, + 208,0,0,0,243,2,0,0,115,10,0,0,0,8,3,4, + 2,8,8,8,3,8,8,114,208,0,0,0,99,0,0,0, + 0,0,0,0,0,0,0,0,0,3,0,0,0,64,0,0, + 0,115,74,0,0,0,101,0,90,1,100,0,90,2,100,1, + 100,2,132,0,90,3,100,3,100,4,132,0,90,4,100,5, + 100,6,132,0,90,5,100,7,100,8,132,0,90,6,100,9, + 100,10,132,0,90,7,100,11,100,12,156,1,100,13,100,14, + 132,2,90,8,100,15,100,16,132,0,90,9,100,17,83,0, + 41,18,218,12,83,111,117,114,99,101,76,111,97,100,101,114, + 99,2,0,0,0,0,0,0,0,2,0,0,0,1,0,0, + 0,67,0,0,0,115,8,0,0,0,116,0,130,1,100,1, + 83,0,41,2,122,165,79,112,116,105,111,110,97,108,32,109, + 101,116,104,111,100,32,116,104,97,116,32,114,101,116,117,114, + 110,115,32,116,104,101,32,109,111,100,105,102,105,99,97,116, + 105,111,110,32,116,105,109,101,32,40,97,110,32,105,110,116, + 41,32,102,111,114,32,116,104,101,10,32,32,32,32,32,32, + 32,32,115,112,101,99,105,102,105,101,100,32,112,97,116,104, + 32,40,97,32,115,116,114,41,46,10,10,32,32,32,32,32, + 32,32,32,82,97,105,115,101,115,32,79,83,69,114,114,111, + 114,32,119,104,101,110,32,116,104,101,32,112,97,116,104,32, + 99,97,110,110,111,116,32,98,101,32,104,97,110,100,108,101, + 100,46,10,32,32,32,32,32,32,32,32,78,41,1,114,50, + 0,0,0,169,2,114,119,0,0,0,114,44,0,0,0,114, + 3,0,0,0,114,3,0,0,0,114,6,0,0,0,218,10, + 112,97,116,104,95,109,116,105,109,101,18,3,0,0,115,2, + 0,0,0,0,6,122,23,83,111,117,114,99,101,76,111,97, + 100,101,114,46,112,97,116,104,95,109,116,105,109,101,99,2, + 0,0,0,0,0,0,0,2,0,0,0,4,0,0,0,67, + 0,0,0,115,14,0,0,0,100,1,124,0,160,0,124,1, + 161,1,105,1,83,0,41,2,97,158,1,0,0,79,112,116, + 105,111,110,97,108,32,109,101,116,104,111,100,32,114,101,116, + 117,114,110,105,110,103,32,97,32,109,101,116,97,100,97,116, + 97,32,100,105,99,116,32,102,111,114,32,116,104,101,32,115, + 112,101,99,105,102,105,101,100,10,32,32,32,32,32,32,32, + 32,112,97,116,104,32,40,97,32,115,116,114,41,46,10,10, + 32,32,32,32,32,32,32,32,80,111,115,115,105,98,108,101, + 32,107,101,121,115,58,10,32,32,32,32,32,32,32,32,45, + 32,39,109,116,105,109,101,39,32,40,109,97,110,100,97,116, + 111,114,121,41,32,105,115,32,116,104,101,32,110,117,109,101, + 114,105,99,32,116,105,109,101,115,116,97,109,112,32,111,102, + 32,108,97,115,116,32,115,111,117,114,99,101,10,32,32,32, + 32,32,32,32,32,32,32,99,111,100,101,32,109,111,100,105, + 102,105,99,97,116,105,111,110,59,10,32,32,32,32,32,32, + 32,32,45,32,39,115,105,122,101,39,32,40,111,112,116,105, + 111,110,97,108,41,32,105,115,32,116,104,101,32,115,105,122, + 101,32,105,110,32,98,121,116,101,115,32,111,102,32,116,104, + 101,32,115,111,117,114,99,101,32,99,111,100,101,46,10,10, + 32,32,32,32,32,32,32,32,73,109,112,108,101,109,101,110, + 116,105,110,103,32,116,104,105,115,32,109,101,116,104,111,100, + 32,97,108,108,111,119,115,32,116,104,101,32,108,111,97,100, + 101,114,32,116,111,32,114,101,97,100,32,98,121,116,101,99, + 111,100,101,32,102,105,108,101,115,46,10,32,32,32,32,32, + 32,32,32,82,97,105,115,101,115,32,79,83,69,114,114,111, + 114,32,119,104,101,110,32,116,104,101,32,112,97,116,104,32, + 99,97,110,110,111,116,32,98,101,32,104,97,110,100,108,101, + 100,46,10,32,32,32,32,32,32,32,32,114,169,0,0,0, + 41,1,114,223,0,0,0,114,222,0,0,0,114,3,0,0, + 0,114,3,0,0,0,114,6,0,0,0,218,10,112,97,116, + 104,95,115,116,97,116,115,26,3,0,0,115,2,0,0,0, + 0,12,122,23,83,111,117,114,99,101,76,111,97,100,101,114, + 46,112,97,116,104,95,115,116,97,116,115,99,4,0,0,0, + 0,0,0,0,4,0,0,0,4,0,0,0,67,0,0,0, + 115,12,0,0,0,124,0,160,0,124,2,124,3,161,2,83, + 0,41,1,122,228,79,112,116,105,111,110,97,108,32,109,101, + 116,104,111,100,32,119,104,105,99,104,32,119,114,105,116,101, + 115,32,100,97,116,97,32,40,98,121,116,101,115,41,32,116, + 111,32,97,32,102,105,108,101,32,112,97,116,104,32,40,97, + 32,115,116,114,41,46,10,10,32,32,32,32,32,32,32,32, + 73,109,112,108,101,109,101,110,116,105,110,103,32,116,104,105, + 115,32,109,101,116,104,111,100,32,97,108,108,111,119,115,32, + 102,111,114,32,116,104,101,32,119,114,105,116,105,110,103,32, + 111,102,32,98,121,116,101,99,111,100,101,32,102,105,108,101, + 115,46,10,10,32,32,32,32,32,32,32,32,84,104,101,32, + 115,111,117,114,99,101,32,112,97,116,104,32,105,115,32,110, + 101,101,100,101,100,32,105,110,32,111,114,100,101,114,32,116, + 111,32,99,111,114,114,101,99,116,108,121,32,116,114,97,110, + 115,102,101,114,32,112,101,114,109,105,115,115,105,111,110,115, + 10,32,32,32,32,32,32,32,32,41,1,218,8,115,101,116, + 95,100,97,116,97,41,4,114,119,0,0,0,114,108,0,0, + 0,90,10,99,97,99,104,101,95,112,97,116,104,114,26,0, + 0,0,114,3,0,0,0,114,3,0,0,0,114,6,0,0, + 0,218,15,95,99,97,99,104,101,95,98,121,116,101,99,111, + 100,101,40,3,0,0,115,2,0,0,0,0,8,122,28,83, + 111,117,114,99,101,76,111,97,100,101,114,46,95,99,97,99, + 104,101,95,98,121,116,101,99,111,100,101,99,3,0,0,0, + 0,0,0,0,3,0,0,0,1,0,0,0,67,0,0,0, + 115,4,0,0,0,100,1,83,0,41,2,122,150,79,112,116, + 105,111,110,97,108,32,109,101,116,104,111,100,32,119,104,105, + 99,104,32,119,114,105,116,101,115,32,100,97,116,97,32,40, + 98,121,116,101,115,41,32,116,111,32,97,32,102,105,108,101, + 32,112,97,116,104,32,40,97,32,115,116,114,41,46,10,10, + 32,32,32,32,32,32,32,32,73,109,112,108,101,109,101,110, + 116,105,110,103,32,116,104,105,115,32,109,101,116,104,111,100, + 32,97,108,108,111,119,115,32,102,111,114,32,116,104,101,32, + 119,114,105,116,105,110,103,32,111,102,32,98,121,116,101,99, + 111,100,101,32,102,105,108,101,115,46,10,32,32,32,32,32, + 32,32,32,78,114,3,0,0,0,41,3,114,119,0,0,0, + 114,44,0,0,0,114,26,0,0,0,114,3,0,0,0,114, + 3,0,0,0,114,6,0,0,0,114,225,0,0,0,50,3, + 0,0,115,2,0,0,0,0,4,122,21,83,111,117,114,99, + 101,76,111,97,100,101,114,46,115,101,116,95,100,97,116,97, + 99,2,0,0,0,0,0,0,0,5,0,0,0,10,0,0, + 0,67,0,0,0,115,82,0,0,0,124,0,160,0,124,1, + 161,1,125,2,122,14,124,0,160,1,124,2,161,1,125,3, + 87,0,110,48,4,0,116,2,107,10,114,72,1,0,125,4, + 1,0,122,18,116,3,100,1,124,1,100,2,141,2,124,4, + 130,2,87,0,53,0,100,3,125,4,126,4,88,0,89,0, + 110,2,88,0,116,4,124,3,131,1,83,0,41,4,122,52, + 67,111,110,99,114,101,116,101,32,105,109,112,108,101,109,101, + 110,116,97,116,105,111,110,32,111,102,32,73,110,115,112,101, + 99,116,76,111,97,100,101,114,46,103,101,116,95,115,111,117, + 114,99,101,46,122,39,115,111,117,114,99,101,32,110,111,116, + 32,97,118,97,105,108,97,98,108,101,32,116,104,114,111,117, + 103,104,32,103,101,116,95,100,97,116,97,40,41,114,116,0, + 0,0,78,41,5,114,179,0,0,0,218,8,103,101,116,95, + 100,97,116,97,114,50,0,0,0,114,118,0,0,0,114,176, + 0,0,0,41,5,114,119,0,0,0,114,139,0,0,0,114, + 44,0,0,0,114,174,0,0,0,218,3,101,120,99,114,3, + 0,0,0,114,3,0,0,0,114,6,0,0,0,218,10,103, + 101,116,95,115,111,117,114,99,101,57,3,0,0,115,20,0, + 0,0,0,2,10,1,2,1,14,1,16,1,4,1,2,255, + 4,1,2,255,20,2,122,23,83,111,117,114,99,101,76,111, + 97,100,101,114,46,103,101,116,95,115,111,117,114,99,101,114, + 105,0,0,0,41,1,218,9,95,111,112,116,105,109,105,122, + 101,99,3,0,0,0,1,0,0,0,4,0,0,0,8,0, + 0,0,67,0,0,0,115,22,0,0,0,116,0,106,1,116, + 2,124,1,124,2,100,1,100,2,124,3,100,3,141,6,83, + 0,41,4,122,130,82,101,116,117,114,110,32,116,104,101,32, + 99,111,100,101,32,111,98,106,101,99,116,32,99,111,109,112, + 105,108,101,100,32,102,114,111,109,32,115,111,117,114,99,101, + 46,10,10,32,32,32,32,32,32,32,32,84,104,101,32,39, + 100,97,116,97,39,32,97,114,103,117,109,101,110,116,32,99, + 97,110,32,98,101,32,97,110,121,32,111,98,106,101,99,116, + 32,116,121,112,101,32,116,104,97,116,32,99,111,109,112,105, + 108,101,40,41,32,115,117,112,112,111,114,116,115,46,10,32, + 32,32,32,32,32,32,32,114,215,0,0,0,84,41,2,218, + 12,100,111,110,116,95,105,110,104,101,114,105,116,114,84,0, + 0,0,41,3,114,134,0,0,0,114,214,0,0,0,218,7, + 99,111,109,112,105,108,101,41,4,114,119,0,0,0,114,26, + 0,0,0,114,44,0,0,0,114,230,0,0,0,114,3,0, + 0,0,114,3,0,0,0,114,6,0,0,0,218,14,115,111, + 117,114,99,101,95,116,111,95,99,111,100,101,67,3,0,0, + 115,8,0,0,0,0,5,12,1,2,0,2,255,122,27,83, + 111,117,114,99,101,76,111,97,100,101,114,46,115,111,117,114, + 99,101,95,116,111,95,99,111,100,101,99,2,0,0,0,0, + 0,0,0,15,0,0,0,9,0,0,0,67,0,0,0,115, + 34,2,0,0,124,0,160,0,124,1,161,1,125,2,100,1, + 125,3,100,1,125,4,100,1,125,5,100,2,125,6,100,3, + 125,7,122,12,116,1,124,2,131,1,125,8,87,0,110,26, + 4,0,116,2,107,10,114,68,1,0,1,0,1,0,100,1, + 125,8,89,0,144,1,110,48,88,0,122,14,124,0,160,3, + 124,2,161,1,125,9,87,0,110,22,4,0,116,4,107,10, + 114,106,1,0,1,0,1,0,89,0,144,1,110,10,88,0, + 116,5,124,9,100,4,25,0,131,1,125,3,122,14,124,0, + 160,6,124,8,161,1,125,10,87,0,110,20,4,0,116,4, + 107,10,114,154,1,0,1,0,1,0,89,0,110,218,88,0, + 124,1,124,8,100,5,156,2,125,11,122,148,116,7,124,10, + 124,1,124,11,131,3,125,12,116,8,124,10,131,1,100,6, + 100,1,133,2,25,0,125,13,124,12,100,7,64,0,100,8, + 107,3,125,6,124,6,144,1,114,36,124,12,100,9,64,0, + 100,8,107,3,125,7,116,9,106,10,100,10,107,3,144,1, + 114,34,124,7,115,254,116,9,106,10,100,11,107,2,144,1, + 114,34,124,0,160,6,124,2,161,1,125,4,116,9,160,11, + 116,12,124,4,161,2,125,5,116,13,124,10,124,5,124,1, + 124,11,131,4,1,0,110,20,116,14,124,10,124,3,124,9, + 100,12,25,0,124,1,124,11,131,5,1,0,87,0,110,26, + 4,0,116,15,116,16,102,2,107,10,144,1,114,84,1,0, + 1,0,1,0,89,0,110,32,88,0,116,17,160,18,100,13, + 124,8,124,2,161,3,1,0,116,19,124,13,124,1,124,8, + 124,2,100,14,141,4,83,0,124,4,100,1,107,8,144,1, + 114,136,124,0,160,6,124,2,161,1,125,4,124,0,160,20, + 124,4,124,2,161,2,125,14,116,17,160,18,100,15,124,2, + 161,2,1,0,116,21,106,22,144,2,115,30,124,8,100,1, + 107,9,144,2,114,30,124,3,100,1,107,9,144,2,114,30, + 124,6,144,1,114,228,124,5,100,1,107,8,144,1,114,214, + 116,9,160,11,124,4,161,1,125,5,116,23,124,14,124,5, + 124,7,131,3,125,10,110,16,116,24,124,14,124,3,116,25, + 124,4,131,1,131,3,125,10,122,18,124,0,160,26,124,2, + 124,8,124,10,161,3,1,0,87,0,110,22,4,0,116,2, + 107,10,144,2,114,28,1,0,1,0,1,0,89,0,110,2, + 88,0,124,14,83,0,41,16,122,190,67,111,110,99,114,101, + 116,101,32,105,109,112,108,101,109,101,110,116,97,116,105,111, + 110,32,111,102,32,73,110,115,112,101,99,116,76,111,97,100, + 101,114,46,103,101,116,95,99,111,100,101,46,10,10,32,32, + 32,32,32,32,32,32,82,101,97,100,105,110,103,32,111,102, + 32,98,121,116,101,99,111,100,101,32,114,101,113,117,105,114, + 101,115,32,112,97,116,104,95,115,116,97,116,115,32,116,111, + 32,98,101,32,105,109,112,108,101,109,101,110,116,101,100,46, + 32,84,111,32,119,114,105,116,101,10,32,32,32,32,32,32, + 32,32,98,121,116,101,99,111,100,101,44,32,115,101,116,95, + 100,97,116,97,32,109,117,115,116,32,97,108,115,111,32,98, + 101,32,105,109,112,108,101,109,101,110,116,101,100,46,10,10, + 32,32,32,32,32,32,32,32,78,70,84,114,169,0,0,0, + 114,159,0,0,0,114,145,0,0,0,114,39,0,0,0,114, + 73,0,0,0,114,28,0,0,0,90,5,110,101,118,101,114, + 90,6,97,108,119,97,121,115,218,4,115,105,122,101,122,13, + 123,125,32,109,97,116,99,104,101,115,32,123,125,41,3,114, + 117,0,0,0,114,107,0,0,0,114,108,0,0,0,122,19, + 99,111,100,101,32,111,98,106,101,99,116,32,102,114,111,109, + 32,123,125,41,27,114,179,0,0,0,114,98,0,0,0,114, + 82,0,0,0,114,224,0,0,0,114,50,0,0,0,114,17, + 0,0,0,114,227,0,0,0,114,152,0,0,0,218,10,109, + 101,109,111,114,121,118,105,101,119,114,163,0,0,0,90,21, + 99,104,101,99,107,95,104,97,115,104,95,98,97,115,101,100, + 95,112,121,99,115,114,157,0,0,0,218,17,95,82,65,87, + 95,77,65,71,73,67,95,78,85,77,66,69,82,114,158,0, + 0,0,114,156,0,0,0,114,118,0,0,0,114,150,0,0, + 0,114,134,0,0,0,114,149,0,0,0,114,165,0,0,0, + 114,233,0,0,0,114,8,0,0,0,218,19,100,111,110,116, + 95,119,114,105,116,101,95,98,121,116,101,99,111,100,101,114, + 171,0,0,0,114,170,0,0,0,114,22,0,0,0,114,226, + 0,0,0,41,15,114,119,0,0,0,114,139,0,0,0,114, + 108,0,0,0,114,154,0,0,0,114,174,0,0,0,114,157, + 0,0,0,90,10,104,97,115,104,95,98,97,115,101,100,90, + 12,99,104,101,99,107,95,115,111,117,114,99,101,114,107,0, + 0,0,218,2,115,116,114,26,0,0,0,114,151,0,0,0, + 114,83,0,0,0,90,10,98,121,116,101,115,95,100,97,116, + 97,90,11,99,111,100,101,95,111,98,106,101,99,116,114,3, + 0,0,0,114,3,0,0,0,114,6,0,0,0,114,213,0, + 0,0,75,3,0,0,115,152,0,0,0,0,7,10,1,4, + 1,4,1,4,1,4,1,4,1,2,1,12,1,14,1,12, + 2,2,1,14,1,14,1,8,2,12,1,2,1,14,1,14, + 1,6,3,2,1,2,254,6,4,2,1,12,1,16,1,12, + 1,6,1,12,1,12,1,2,255,2,2,8,254,4,3,10, + 1,4,1,2,1,2,254,4,4,8,1,2,255,6,3,2, + 1,2,1,2,1,6,1,2,1,2,251,8,7,20,1,6, + 2,8,1,2,255,4,2,6,1,2,1,2,254,6,3,10, + 1,10,1,12,1,12,1,18,1,6,255,4,2,6,1,10, + 1,10,1,14,2,6,1,6,255,4,2,2,1,18,1,16, + 1,6,1,122,21,83,111,117,114,99,101,76,111,97,100,101, + 114,46,103,101,116,95,99,111,100,101,78,41,10,114,125,0, + 0,0,114,124,0,0,0,114,126,0,0,0,114,223,0,0, + 0,114,224,0,0,0,114,226,0,0,0,114,225,0,0,0, + 114,229,0,0,0,114,233,0,0,0,114,213,0,0,0,114, + 3,0,0,0,114,3,0,0,0,114,3,0,0,0,114,6, + 0,0,0,114,221,0,0,0,16,3,0,0,115,14,0,0, + 0,8,2,8,8,8,14,8,10,8,7,8,10,14,8,114, + 221,0,0,0,99,0,0,0,0,0,0,0,0,0,0,0, + 0,4,0,0,0,0,0,0,0,115,124,0,0,0,101,0, + 90,1,100,0,90,2,100,1,90,3,100,2,100,3,132,0, + 90,4,100,4,100,5,132,0,90,5,100,6,100,7,132,0, + 90,6,101,7,135,0,102,1,100,8,100,9,132,8,131,1, + 90,8,101,7,100,10,100,11,132,0,131,1,90,9,100,12, + 100,13,132,0,90,10,101,7,100,14,100,15,132,0,131,1, + 90,11,100,16,100,17,132,0,90,12,100,18,100,19,132,0, + 90,13,100,20,100,21,132,0,90,14,100,22,100,23,132,0, + 90,15,135,0,4,0,90,16,83,0,41,24,218,10,70,105, + 108,101,76,111,97,100,101,114,122,103,66,97,115,101,32,102, + 105,108,101,32,108,111,97,100,101,114,32,99,108,97,115,115, + 32,119,104,105,99,104,32,105,109,112,108,101,109,101,110,116, + 115,32,116,104,101,32,108,111,97,100,101,114,32,112,114,111, + 116,111,99,111,108,32,109,101,116,104,111,100,115,32,116,104, + 97,116,10,32,32,32,32,114,101,113,117,105,114,101,32,102, + 105,108,101,32,115,121,115,116,101,109,32,117,115,97,103,101, + 46,99,3,0,0,0,0,0,0,0,3,0,0,0,2,0, + 0,0,67,0,0,0,115,16,0,0,0,124,1,124,0,95, + 0,124,2,124,0,95,1,100,1,83,0,41,2,122,75,67, + 97,99,104,101,32,116,104,101,32,109,111,100,117,108,101,32, + 110,97,109,101,32,97,110,100,32,116,104,101,32,112,97,116, + 104,32,116,111,32,116,104,101,32,102,105,108,101,32,102,111, + 117,110,100,32,98,121,32,116,104,101,10,32,32,32,32,32, + 32,32,32,102,105,110,100,101,114,46,78,114,159,0,0,0, + 41,3,114,119,0,0,0,114,139,0,0,0,114,44,0,0, + 0,114,3,0,0,0,114,3,0,0,0,114,6,0,0,0, + 114,209,0,0,0,165,3,0,0,115,4,0,0,0,0,3, + 6,1,122,19,70,105,108,101,76,111,97,100,101,114,46,95, + 95,105,110,105,116,95,95,99,2,0,0,0,0,0,0,0, + 2,0,0,0,2,0,0,0,67,0,0,0,115,24,0,0, + 0,124,0,106,0,124,1,106,0,107,2,111,22,124,0,106, + 1,124,1,106,1,107,2,83,0,114,110,0,0,0,169,2, + 218,9,95,95,99,108,97,115,115,95,95,114,131,0,0,0, + 169,2,114,119,0,0,0,90,5,111,116,104,101,114,114,3, + 0,0,0,114,3,0,0,0,114,6,0,0,0,218,6,95, + 95,101,113,95,95,171,3,0,0,115,6,0,0,0,0,1, + 12,1,10,255,122,17,70,105,108,101,76,111,97,100,101,114, + 46,95,95,101,113,95,95,99,1,0,0,0,0,0,0,0, + 1,0,0,0,3,0,0,0,67,0,0,0,115,20,0,0, + 0,116,0,124,0,106,1,131,1,116,0,124,0,106,2,131, + 1,65,0,83,0,114,110,0,0,0,169,3,218,4,104,97, + 115,104,114,117,0,0,0,114,44,0,0,0,169,1,114,119, + 0,0,0,114,3,0,0,0,114,3,0,0,0,114,6,0, + 0,0,218,8,95,95,104,97,115,104,95,95,175,3,0,0, + 115,2,0,0,0,0,1,122,19,70,105,108,101,76,111,97, + 100,101,114,46,95,95,104,97,115,104,95,95,99,2,0,0, + 0,0,0,0,0,2,0,0,0,3,0,0,0,3,0,0, + 0,115,16,0,0,0,116,0,116,1,124,0,131,2,160,2, + 124,1,161,1,83,0,41,1,122,100,76,111,97,100,32,97, + 32,109,111,100,117,108,101,32,102,114,111,109,32,97,32,102, + 105,108,101,46,10,10,32,32,32,32,32,32,32,32,84,104, + 105,115,32,109,101,116,104,111,100,32,105,115,32,100,101,112, + 114,101,99,97,116,101,100,46,32,32,85,115,101,32,101,120, + 101,99,95,109,111,100,117,108,101,40,41,32,105,110,115,116, + 101,97,100,46,10,10,32,32,32,32,32,32,32,32,41,3, + 218,5,115,117,112,101,114,114,239,0,0,0,114,220,0,0, + 0,114,219,0,0,0,169,1,114,241,0,0,0,114,3,0, + 0,0,114,6,0,0,0,114,220,0,0,0,178,3,0,0, + 115,2,0,0,0,0,10,122,22,70,105,108,101,76,111,97, + 100,101,114,46,108,111,97,100,95,109,111,100,117,108,101,99, + 2,0,0,0,0,0,0,0,2,0,0,0,1,0,0,0, + 67,0,0,0,115,6,0,0,0,124,0,106,0,83,0,169, + 1,122,58,82,101,116,117,114,110,32,116,104,101,32,112,97, + 116,104,32,116,111,32,116,104,101,32,115,111,117,114,99,101, + 32,102,105,108,101,32,97,115,32,102,111,117,110,100,32,98, + 121,32,116,104,101,32,102,105,110,100,101,114,46,114,48,0, + 0,0,114,219,0,0,0,114,3,0,0,0,114,3,0,0, + 0,114,6,0,0,0,114,179,0,0,0,190,3,0,0,115, + 2,0,0,0,0,3,122,23,70,105,108,101,76,111,97,100, + 101,114,46,103,101,116,95,102,105,108,101,110,97,109,101,99, + 2,0,0,0,0,0,0,0,3,0,0,0,10,0,0,0, + 67,0,0,0,115,44,0,0,0,116,0,160,1,124,1,100, + 1,161,2,143,22,125,2,124,2,160,2,161,0,87,0,2, + 0,53,0,81,0,82,0,163,0,83,0,81,0,82,0,88, + 0,100,2,83,0,41,3,122,39,82,101,116,117,114,110,32, + 116,104,101,32,100,97,116,97,32,102,114,111,109,32,112,97, + 116,104,32,97,115,32,114,97,119,32,98,121,116,101,115,46, + 218,1,114,78,41,3,114,64,0,0,0,114,65,0,0,0, + 90,4,114,101,97,100,41,3,114,119,0,0,0,114,44,0, + 0,0,114,68,0,0,0,114,3,0,0,0,114,3,0,0, + 0,114,6,0,0,0,114,227,0,0,0,195,3,0,0,115, + 4,0,0,0,0,2,14,1,122,19,70,105,108,101,76,111, + 97,100,101,114,46,103,101,116,95,100,97,116,97,99,2,0, + 0,0,0,0,0,0,2,0,0,0,3,0,0,0,67,0, + 0,0,115,18,0,0,0,124,0,160,0,124,1,161,1,114, + 14,124,0,83,0,100,0,83,0,114,110,0,0,0,41,1, + 114,182,0,0,0,169,2,114,119,0,0,0,114,216,0,0, + 0,114,3,0,0,0,114,3,0,0,0,114,6,0,0,0, + 218,19,103,101,116,95,114,101,115,111,117,114,99,101,95,114, + 101,97,100,101,114,202,3,0,0,115,6,0,0,0,0,2, + 10,1,4,1,122,30,70,105,108,101,76,111,97,100,101,114, + 46,103,101,116,95,114,101,115,111,117,114,99,101,95,114,101, + 97,100,101,114,99,2,0,0,0,0,0,0,0,3,0,0, + 0,4,0,0,0,67,0,0,0,115,32,0,0,0,116,0, + 116,1,124,0,106,2,131,1,100,1,25,0,124,1,131,2, + 125,2,116,3,160,4,124,2,100,2,161,2,83,0,41,3, + 78,114,73,0,0,0,114,251,0,0,0,41,5,114,38,0, + 0,0,114,47,0,0,0,114,44,0,0,0,114,64,0,0, + 0,114,65,0,0,0,169,3,114,119,0,0,0,90,8,114, + 101,115,111,117,114,99,101,114,44,0,0,0,114,3,0,0, + 0,114,3,0,0,0,114,6,0,0,0,218,13,111,112,101, + 110,95,114,101,115,111,117,114,99,101,208,3,0,0,115,4, + 0,0,0,0,1,20,1,122,24,70,105,108,101,76,111,97, + 100,101,114,46,111,112,101,110,95,114,101,115,111,117,114,99, + 101,99,2,0,0,0,0,0,0,0,3,0,0,0,3,0, + 0,0,67,0,0,0,115,38,0,0,0,124,0,160,0,124, + 1,161,1,115,14,116,1,130,1,116,2,116,3,124,0,106, + 4,131,1,100,1,25,0,124,1,131,2,125,2,124,2,83, + 0,169,2,78,114,73,0,0,0,41,5,218,11,105,115,95, + 114,101,115,111,117,114,99,101,218,17,70,105,108,101,78,111, + 116,70,111,117,110,100,69,114,114,111,114,114,38,0,0,0, + 114,47,0,0,0,114,44,0,0,0,114,254,0,0,0,114, + 3,0,0,0,114,3,0,0,0,114,6,0,0,0,218,13, + 114,101,115,111,117,114,99,101,95,112,97,116,104,212,3,0, + 0,115,8,0,0,0,0,1,10,1,4,1,20,1,122,24, + 70,105,108,101,76,111,97,100,101,114,46,114,101,115,111,117, + 114,99,101,95,112,97,116,104,99,2,0,0,0,0,0,0, + 0,3,0,0,0,3,0,0,0,67,0,0,0,115,40,0, + 0,0,116,0,124,1,107,6,114,12,100,1,83,0,116,1, + 116,2,124,0,106,3,131,1,100,2,25,0,124,1,131,2, + 125,2,116,4,124,2,131,1,83,0,41,3,78,70,114,73, + 0,0,0,41,5,114,35,0,0,0,114,38,0,0,0,114, + 47,0,0,0,114,44,0,0,0,114,54,0,0,0,169,3, + 114,119,0,0,0,114,117,0,0,0,114,44,0,0,0,114, + 3,0,0,0,114,3,0,0,0,114,6,0,0,0,114,1, + 1,0,0,218,3,0,0,115,8,0,0,0,0,1,8,1, + 4,1,20,1,122,22,70,105,108,101,76,111,97,100,101,114, + 46,105,115,95,114,101,115,111,117,114,99,101,99,1,0,0, + 0,0,0,0,0,1,0,0,0,5,0,0,0,67,0,0, + 0,115,24,0,0,0,116,0,116,1,160,2,116,3,124,0, + 106,4,131,1,100,1,25,0,161,1,131,1,83,0,114,0, + 1,0,0,41,5,218,4,105,116,101,114,114,2,0,0,0, + 218,7,108,105,115,116,100,105,114,114,47,0,0,0,114,44, + 0,0,0,114,246,0,0,0,114,3,0,0,0,114,3,0, + 0,0,114,6,0,0,0,218,8,99,111,110,116,101,110,116, + 115,224,3,0,0,115,2,0,0,0,0,1,122,19,70,105, + 108,101,76,111,97,100,101,114,46,99,111,110,116,101,110,116, + 115,41,17,114,125,0,0,0,114,124,0,0,0,114,126,0, + 0,0,114,127,0,0,0,114,209,0,0,0,114,243,0,0, + 0,114,247,0,0,0,114,136,0,0,0,114,220,0,0,0, + 114,179,0,0,0,114,227,0,0,0,114,253,0,0,0,114, + 255,0,0,0,114,3,1,0,0,114,1,1,0,0,114,7, + 1,0,0,90,13,95,95,99,108,97,115,115,99,101,108,108, + 95,95,114,3,0,0,0,114,3,0,0,0,114,249,0,0, + 0,114,6,0,0,0,114,239,0,0,0,160,3,0,0,115, + 30,0,0,0,8,3,4,2,8,6,8,4,8,3,2,1, + 14,11,2,1,10,4,8,7,2,1,10,5,8,4,8,6, + 8,6,114,239,0,0,0,99,0,0,0,0,0,0,0,0, + 0,0,0,0,3,0,0,0,64,0,0,0,115,46,0,0, + 0,101,0,90,1,100,0,90,2,100,1,90,3,100,2,100, + 3,132,0,90,4,100,4,100,5,132,0,90,5,100,6,100, + 7,156,1,100,8,100,9,132,2,90,6,100,10,83,0,41, + 11,218,16,83,111,117,114,99,101,70,105,108,101,76,111,97, + 100,101,114,122,62,67,111,110,99,114,101,116,101,32,105,109, + 112,108,101,109,101,110,116,97,116,105,111,110,32,111,102,32, + 83,111,117,114,99,101,76,111,97,100,101,114,32,117,115,105, + 110,103,32,116,104,101,32,102,105,108,101,32,115,121,115,116, + 101,109,46,99,2,0,0,0,0,0,0,0,3,0,0,0, + 3,0,0,0,67,0,0,0,115,22,0,0,0,116,0,124, + 1,131,1,125,2,124,2,106,1,124,2,106,2,100,1,156, + 2,83,0,41,2,122,33,82,101,116,117,114,110,32,116,104, + 101,32,109,101,116,97,100,97,116,97,32,102,111,114,32,116, + 104,101,32,112,97,116,104,46,41,2,114,169,0,0,0,114, + 234,0,0,0,41,3,114,49,0,0,0,218,8,115,116,95, + 109,116,105,109,101,90,7,115,116,95,115,105,122,101,41,3, + 114,119,0,0,0,114,44,0,0,0,114,238,0,0,0,114, + 3,0,0,0,114,3,0,0,0,114,6,0,0,0,114,224, + 0,0,0,232,3,0,0,115,4,0,0,0,0,2,8,1, + 122,27,83,111,117,114,99,101,70,105,108,101,76,111,97,100, + 101,114,46,112,97,116,104,95,115,116,97,116,115,99,4,0, + 0,0,0,0,0,0,5,0,0,0,5,0,0,0,67,0, + 0,0,115,24,0,0,0,116,0,124,1,131,1,125,4,124, + 0,106,1,124,2,124,3,124,4,100,1,141,3,83,0,41, + 2,78,169,1,218,5,95,109,111,100,101,41,2,114,115,0, + 0,0,114,225,0,0,0,41,5,114,119,0,0,0,114,108, + 0,0,0,114,107,0,0,0,114,26,0,0,0,114,52,0, + 0,0,114,3,0,0,0,114,3,0,0,0,114,6,0,0, + 0,114,226,0,0,0,237,3,0,0,115,4,0,0,0,0, + 2,8,1,122,32,83,111,117,114,99,101,70,105,108,101,76, + 111,97,100,101,114,46,95,99,97,99,104,101,95,98,121,116, + 101,99,111,100,101,114,60,0,0,0,114,10,1,0,0,99, + 3,0,0,0,1,0,0,0,9,0,0,0,11,0,0,0, + 67,0,0,0,115,0,1,0,0,116,0,124,1,131,1,92, + 2,125,4,125,5,103,0,125,6,124,4,114,52,116,1,124, + 4,131,1,115,52,116,0,124,4,131,1,92,2,125,4,125, + 7,124,6,160,2,124,7,161,1,1,0,113,16,116,3,124, + 6,131,1,68,0,93,112,125,7,116,4,124,4,124,7,131, + 2,125,4,122,14,116,5,160,6,124,4,161,1,1,0,87, + 0,110,82,4,0,116,7,107,10,114,112,1,0,1,0,1, + 0,89,0,113,60,89,0,110,60,4,0,116,8,107,10,114, + 170,1,0,125,8,1,0,122,30,116,9,160,10,100,1,124, + 4,124,8,161,3,1,0,87,0,89,0,162,10,1,0,100, + 2,83,0,87,0,53,0,100,2,125,8,126,8,88,0,89, + 0,110,2,88,0,113,60,122,28,116,11,124,1,124,2,124, + 3,131,3,1,0,116,9,160,10,100,3,124,1,161,2,1, + 0,87,0,110,48,4,0,116,8,107,10,114,250,1,0,125, + 8,1,0,122,18,116,9,160,10,100,1,124,1,124,8,161, + 3,1,0,87,0,53,0,100,2,125,8,126,8,88,0,89, + 0,110,2,88,0,100,2,83,0,41,4,122,27,87,114,105, + 116,101,32,98,121,116,101,115,32,100,97,116,97,32,116,111, + 32,97,32,102,105,108,101,46,122,27,99,111,117,108,100,32, + 110,111,116,32,99,114,101,97,116,101,32,123,33,114,125,58, + 32,123,33,114,125,78,122,12,99,114,101,97,116,101,100,32, + 123,33,114,125,41,12,114,47,0,0,0,114,56,0,0,0, + 114,186,0,0,0,114,42,0,0,0,114,38,0,0,0,114, + 2,0,0,0,90,5,109,107,100,105,114,218,15,70,105,108, + 101,69,120,105,115,116,115,69,114,114,111,114,114,50,0,0, + 0,114,134,0,0,0,114,149,0,0,0,114,69,0,0,0, + 41,9,114,119,0,0,0,114,44,0,0,0,114,26,0,0, + 0,114,11,1,0,0,218,6,112,97,114,101,110,116,114,97, + 0,0,0,114,37,0,0,0,114,33,0,0,0,114,228,0, + 0,0,114,3,0,0,0,114,3,0,0,0,114,6,0,0, + 0,114,225,0,0,0,242,3,0,0,115,48,0,0,0,0, + 2,12,1,4,2,12,1,12,1,12,2,12,1,10,1,2, + 1,14,1,14,2,8,1,16,3,6,1,2,0,2,255,4, + 2,32,1,2,1,12,1,16,1,16,2,8,1,2,255,122, + 25,83,111,117,114,99,101,70,105,108,101,76,111,97,100,101, + 114,46,115,101,116,95,100,97,116,97,78,41,7,114,125,0, + 0,0,114,124,0,0,0,114,126,0,0,0,114,127,0,0, + 0,114,224,0,0,0,114,226,0,0,0,114,225,0,0,0, + 114,3,0,0,0,114,3,0,0,0,114,3,0,0,0,114, + 6,0,0,0,114,8,1,0,0,228,3,0,0,115,8,0, + 0,0,8,2,4,2,8,5,8,5,114,8,1,0,0,99, + 0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0, + 64,0,0,0,115,32,0,0,0,101,0,90,1,100,0,90, + 2,100,1,90,3,100,2,100,3,132,0,90,4,100,4,100, + 5,132,0,90,5,100,6,83,0,41,7,218,20,83,111,117, + 114,99,101,108,101,115,115,70,105,108,101,76,111,97,100,101, + 114,122,45,76,111,97,100,101,114,32,119,104,105,99,104,32, + 104,97,110,100,108,101,115,32,115,111,117,114,99,101,108,101, + 115,115,32,102,105,108,101,32,105,109,112,111,114,116,115,46, + 99,2,0,0,0,0,0,0,0,5,0,0,0,5,0,0, + 0,67,0,0,0,115,68,0,0,0,124,0,160,0,124,1, + 161,1,125,2,124,0,160,1,124,2,161,1,125,3,124,1, + 124,2,100,1,156,2,125,4,116,2,124,3,124,1,124,4, + 131,3,1,0,116,3,116,4,124,3,131,1,100,2,100,0, + 133,2,25,0,124,1,124,2,100,3,141,3,83,0,41,4, + 78,114,159,0,0,0,114,145,0,0,0,41,2,114,117,0, + 0,0,114,107,0,0,0,41,5,114,179,0,0,0,114,227, + 0,0,0,114,152,0,0,0,114,165,0,0,0,114,235,0, + 0,0,41,5,114,119,0,0,0,114,139,0,0,0,114,44, + 0,0,0,114,26,0,0,0,114,151,0,0,0,114,3,0, + 0,0,114,3,0,0,0,114,6,0,0,0,114,213,0,0, + 0,21,4,0,0,115,22,0,0,0,0,1,10,1,10,4, + 2,1,2,254,6,4,12,1,2,1,14,1,2,1,2,253, + 122,29,83,111,117,114,99,101,108,101,115,115,70,105,108,101, + 76,111,97,100,101,114,46,103,101,116,95,99,111,100,101,99, 2,0,0,0,0,0,0,0,2,0,0,0,1,0,0,0, 67,0,0,0,115,4,0,0,0,100,1,83,0,41,2,122, - 42,85,115,101,32,100,101,102,97,117,108,116,32,115,101,109, - 97,110,116,105,99,115,32,102,111,114,32,109,111,100,117,108, - 101,32,99,114,101,97,116,105,111,110,46,78,114,2,0,0, - 0,41,2,114,108,0,0,0,114,171,0,0,0,114,2,0, - 0,0,114,2,0,0,0,114,4,0,0,0,218,13,99,114, - 101,97,116,101,95,109,111,100,117,108,101,0,3,0,0,115, - 2,0,0,0,0,1,122,27,95,76,111,97,100,101,114,66, - 97,115,105,99,115,46,99,114,101,97,116,101,95,109,111,100, - 117,108,101,99,2,0,0,0,0,0,0,0,3,0,0,0, - 5,0,0,0,67,0,0,0,115,56,0,0,0,124,0,160, - 0,124,1,106,1,161,1,125,2,124,2,100,1,107,8,114, - 36,116,2,100,2,160,3,124,1,106,1,161,1,131,1,130, - 1,116,4,160,5,116,6,124,2,124,1,106,7,161,3,1, - 0,100,1,83,0,41,3,122,19,69,120,101,99,117,116,101, - 32,116,104,101,32,109,111,100,117,108,101,46,78,122,52,99, - 97,110,110,111,116,32,108,111,97,100,32,109,111,100,117,108, - 101,32,123,33,114,125,32,119,104,101,110,32,103,101,116,95, - 99,111,100,101,40,41,32,114,101,116,117,114,110,115,32,78, - 111,110,101,41,8,218,8,103,101,116,95,99,111,100,101,114, - 113,0,0,0,114,107,0,0,0,114,54,0,0,0,114,122, - 0,0,0,218,25,95,99,97,108,108,95,119,105,116,104,95, - 102,114,97,109,101,115,95,114,101,109,111,118,101,100,218,4, - 101,120,101,99,114,119,0,0,0,41,3,114,108,0,0,0, - 218,6,109,111,100,117,108,101,114,150,0,0,0,114,2,0, - 0,0,114,2,0,0,0,114,4,0,0,0,218,11,101,120, - 101,99,95,109,111,100,117,108,101,3,3,0,0,115,12,0, - 0,0,0,2,12,1,8,1,6,1,4,255,6,2,122,25, - 95,76,111,97,100,101,114,66,97,115,105,99,115,46,101,120, - 101,99,95,109,111,100,117,108,101,99,2,0,0,0,0,0, - 0,0,2,0,0,0,4,0,0,0,67,0,0,0,115,12, - 0,0,0,116,0,160,1,124,0,124,1,161,2,83,0,41, - 1,122,26,84,104,105,115,32,109,111,100,117,108,101,32,105, - 115,32,100,101,112,114,101,99,97,116,101,100,46,41,2,114, - 122,0,0,0,218,17,95,108,111,97,100,95,109,111,100,117, - 108,101,95,115,104,105,109,41,2,114,108,0,0,0,114,127, - 0,0,0,114,2,0,0,0,114,2,0,0,0,114,4,0, - 0,0,218,11,108,111,97,100,95,109,111,100,117,108,101,11, - 3,0,0,115,2,0,0,0,0,2,122,25,95,76,111,97, - 100,101,114,66,97,115,105,99,115,46,108,111,97,100,95,109, - 111,100,117,108,101,78,41,8,114,113,0,0,0,114,112,0, - 0,0,114,114,0,0,0,114,115,0,0,0,114,166,0,0, - 0,114,192,0,0,0,114,197,0,0,0,114,199,0,0,0, - 114,2,0,0,0,114,2,0,0,0,114,2,0,0,0,114, - 4,0,0,0,114,190,0,0,0,243,2,0,0,115,10,0, - 0,0,8,3,4,2,8,8,8,3,8,8,114,190,0,0, + 39,82,101,116,117,114,110,32,78,111,110,101,32,97,115,32, + 116,104,101,114,101,32,105,115,32,110,111,32,115,111,117,114, + 99,101,32,99,111,100,101,46,78,114,3,0,0,0,114,219, + 0,0,0,114,3,0,0,0,114,3,0,0,0,114,6,0, + 0,0,114,229,0,0,0,37,4,0,0,115,2,0,0,0, + 0,2,122,31,83,111,117,114,99,101,108,101,115,115,70,105, + 108,101,76,111,97,100,101,114,46,103,101,116,95,115,111,117, + 114,99,101,78,41,6,114,125,0,0,0,114,124,0,0,0, + 114,126,0,0,0,114,127,0,0,0,114,213,0,0,0,114, + 229,0,0,0,114,3,0,0,0,114,3,0,0,0,114,3, + 0,0,0,114,6,0,0,0,114,14,1,0,0,17,4,0, + 0,115,6,0,0,0,8,2,4,2,8,16,114,14,1,0, 0,99,0,0,0,0,0,0,0,0,0,0,0,0,3,0, - 0,0,64,0,0,0,115,74,0,0,0,101,0,90,1,100, - 0,90,2,100,1,100,2,132,0,90,3,100,3,100,4,132, - 0,90,4,100,5,100,6,132,0,90,5,100,7,100,8,132, - 0,90,6,100,9,100,10,132,0,90,7,100,11,100,12,156, - 1,100,13,100,14,132,2,90,8,100,15,100,16,132,0,90, - 9,100,17,83,0,41,18,218,12,83,111,117,114,99,101,76, - 111,97,100,101,114,99,2,0,0,0,0,0,0,0,2,0, - 0,0,1,0,0,0,67,0,0,0,115,8,0,0,0,116, - 0,130,1,100,1,83,0,41,2,122,165,79,112,116,105,111, - 110,97,108,32,109,101,116,104,111,100,32,116,104,97,116,32, - 114,101,116,117,114,110,115,32,116,104,101,32,109,111,100,105, - 102,105,99,97,116,105,111,110,32,116,105,109,101,32,40,97, - 110,32,105,110,116,41,32,102,111,114,32,116,104,101,10,32, - 32,32,32,32,32,32,32,115,112,101,99,105,102,105,101,100, - 32,112,97,116,104,32,40,97,32,115,116,114,41,46,10,10, - 32,32,32,32,32,32,32,32,82,97,105,115,101,115,32,79, - 83,69,114,114,111,114,32,119,104,101,110,32,116,104,101,32, - 112,97,116,104,32,99,97,110,110,111,116,32,98,101,32,104, - 97,110,100,108,101,100,46,10,32,32,32,32,32,32,32,32, - 78,41,1,114,44,0,0,0,41,2,114,108,0,0,0,114, - 39,0,0,0,114,2,0,0,0,114,2,0,0,0,114,4, - 0,0,0,218,10,112,97,116,104,95,109,116,105,109,101,18, - 3,0,0,115,2,0,0,0,0,6,122,23,83,111,117,114, - 99,101,76,111,97,100,101,114,46,112,97,116,104,95,109,116, - 105,109,101,99,2,0,0,0,0,0,0,0,2,0,0,0, - 4,0,0,0,67,0,0,0,115,14,0,0,0,100,1,124, - 0,160,0,124,1,161,1,105,1,83,0,41,2,97,158,1, - 0,0,79,112,116,105,111,110,97,108,32,109,101,116,104,111, - 100,32,114,101,116,117,114,110,105,110,103,32,97,32,109,101, - 116,97,100,97,116,97,32,100,105,99,116,32,102,111,114,32, - 116,104,101,32,115,112,101,99,105,102,105,101,100,10,32,32, - 32,32,32,32,32,32,112,97,116,104,32,40,97,32,115,116, - 114,41,46,10,10,32,32,32,32,32,32,32,32,80,111,115, - 115,105,98,108,101,32,107,101,121,115,58,10,32,32,32,32, - 32,32,32,32,45,32,39,109,116,105,109,101,39,32,40,109, - 97,110,100,97,116,111,114,121,41,32,105,115,32,116,104,101, - 32,110,117,109,101,114,105,99,32,116,105,109,101,115,116,97, - 109,112,32,111,102,32,108,97,115,116,32,115,111,117,114,99, - 101,10,32,32,32,32,32,32,32,32,32,32,99,111,100,101, - 32,109,111,100,105,102,105,99,97,116,105,111,110,59,10,32, - 32,32,32,32,32,32,32,45,32,39,115,105,122,101,39,32, - 40,111,112,116,105,111,110,97,108,41,32,105,115,32,116,104, - 101,32,115,105,122,101,32,105,110,32,98,121,116,101,115,32, - 111,102,32,116,104,101,32,115,111,117,114,99,101,32,99,111, - 100,101,46,10,10,32,32,32,32,32,32,32,32,73,109,112, - 108,101,109,101,110,116,105,110,103,32,116,104,105,115,32,109, - 101,116,104,111,100,32,97,108,108,111,119,115,32,116,104,101, - 32,108,111,97,100,101,114,32,116,111,32,114,101,97,100,32, - 98,121,116,101,99,111,100,101,32,102,105,108,101,115,46,10, - 32,32,32,32,32,32,32,32,82,97,105,115,101,115,32,79, - 83,69,114,114,111,114,32,119,104,101,110,32,116,104,101,32, - 112,97,116,104,32,99,97,110,110,111,116,32,98,101,32,104, - 97,110,100,108,101,100,46,10,32,32,32,32,32,32,32,32, - 114,155,0,0,0,41,1,114,201,0,0,0,41,2,114,108, - 0,0,0,114,39,0,0,0,114,2,0,0,0,114,2,0, - 0,0,114,4,0,0,0,218,10,112,97,116,104,95,115,116, - 97,116,115,26,3,0,0,115,2,0,0,0,0,12,122,23, - 83,111,117,114,99,101,76,111,97,100,101,114,46,112,97,116, - 104,95,115,116,97,116,115,99,4,0,0,0,0,0,0,0, - 4,0,0,0,4,0,0,0,67,0,0,0,115,12,0,0, - 0,124,0,160,0,124,2,124,3,161,2,83,0,41,1,122, - 228,79,112,116,105,111,110,97,108,32,109,101,116,104,111,100, - 32,119,104,105,99,104,32,119,114,105,116,101,115,32,100,97, - 116,97,32,40,98,121,116,101,115,41,32,116,111,32,97,32, - 102,105,108,101,32,112,97,116,104,32,40,97,32,115,116,114, - 41,46,10,10,32,32,32,32,32,32,32,32,73,109,112,108, - 101,109,101,110,116,105,110,103,32,116,104,105,115,32,109,101, - 116,104,111,100,32,97,108,108,111,119,115,32,102,111,114,32, - 116,104,101,32,119,114,105,116,105,110,103,32,111,102,32,98, - 121,116,101,99,111,100,101,32,102,105,108,101,115,46,10,10, - 32,32,32,32,32,32,32,32,84,104,101,32,115,111,117,114, - 99,101,32,112,97,116,104,32,105,115,32,110,101,101,100,101, - 100,32,105,110,32,111,114,100,101,114,32,116,111,32,99,111, - 114,114,101,99,116,108,121,32,116,114,97,110,115,102,101,114, - 32,112,101,114,109,105,115,115,105,111,110,115,10,32,32,32, - 32,32,32,32,32,41,1,218,8,115,101,116,95,100,97,116, - 97,41,4,114,108,0,0,0,114,99,0,0,0,90,10,99, - 97,99,104,101,95,112,97,116,104,114,21,0,0,0,114,2, - 0,0,0,114,2,0,0,0,114,4,0,0,0,218,15,95, - 99,97,99,104,101,95,98,121,116,101,99,111,100,101,40,3, - 0,0,115,2,0,0,0,0,8,122,28,83,111,117,114,99, - 101,76,111,97,100,101,114,46,95,99,97,99,104,101,95,98, - 121,116,101,99,111,100,101,99,3,0,0,0,0,0,0,0, - 3,0,0,0,1,0,0,0,67,0,0,0,115,4,0,0, - 0,100,1,83,0,41,2,122,150,79,112,116,105,111,110,97, - 108,32,109,101,116,104,111,100,32,119,104,105,99,104,32,119, - 114,105,116,101,115,32,100,97,116,97,32,40,98,121,116,101, - 115,41,32,116,111,32,97,32,102,105,108,101,32,112,97,116, - 104,32,40,97,32,115,116,114,41,46,10,10,32,32,32,32, - 32,32,32,32,73,109,112,108,101,109,101,110,116,105,110,103, - 32,116,104,105,115,32,109,101,116,104,111,100,32,97,108,108, - 111,119,115,32,102,111,114,32,116,104,101,32,119,114,105,116, - 105,110,103,32,111,102,32,98,121,116,101,99,111,100,101,32, - 102,105,108,101,115,46,10,32,32,32,32,32,32,32,32,78, - 114,2,0,0,0,41,3,114,108,0,0,0,114,39,0,0, - 0,114,21,0,0,0,114,2,0,0,0,114,2,0,0,0, - 114,4,0,0,0,114,203,0,0,0,50,3,0,0,115,2, - 0,0,0,0,4,122,21,83,111,117,114,99,101,76,111,97, - 100,101,114,46,115,101,116,95,100,97,116,97,99,2,0,0, - 0,0,0,0,0,5,0,0,0,10,0,0,0,67,0,0, - 0,115,82,0,0,0,124,0,160,0,124,1,161,1,125,2, - 122,14,124,0,160,1,124,2,161,1,125,3,87,0,110,48, - 4,0,116,2,107,10,114,72,1,0,125,4,1,0,122,18, - 116,3,100,1,124,1,100,2,141,2,124,4,130,2,87,0, - 53,0,100,3,125,4,126,4,88,0,89,0,110,2,88,0, - 116,4,124,3,131,1,83,0,41,4,122,52,67,111,110,99, - 114,101,116,101,32,105,109,112,108,101,109,101,110,116,97,116, - 105,111,110,32,111,102,32,73,110,115,112,101,99,116,76,111, - 97,100,101,114,46,103,101,116,95,115,111,117,114,99,101,46, - 122,39,115,111,117,114,99,101,32,110,111,116,32,97,118,97, - 105,108,97,98,108,101,32,116,104,114,111,117,103,104,32,103, - 101,116,95,100,97,116,97,40,41,41,1,114,106,0,0,0, - 78,41,5,114,164,0,0,0,218,8,103,101,116,95,100,97, - 116,97,114,44,0,0,0,114,107,0,0,0,114,162,0,0, - 0,41,5,114,108,0,0,0,114,127,0,0,0,114,39,0, - 0,0,114,160,0,0,0,218,3,101,120,99,114,2,0,0, - 0,114,2,0,0,0,114,4,0,0,0,218,10,103,101,116, - 95,115,111,117,114,99,101,57,3,0,0,115,20,0,0,0, - 0,2,10,1,2,1,14,1,16,1,4,1,2,255,4,1, - 2,255,20,2,122,23,83,111,117,114,99,101,76,111,97,100, - 101,114,46,103,101,116,95,115,111,117,114,99,101,114,96,0, - 0,0,41,1,218,9,95,111,112,116,105,109,105,122,101,99, - 3,0,0,0,1,0,0,0,4,0,0,0,8,0,0,0, - 67,0,0,0,115,22,0,0,0,116,0,106,1,116,2,124, - 1,124,2,100,1,100,2,124,3,100,3,141,6,83,0,41, - 4,122,130,82,101,116,117,114,110,32,116,104,101,32,99,111, - 100,101,32,111,98,106,101,99,116,32,99,111,109,112,105,108, - 101,100,32,102,114,111,109,32,115,111,117,114,99,101,46,10, - 10,32,32,32,32,32,32,32,32,84,104,101,32,39,100,97, - 116,97,39,32,97,114,103,117,109,101,110,116,32,99,97,110, - 32,98,101,32,97,110,121,32,111,98,106,101,99,116,32,116, - 121,112,101,32,116,104,97,116,32,99,111,109,112,105,108,101, - 40,41,32,115,117,112,112,111,114,116,115,46,10,32,32,32, - 32,32,32,32,32,114,195,0,0,0,84,41,2,218,12,100, - 111,110,116,95,105,110,104,101,114,105,116,114,75,0,0,0, - 41,3,114,122,0,0,0,114,194,0,0,0,218,7,99,111, - 109,112,105,108,101,41,4,114,108,0,0,0,114,21,0,0, - 0,114,39,0,0,0,114,208,0,0,0,114,2,0,0,0, - 114,2,0,0,0,114,4,0,0,0,218,14,115,111,117,114, - 99,101,95,116,111,95,99,111,100,101,67,3,0,0,115,8, - 0,0,0,0,5,12,1,2,0,2,255,122,27,83,111,117, - 114,99,101,76,111,97,100,101,114,46,115,111,117,114,99,101, - 95,116,111,95,99,111,100,101,99,2,0,0,0,0,0,0, - 0,15,0,0,0,9,0,0,0,67,0,0,0,115,34,2, - 0,0,124,0,160,0,124,1,161,1,125,2,100,1,125,3, - 100,1,125,4,100,1,125,5,100,2,125,6,100,3,125,7, - 122,12,116,1,124,2,131,1,125,8,87,0,110,26,4,0, - 116,2,107,10,114,68,1,0,1,0,1,0,100,1,125,8, - 89,0,144,1,110,48,88,0,122,14,124,0,160,3,124,2, - 161,1,125,9,87,0,110,22,4,0,116,4,107,10,114,106, - 1,0,1,0,1,0,89,0,144,1,110,10,88,0,116,5, - 124,9,100,4,25,0,131,1,125,3,122,14,124,0,160,6, - 124,8,161,1,125,10,87,0,110,20,4,0,116,4,107,10, - 114,154,1,0,1,0,1,0,89,0,110,218,88,0,124,1, - 124,8,100,5,156,2,125,11,122,148,116,7,124,10,124,1, - 124,11,131,3,125,12,116,8,124,10,131,1,100,6,100,1, - 133,2,25,0,125,13,124,12,100,7,64,0,100,8,107,3, - 125,6,124,6,144,1,114,36,124,12,100,9,64,0,100,8, - 107,3,125,7,116,9,106,10,100,10,107,3,144,1,114,34, - 124,7,115,254,116,9,106,10,100,11,107,2,144,1,114,34, - 124,0,160,6,124,2,161,1,125,4,116,9,160,11,116,12, - 124,4,161,2,125,5,116,13,124,10,124,5,124,1,124,11, - 131,4,1,0,110,20,116,14,124,10,124,3,124,9,100,12, - 25,0,124,1,124,11,131,5,1,0,87,0,110,26,4,0, - 116,15,116,16,102,2,107,10,144,1,114,84,1,0,1,0, - 1,0,89,0,110,32,88,0,116,17,160,18,100,13,124,8, - 124,2,161,3,1,0,116,19,124,13,124,1,124,8,124,2, - 100,14,141,4,83,0,124,4,100,1,107,8,144,1,114,136, - 124,0,160,6,124,2,161,1,125,4,124,0,160,20,124,4, - 124,2,161,2,125,14,116,17,160,18,100,15,124,2,161,2, - 1,0,116,21,106,22,144,2,115,30,124,8,100,1,107,9, - 144,2,114,30,124,3,100,1,107,9,144,2,114,30,124,6, - 144,1,114,228,124,5,100,1,107,8,144,1,114,214,116,9, - 160,11,124,4,161,1,125,5,116,23,124,14,124,5,124,7, - 131,3,125,10,110,16,116,24,124,14,124,3,116,25,124,4, - 131,1,131,3,125,10,122,18,124,0,160,26,124,2,124,8, - 124,10,161,3,1,0,87,0,110,22,4,0,116,2,107,10, - 144,2,114,28,1,0,1,0,1,0,89,0,110,2,88,0, - 124,14,83,0,41,16,122,190,67,111,110,99,114,101,116,101, - 32,105,109,112,108,101,109,101,110,116,97,116,105,111,110,32, - 111,102,32,73,110,115,112,101,99,116,76,111,97,100,101,114, - 46,103,101,116,95,99,111,100,101,46,10,10,32,32,32,32, - 32,32,32,32,82,101,97,100,105,110,103,32,111,102,32,98, - 121,116,101,99,111,100,101,32,114,101,113,117,105,114,101,115, - 32,112,97,116,104,95,115,116,97,116,115,32,116,111,32,98, - 101,32,105,109,112,108,101,109,101,110,116,101,100,46,32,84, - 111,32,119,114,105,116,101,10,32,32,32,32,32,32,32,32, - 98,121,116,101,99,111,100,101,44,32,115,101,116,95,100,97, - 116,97,32,109,117,115,116,32,97,108,115,111,32,98,101,32, - 105,109,112,108,101,109,101,110,116,101,100,46,10,10,32,32, - 32,32,32,32,32,32,78,70,84,114,155,0,0,0,41,2, - 114,106,0,0,0,114,39,0,0,0,114,132,0,0,0,114, - 34,0,0,0,114,64,0,0,0,114,23,0,0,0,90,5, - 110,101,118,101,114,90,6,97,108,119,97,121,115,218,4,115, - 105,122,101,122,13,123,125,32,109,97,116,99,104,101,115,32, - 123,125,41,3,114,106,0,0,0,114,98,0,0,0,114,99, - 0,0,0,122,19,99,111,100,101,32,111,98,106,101,99,116, - 32,102,114,111,109,32,123,125,41,27,114,164,0,0,0,114, - 89,0,0,0,114,73,0,0,0,114,202,0,0,0,114,44, - 0,0,0,114,14,0,0,0,114,205,0,0,0,114,139,0, - 0,0,218,10,109,101,109,111,114,121,118,105,101,119,114,149, - 0,0,0,90,21,99,104,101,99,107,95,104,97,115,104,95, - 98,97,115,101,100,95,112,121,99,115,114,144,0,0,0,218, - 17,95,82,65,87,95,77,65,71,73,67,95,78,85,77,66, - 69,82,114,145,0,0,0,114,143,0,0,0,114,107,0,0, - 0,114,137,0,0,0,114,122,0,0,0,114,136,0,0,0, - 114,151,0,0,0,114,211,0,0,0,114,6,0,0,0,218, - 19,100,111,110,116,95,119,114,105,116,101,95,98,121,116,101, - 99,111,100,101,114,157,0,0,0,114,156,0,0,0,114,18, - 0,0,0,114,204,0,0,0,41,15,114,108,0,0,0,114, - 127,0,0,0,114,99,0,0,0,114,141,0,0,0,114,160, - 0,0,0,114,144,0,0,0,90,10,104,97,115,104,95,98, - 97,115,101,100,90,12,99,104,101,99,107,95,115,111,117,114, - 99,101,114,98,0,0,0,218,2,115,116,114,21,0,0,0, - 114,138,0,0,0,114,74,0,0,0,90,10,98,121,116,101, - 115,95,100,97,116,97,90,11,99,111,100,101,95,111,98,106, - 101,99,116,114,2,0,0,0,114,2,0,0,0,114,4,0, - 0,0,114,193,0,0,0,75,3,0,0,115,152,0,0,0, - 0,7,10,1,4,1,4,1,4,1,4,1,4,1,2,1, - 12,1,14,1,12,2,2,1,14,1,14,1,8,2,12,1, - 2,1,14,1,14,1,6,3,2,1,2,254,6,4,2,1, - 12,1,16,1,12,1,6,1,12,1,12,1,2,255,2,2, - 8,254,4,3,10,1,4,1,2,1,2,254,4,4,8,1, - 2,255,6,3,2,1,2,1,2,1,6,1,2,1,2,251, - 8,7,20,1,6,2,8,1,2,255,4,2,6,1,2,1, - 2,254,6,3,10,1,10,1,12,1,12,1,18,1,6,255, - 4,2,6,1,10,1,10,1,14,2,6,1,6,255,4,2, - 2,1,18,1,16,1,6,1,122,21,83,111,117,114,99,101, - 76,111,97,100,101,114,46,103,101,116,95,99,111,100,101,78, - 41,10,114,113,0,0,0,114,112,0,0,0,114,114,0,0, - 0,114,201,0,0,0,114,202,0,0,0,114,204,0,0,0, - 114,203,0,0,0,114,207,0,0,0,114,211,0,0,0,114, - 193,0,0,0,114,2,0,0,0,114,2,0,0,0,114,2, - 0,0,0,114,4,0,0,0,114,200,0,0,0,16,3,0, - 0,115,14,0,0,0,8,2,8,8,8,14,8,10,8,7, - 8,10,14,8,114,200,0,0,0,99,0,0,0,0,0,0, - 0,0,0,0,0,0,4,0,0,0,0,0,0,0,115,124, - 0,0,0,101,0,90,1,100,0,90,2,100,1,90,3,100, - 2,100,3,132,0,90,4,100,4,100,5,132,0,90,5,100, - 6,100,7,132,0,90,6,101,7,135,0,102,1,100,8,100, - 9,132,8,131,1,90,8,101,7,100,10,100,11,132,0,131, - 1,90,9,100,12,100,13,132,0,90,10,101,7,100,14,100, - 15,132,0,131,1,90,11,100,16,100,17,132,0,90,12,100, - 18,100,19,132,0,90,13,100,20,100,21,132,0,90,14,100, - 22,100,23,132,0,90,15,135,0,4,0,90,16,83,0,41, - 24,218,10,70,105,108,101,76,111,97,100,101,114,122,103,66, - 97,115,101,32,102,105,108,101,32,108,111,97,100,101,114,32, - 99,108,97,115,115,32,119,104,105,99,104,32,105,109,112,108, - 101,109,101,110,116,115,32,116,104,101,32,108,111,97,100,101, - 114,32,112,114,111,116,111,99,111,108,32,109,101,116,104,111, - 100,115,32,116,104,97,116,10,32,32,32,32,114,101,113,117, - 105,114,101,32,102,105,108,101,32,115,121,115,116,101,109,32, - 117,115,97,103,101,46,99,3,0,0,0,0,0,0,0,3, - 0,0,0,2,0,0,0,67,0,0,0,115,16,0,0,0, - 124,1,124,0,95,0,124,2,124,0,95,1,100,1,83,0, - 41,2,122,75,67,97,99,104,101,32,116,104,101,32,109,111, - 100,117,108,101,32,110,97,109,101,32,97,110,100,32,116,104, - 101,32,112,97,116,104,32,116,111,32,116,104,101,32,102,105, - 108,101,32,102,111,117,110,100,32,98,121,32,116,104,101,10, - 32,32,32,32,32,32,32,32,102,105,110,100,101,114,46,78, - 41,2,114,106,0,0,0,114,39,0,0,0,41,3,114,108, - 0,0,0,114,127,0,0,0,114,39,0,0,0,114,2,0, - 0,0,114,2,0,0,0,114,4,0,0,0,114,191,0,0, - 0,165,3,0,0,115,4,0,0,0,0,3,6,1,122,19, - 70,105,108,101,76,111,97,100,101,114,46,95,95,105,110,105, - 116,95,95,99,2,0,0,0,0,0,0,0,2,0,0,0, - 2,0,0,0,67,0,0,0,115,24,0,0,0,124,0,106, - 0,124,1,106,0,107,2,111,22,124,0,106,1,124,1,106, - 1,107,2,83,0,41,1,78,41,2,218,9,95,95,99,108, - 97,115,115,95,95,114,119,0,0,0,41,2,114,108,0,0, - 0,218,5,111,116,104,101,114,114,2,0,0,0,114,2,0, - 0,0,114,4,0,0,0,218,6,95,95,101,113,95,95,171, - 3,0,0,115,6,0,0,0,0,1,12,1,10,255,122,17, - 70,105,108,101,76,111,97,100,101,114,46,95,95,101,113,95, - 95,99,1,0,0,0,0,0,0,0,1,0,0,0,3,0, - 0,0,67,0,0,0,115,20,0,0,0,116,0,124,0,106, - 1,131,1,116,0,124,0,106,2,131,1,65,0,83,0,41, - 1,78,41,3,218,4,104,97,115,104,114,106,0,0,0,114, - 39,0,0,0,41,1,114,108,0,0,0,114,2,0,0,0, - 114,2,0,0,0,114,4,0,0,0,218,8,95,95,104,97, - 115,104,95,95,175,3,0,0,115,2,0,0,0,0,1,122, - 19,70,105,108,101,76,111,97,100,101,114,46,95,95,104,97, - 115,104,95,95,99,2,0,0,0,0,0,0,0,2,0,0, - 0,3,0,0,0,3,0,0,0,115,16,0,0,0,116,0, - 116,1,124,0,131,2,160,2,124,1,161,1,83,0,41,1, - 122,100,76,111,97,100,32,97,32,109,111,100,117,108,101,32, - 102,114,111,109,32,97,32,102,105,108,101,46,10,10,32,32, - 32,32,32,32,32,32,84,104,105,115,32,109,101,116,104,111, - 100,32,105,115,32,100,101,112,114,101,99,97,116,101,100,46, - 32,32,85,115,101,32,101,120,101,99,95,109,111,100,117,108, - 101,40,41,32,105,110,115,116,101,97,100,46,10,10,32,32, - 32,32,32,32,32,32,41,3,218,5,115,117,112,101,114,114, - 217,0,0,0,114,199,0,0,0,41,2,114,108,0,0,0, - 114,127,0,0,0,41,1,114,218,0,0,0,114,2,0,0, - 0,114,4,0,0,0,114,199,0,0,0,178,3,0,0,115, - 2,0,0,0,0,10,122,22,70,105,108,101,76,111,97,100, - 101,114,46,108,111,97,100,95,109,111,100,117,108,101,99,2, - 0,0,0,0,0,0,0,2,0,0,0,1,0,0,0,67, - 0,0,0,115,6,0,0,0,124,0,106,0,83,0,41,1, - 122,58,82,101,116,117,114,110,32,116,104,101,32,112,97,116, - 104,32,116,111,32,116,104,101,32,115,111,117,114,99,101,32, - 102,105,108,101,32,97,115,32,102,111,117,110,100,32,98,121, - 32,116,104,101,32,102,105,110,100,101,114,46,41,1,114,39, - 0,0,0,41,2,114,108,0,0,0,114,127,0,0,0,114, - 2,0,0,0,114,2,0,0,0,114,4,0,0,0,114,164, - 0,0,0,190,3,0,0,115,2,0,0,0,0,3,122,23, - 70,105,108,101,76,111,97,100,101,114,46,103,101,116,95,102, - 105,108,101,110,97,109,101,99,2,0,0,0,0,0,0,0, - 3,0,0,0,10,0,0,0,67,0,0,0,115,44,0,0, - 0,116,0,160,1,124,1,100,1,161,2,143,22,125,2,124, - 2,160,2,161,0,87,0,2,0,53,0,81,0,82,0,163, - 0,83,0,81,0,82,0,88,0,100,2,83,0,41,3,122, - 39,82,101,116,117,114,110,32,116,104,101,32,100,97,116,97, - 32,102,114,111,109,32,112,97,116,104,32,97,115,32,114,97, - 119,32,98,121,116,101,115,46,218,1,114,78,41,3,114,56, - 0,0,0,114,57,0,0,0,90,4,114,101,97,100,41,3, - 114,108,0,0,0,114,39,0,0,0,114,60,0,0,0,114, - 2,0,0,0,114,2,0,0,0,114,4,0,0,0,114,205, - 0,0,0,195,3,0,0,115,4,0,0,0,0,2,14,1, - 122,19,70,105,108,101,76,111,97,100,101,114,46,103,101,116, - 95,100,97,116,97,99,2,0,0,0,0,0,0,0,2,0, - 0,0,3,0,0,0,67,0,0,0,115,18,0,0,0,124, - 0,160,0,124,1,161,1,114,14,124,0,83,0,100,0,83, - 0,41,1,78,41,1,114,166,0,0,0,41,2,114,108,0, - 0,0,114,196,0,0,0,114,2,0,0,0,114,2,0,0, - 0,114,4,0,0,0,218,19,103,101,116,95,114,101,115,111, - 117,114,99,101,95,114,101,97,100,101,114,202,3,0,0,115, - 6,0,0,0,0,2,10,1,4,1,122,30,70,105,108,101, - 76,111,97,100,101,114,46,103,101,116,95,114,101,115,111,117, - 114,99,101,95,114,101,97,100,101,114,99,2,0,0,0,0, - 0,0,0,3,0,0,0,4,0,0,0,67,0,0,0,115, - 32,0,0,0,116,0,116,1,124,0,106,2,131,1,100,1, - 25,0,124,1,131,2,125,2,116,3,160,4,124,2,100,2, - 161,2,83,0,41,3,78,114,64,0,0,0,114,224,0,0, - 0,41,5,114,33,0,0,0,114,42,0,0,0,114,39,0, - 0,0,114,56,0,0,0,114,57,0,0,0,41,3,114,108, - 0,0,0,218,8,114,101,115,111,117,114,99,101,114,39,0, - 0,0,114,2,0,0,0,114,2,0,0,0,114,4,0,0, - 0,218,13,111,112,101,110,95,114,101,115,111,117,114,99,101, - 208,3,0,0,115,4,0,0,0,0,1,20,1,122,24,70, - 105,108,101,76,111,97,100,101,114,46,111,112,101,110,95,114, - 101,115,111,117,114,99,101,99,2,0,0,0,0,0,0,0, - 3,0,0,0,3,0,0,0,67,0,0,0,115,38,0,0, - 0,124,0,160,0,124,1,161,1,115,14,116,1,130,1,116, - 2,116,3,124,0,106,4,131,1,100,1,25,0,124,1,131, - 2,125,2,124,2,83,0,41,2,78,114,64,0,0,0,41, - 5,218,11,105,115,95,114,101,115,111,117,114,99,101,218,17, - 70,105,108,101,78,111,116,70,111,117,110,100,69,114,114,111, - 114,114,33,0,0,0,114,42,0,0,0,114,39,0,0,0, - 41,3,114,108,0,0,0,114,226,0,0,0,114,39,0,0, - 0,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, - 218,13,114,101,115,111,117,114,99,101,95,112,97,116,104,212, - 3,0,0,115,8,0,0,0,0,1,10,1,4,1,20,1, - 122,24,70,105,108,101,76,111,97,100,101,114,46,114,101,115, - 111,117,114,99,101,95,112,97,116,104,99,2,0,0,0,0, - 0,0,0,3,0,0,0,3,0,0,0,67,0,0,0,115, - 40,0,0,0,116,0,124,1,107,6,114,12,100,1,83,0, - 116,1,116,2,124,0,106,3,131,1,100,2,25,0,124,1, - 131,2,125,2,116,4,124,2,131,1,83,0,41,3,78,70, - 114,64,0,0,0,41,5,114,30,0,0,0,114,33,0,0, - 0,114,42,0,0,0,114,39,0,0,0,114,48,0,0,0, - 41,3,114,108,0,0,0,114,106,0,0,0,114,39,0,0, - 0,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, - 114,228,0,0,0,218,3,0,0,115,8,0,0,0,0,1, - 8,1,4,1,20,1,122,22,70,105,108,101,76,111,97,100, - 101,114,46,105,115,95,114,101,115,111,117,114,99,101,99,1, - 0,0,0,0,0,0,0,1,0,0,0,5,0,0,0,67, - 0,0,0,115,24,0,0,0,116,0,116,1,160,2,116,3, - 124,0,106,4,131,1,100,1,25,0,161,1,131,1,83,0, - 41,2,78,114,64,0,0,0,41,5,218,4,105,116,101,114, - 114,1,0,0,0,218,7,108,105,115,116,100,105,114,114,42, - 0,0,0,114,39,0,0,0,41,1,114,108,0,0,0,114, - 2,0,0,0,114,2,0,0,0,114,4,0,0,0,218,8, - 99,111,110,116,101,110,116,115,224,3,0,0,115,2,0,0, - 0,0,1,122,19,70,105,108,101,76,111,97,100,101,114,46, - 99,111,110,116,101,110,116,115,41,17,114,113,0,0,0,114, - 112,0,0,0,114,114,0,0,0,114,115,0,0,0,114,191, - 0,0,0,114,220,0,0,0,114,222,0,0,0,114,124,0, - 0,0,114,199,0,0,0,114,164,0,0,0,114,205,0,0, - 0,114,225,0,0,0,114,227,0,0,0,114,230,0,0,0, - 114,228,0,0,0,114,233,0,0,0,90,13,95,95,99,108, - 97,115,115,99,101,108,108,95,95,114,2,0,0,0,114,2, - 0,0,0,41,1,114,218,0,0,0,114,4,0,0,0,114, - 217,0,0,0,160,3,0,0,115,30,0,0,0,8,3,4, - 2,8,6,8,4,8,3,2,1,14,11,2,1,10,4,8, - 7,2,1,10,5,8,4,8,6,8,6,114,217,0,0,0, - 99,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0, - 0,64,0,0,0,115,46,0,0,0,101,0,90,1,100,0, - 90,2,100,1,90,3,100,2,100,3,132,0,90,4,100,4, - 100,5,132,0,90,5,100,6,100,7,156,1,100,8,100,9, - 132,2,90,6,100,10,83,0,41,11,218,16,83,111,117,114, - 99,101,70,105,108,101,76,111,97,100,101,114,122,62,67,111, - 110,99,114,101,116,101,32,105,109,112,108,101,109,101,110,116, - 97,116,105,111,110,32,111,102,32,83,111,117,114,99,101,76, - 111,97,100,101,114,32,117,115,105,110,103,32,116,104,101,32, - 102,105,108,101,32,115,121,115,116,101,109,46,99,2,0,0, - 0,0,0,0,0,3,0,0,0,3,0,0,0,67,0,0, - 0,115,22,0,0,0,116,0,124,1,131,1,125,2,124,2, - 106,1,124,2,106,2,100,1,156,2,83,0,41,2,122,33, - 82,101,116,117,114,110,32,116,104,101,32,109,101,116,97,100, - 97,116,97,32,102,111,114,32,116,104,101,32,112,97,116,104, - 46,41,2,114,155,0,0,0,114,212,0,0,0,41,3,114, - 43,0,0,0,218,8,115,116,95,109,116,105,109,101,90,7, - 115,116,95,115,105,122,101,41,3,114,108,0,0,0,114,39, - 0,0,0,114,216,0,0,0,114,2,0,0,0,114,2,0, - 0,0,114,4,0,0,0,114,202,0,0,0,232,3,0,0, - 115,4,0,0,0,0,2,8,1,122,27,83,111,117,114,99, - 101,70,105,108,101,76,111,97,100,101,114,46,112,97,116,104, - 95,115,116,97,116,115,99,4,0,0,0,0,0,0,0,5, - 0,0,0,5,0,0,0,67,0,0,0,115,24,0,0,0, - 116,0,124,1,131,1,125,4,124,0,106,1,124,2,124,3, - 124,4,100,1,141,3,83,0,41,2,78,41,1,218,5,95, - 109,111,100,101,41,2,114,105,0,0,0,114,203,0,0,0, - 41,5,114,108,0,0,0,114,99,0,0,0,114,98,0,0, - 0,114,21,0,0,0,114,46,0,0,0,114,2,0,0,0, - 114,2,0,0,0,114,4,0,0,0,114,204,0,0,0,237, - 3,0,0,115,4,0,0,0,0,2,8,1,122,32,83,111, - 117,114,99,101,70,105,108,101,76,111,97,100,101,114,46,95, - 99,97,99,104,101,95,98,121,116,101,99,111,100,101,105,182, - 1,0,0,41,1,114,236,0,0,0,99,3,0,0,0,1, - 0,0,0,9,0,0,0,11,0,0,0,67,0,0,0,115, - 0,1,0,0,116,0,124,1,131,1,92,2,125,4,125,5, - 103,0,125,6,124,4,114,52,116,1,124,4,131,1,115,52, - 116,0,124,4,131,1,92,2,125,4,125,7,124,6,160,2, - 124,7,161,1,1,0,113,16,116,3,124,6,131,1,68,0, - 93,112,125,7,116,4,124,4,124,7,131,2,125,4,122,14, - 116,5,160,6,124,4,161,1,1,0,87,0,110,82,4,0, - 116,7,107,10,114,112,1,0,1,0,1,0,89,0,113,60, - 89,0,110,60,4,0,116,8,107,10,114,170,1,0,125,8, - 1,0,122,30,116,9,160,10,100,1,124,4,124,8,161,3, - 1,0,87,0,89,0,162,10,1,0,100,2,83,0,87,0, - 53,0,100,2,125,8,126,8,88,0,89,0,110,2,88,0, - 113,60,122,28,116,11,124,1,124,2,124,3,131,3,1,0, - 116,9,160,10,100,3,124,1,161,2,1,0,87,0,110,48, - 4,0,116,8,107,10,114,250,1,0,125,8,1,0,122,18, - 116,9,160,10,100,1,124,1,124,8,161,3,1,0,87,0, - 53,0,100,2,125,8,126,8,88,0,89,0,110,2,88,0, - 100,2,83,0,41,4,122,27,87,114,105,116,101,32,98,121, - 116,101,115,32,100,97,116,97,32,116,111,32,97,32,102,105, - 108,101,46,122,27,99,111,117,108,100,32,110,111,116,32,99, - 114,101,97,116,101,32,123,33,114,125,58,32,123,33,114,125, - 78,122,12,99,114,101,97,116,101,100,32,123,33,114,125,41, - 12,114,42,0,0,0,114,50,0,0,0,114,170,0,0,0, - 114,37,0,0,0,114,33,0,0,0,114,1,0,0,0,90, - 5,109,107,100,105,114,218,15,70,105,108,101,69,120,105,115, - 116,115,69,114,114,111,114,114,44,0,0,0,114,122,0,0, - 0,114,136,0,0,0,114,61,0,0,0,41,9,114,108,0, - 0,0,114,39,0,0,0,114,21,0,0,0,114,236,0,0, - 0,218,6,112,97,114,101,110,116,114,88,0,0,0,114,32, - 0,0,0,114,28,0,0,0,114,206,0,0,0,114,2,0, - 0,0,114,2,0,0,0,114,4,0,0,0,114,203,0,0, - 0,242,3,0,0,115,48,0,0,0,0,2,12,1,4,2, - 12,1,12,1,12,2,12,1,10,1,2,1,14,1,14,2, - 8,1,16,3,6,1,2,0,2,255,4,2,32,1,2,1, - 12,1,16,1,16,2,8,1,2,255,122,25,83,111,117,114, - 99,101,70,105,108,101,76,111,97,100,101,114,46,115,101,116, - 95,100,97,116,97,78,41,7,114,113,0,0,0,114,112,0, - 0,0,114,114,0,0,0,114,115,0,0,0,114,202,0,0, - 0,114,204,0,0,0,114,203,0,0,0,114,2,0,0,0, - 114,2,0,0,0,114,2,0,0,0,114,4,0,0,0,114, - 234,0,0,0,228,3,0,0,115,8,0,0,0,8,2,4, - 2,8,5,8,5,114,234,0,0,0,99,0,0,0,0,0, - 0,0,0,0,0,0,0,2,0,0,0,64,0,0,0,115, - 32,0,0,0,101,0,90,1,100,0,90,2,100,1,90,3, - 100,2,100,3,132,0,90,4,100,4,100,5,132,0,90,5, - 100,6,83,0,41,7,218,20,83,111,117,114,99,101,108,101, - 115,115,70,105,108,101,76,111,97,100,101,114,122,45,76,111, - 97,100,101,114,32,119,104,105,99,104,32,104,97,110,100,108, - 101,115,32,115,111,117,114,99,101,108,101,115,115,32,102,105, - 108,101,32,105,109,112,111,114,116,115,46,99,2,0,0,0, - 0,0,0,0,5,0,0,0,5,0,0,0,67,0,0,0, - 115,68,0,0,0,124,0,160,0,124,1,161,1,125,2,124, - 0,160,1,124,2,161,1,125,3,124,1,124,2,100,1,156, - 2,125,4,116,2,124,3,124,1,124,4,131,3,1,0,116, - 3,116,4,124,3,131,1,100,2,100,0,133,2,25,0,124, - 1,124,2,100,3,141,3,83,0,41,4,78,41,2,114,106, - 0,0,0,114,39,0,0,0,114,132,0,0,0,41,2,114, - 106,0,0,0,114,98,0,0,0,41,5,114,164,0,0,0, - 114,205,0,0,0,114,139,0,0,0,114,151,0,0,0,114, - 213,0,0,0,41,5,114,108,0,0,0,114,127,0,0,0, - 114,39,0,0,0,114,21,0,0,0,114,138,0,0,0,114, - 2,0,0,0,114,2,0,0,0,114,4,0,0,0,114,193, - 0,0,0,21,4,0,0,115,22,0,0,0,0,1,10,1, - 10,4,2,1,2,254,6,4,12,1,2,1,14,1,2,1, - 2,253,122,29,83,111,117,114,99,101,108,101,115,115,70,105, - 108,101,76,111,97,100,101,114,46,103,101,116,95,99,111,100, + 0,0,64,0,0,0,115,92,0,0,0,101,0,90,1,100, + 0,90,2,100,1,90,3,100,2,100,3,132,0,90,4,100, + 4,100,5,132,0,90,5,100,6,100,7,132,0,90,6,100, + 8,100,9,132,0,90,7,100,10,100,11,132,0,90,8,100, + 12,100,13,132,0,90,9,100,14,100,15,132,0,90,10,100, + 16,100,17,132,0,90,11,101,12,100,18,100,19,132,0,131, + 1,90,13,100,20,83,0,41,21,218,19,69,120,116,101,110, + 115,105,111,110,70,105,108,101,76,111,97,100,101,114,122,93, + 76,111,97,100,101,114,32,102,111,114,32,101,120,116,101,110, + 115,105,111,110,32,109,111,100,117,108,101,115,46,10,10,32, + 32,32,32,84,104,101,32,99,111,110,115,116,114,117,99,116, + 111,114,32,105,115,32,100,101,115,105,103,110,101,100,32,116, + 111,32,119,111,114,107,32,119,105,116,104,32,70,105,108,101, + 70,105,110,100,101,114,46,10,10,32,32,32,32,99,3,0, + 0,0,0,0,0,0,3,0,0,0,2,0,0,0,67,0, + 0,0,115,16,0,0,0,124,1,124,0,95,0,124,2,124, + 0,95,1,100,0,83,0,114,110,0,0,0,114,159,0,0, + 0,114,4,1,0,0,114,3,0,0,0,114,3,0,0,0, + 114,6,0,0,0,114,209,0,0,0,54,4,0,0,115,4, + 0,0,0,0,1,6,1,122,28,69,120,116,101,110,115,105, + 111,110,70,105,108,101,76,111,97,100,101,114,46,95,95,105, + 110,105,116,95,95,99,2,0,0,0,0,0,0,0,2,0, + 0,0,2,0,0,0,67,0,0,0,115,24,0,0,0,124, + 0,106,0,124,1,106,0,107,2,111,22,124,0,106,1,124, + 1,106,1,107,2,83,0,114,110,0,0,0,114,240,0,0, + 0,114,242,0,0,0,114,3,0,0,0,114,3,0,0,0, + 114,6,0,0,0,114,243,0,0,0,58,4,0,0,115,6, + 0,0,0,0,1,12,1,10,255,122,26,69,120,116,101,110, + 115,105,111,110,70,105,108,101,76,111,97,100,101,114,46,95, + 95,101,113,95,95,99,1,0,0,0,0,0,0,0,1,0, + 0,0,3,0,0,0,67,0,0,0,115,20,0,0,0,116, + 0,124,0,106,1,131,1,116,0,124,0,106,2,131,1,65, + 0,83,0,114,110,0,0,0,114,244,0,0,0,114,246,0, + 0,0,114,3,0,0,0,114,3,0,0,0,114,6,0,0, + 0,114,247,0,0,0,62,4,0,0,115,2,0,0,0,0, + 1,122,28,69,120,116,101,110,115,105,111,110,70,105,108,101, + 76,111,97,100,101,114,46,95,95,104,97,115,104,95,95,99, + 2,0,0,0,0,0,0,0,3,0,0,0,5,0,0,0, + 67,0,0,0,115,36,0,0,0,116,0,160,1,116,2,106, + 3,124,1,161,2,125,2,116,0,160,4,100,1,124,1,106, + 5,124,0,106,6,161,3,1,0,124,2,83,0,41,2,122, + 38,67,114,101,97,116,101,32,97,110,32,117,110,105,116,105, + 97,108,105,122,101,100,32,101,120,116,101,110,115,105,111,110, + 32,109,111,100,117,108,101,122,38,101,120,116,101,110,115,105, + 111,110,32,109,111,100,117,108,101,32,123,33,114,125,32,108, + 111,97,100,101,100,32,102,114,111,109,32,123,33,114,125,41, + 7,114,134,0,0,0,114,214,0,0,0,114,163,0,0,0, + 90,14,99,114,101,97,116,101,95,100,121,110,97,109,105,99, + 114,149,0,0,0,114,117,0,0,0,114,44,0,0,0,41, + 3,114,119,0,0,0,114,187,0,0,0,114,216,0,0,0, + 114,3,0,0,0,114,3,0,0,0,114,6,0,0,0,114, + 212,0,0,0,65,4,0,0,115,18,0,0,0,0,2,4, + 1,4,0,2,255,4,2,6,1,4,0,4,255,4,2,122, + 33,69,120,116,101,110,115,105,111,110,70,105,108,101,76,111, + 97,100,101,114,46,99,114,101,97,116,101,95,109,111,100,117, + 108,101,99,2,0,0,0,0,0,0,0,2,0,0,0,5, + 0,0,0,67,0,0,0,115,36,0,0,0,116,0,160,1, + 116,2,106,3,124,1,161,2,1,0,116,0,160,4,100,1, + 124,0,106,5,124,0,106,6,161,3,1,0,100,2,83,0, + 41,3,122,30,73,110,105,116,105,97,108,105,122,101,32,97, + 110,32,101,120,116,101,110,115,105,111,110,32,109,111,100,117, + 108,101,122,40,101,120,116,101,110,115,105,111,110,32,109,111, + 100,117,108,101,32,123,33,114,125,32,101,120,101,99,117,116, + 101,100,32,102,114,111,109,32,123,33,114,125,78,41,7,114, + 134,0,0,0,114,214,0,0,0,114,163,0,0,0,90,12, + 101,120,101,99,95,100,121,110,97,109,105,99,114,149,0,0, + 0,114,117,0,0,0,114,44,0,0,0,114,252,0,0,0, + 114,3,0,0,0,114,3,0,0,0,114,6,0,0,0,114, + 217,0,0,0,73,4,0,0,115,10,0,0,0,0,2,14, + 1,6,1,4,0,4,255,122,31,69,120,116,101,110,115,105, + 111,110,70,105,108,101,76,111,97,100,101,114,46,101,120,101, + 99,95,109,111,100,117,108,101,99,2,0,0,0,0,0,0, + 0,2,0,0,0,4,0,0,0,3,0,0,0,115,36,0, + 0,0,116,0,124,0,106,1,131,1,100,1,25,0,137,0, + 116,2,135,0,102,1,100,2,100,3,132,8,116,3,68,0, + 131,1,131,1,83,0,41,4,122,49,82,101,116,117,114,110, + 32,84,114,117,101,32,105,102,32,116,104,101,32,101,120,116, + 101,110,115,105,111,110,32,109,111,100,117,108,101,32,105,115, + 32,97,32,112,97,99,107,97,103,101,46,114,39,0,0,0, + 99,1,0,0,0,0,0,0,0,2,0,0,0,4,0,0, + 0,51,0,0,0,115,26,0,0,0,124,0,93,18,125,1, + 136,0,100,0,124,1,23,0,107,2,86,0,1,0,113,2, + 100,1,83,0,41,2,114,209,0,0,0,78,114,3,0,0, + 0,169,2,114,32,0,0,0,218,6,115,117,102,102,105,120, + 169,1,90,9,102,105,108,101,95,110,97,109,101,114,3,0, + 0,0,114,6,0,0,0,218,9,60,103,101,110,101,120,112, + 114,62,82,4,0,0,115,4,0,0,0,4,1,2,255,122, + 49,69,120,116,101,110,115,105,111,110,70,105,108,101,76,111, + 97,100,101,114,46,105,115,95,112,97,99,107,97,103,101,46, + 60,108,111,99,97,108,115,62,46,60,103,101,110,101,120,112, + 114,62,41,4,114,47,0,0,0,114,44,0,0,0,218,3, + 97,110,121,218,18,69,88,84,69,78,83,73,79,78,95,83, + 85,70,70,73,88,69,83,114,219,0,0,0,114,3,0,0, + 0,114,18,1,0,0,114,6,0,0,0,114,182,0,0,0, + 79,4,0,0,115,8,0,0,0,0,2,14,1,12,1,2, + 255,122,30,69,120,116,101,110,115,105,111,110,70,105,108,101, + 76,111,97,100,101,114,46,105,115,95,112,97,99,107,97,103, 101,99,2,0,0,0,0,0,0,0,2,0,0,0,1,0, 0,0,67,0,0,0,115,4,0,0,0,100,1,83,0,41, - 2,122,39,82,101,116,117,114,110,32,78,111,110,101,32,97, - 115,32,116,104,101,114,101,32,105,115,32,110,111,32,115,111, - 117,114,99,101,32,99,111,100,101,46,78,114,2,0,0,0, - 41,2,114,108,0,0,0,114,127,0,0,0,114,2,0,0, - 0,114,2,0,0,0,114,4,0,0,0,114,207,0,0,0, - 37,4,0,0,115,2,0,0,0,0,2,122,31,83,111,117, - 114,99,101,108,101,115,115,70,105,108,101,76,111,97,100,101, - 114,46,103,101,116,95,115,111,117,114,99,101,78,41,6,114, - 113,0,0,0,114,112,0,0,0,114,114,0,0,0,114,115, - 0,0,0,114,193,0,0,0,114,207,0,0,0,114,2,0, - 0,0,114,2,0,0,0,114,2,0,0,0,114,4,0,0, - 0,114,239,0,0,0,17,4,0,0,115,6,0,0,0,8, - 2,4,2,8,16,114,239,0,0,0,99,0,0,0,0,0, - 0,0,0,0,0,0,0,3,0,0,0,64,0,0,0,115, - 92,0,0,0,101,0,90,1,100,0,90,2,100,1,90,3, - 100,2,100,3,132,0,90,4,100,4,100,5,132,0,90,5, - 100,6,100,7,132,0,90,6,100,8,100,9,132,0,90,7, - 100,10,100,11,132,0,90,8,100,12,100,13,132,0,90,9, - 100,14,100,15,132,0,90,10,100,16,100,17,132,0,90,11, - 101,12,100,18,100,19,132,0,131,1,90,13,100,20,83,0, - 41,21,218,19,69,120,116,101,110,115,105,111,110,70,105,108, - 101,76,111,97,100,101,114,122,93,76,111,97,100,101,114,32, - 102,111,114,32,101,120,116,101,110,115,105,111,110,32,109,111, - 100,117,108,101,115,46,10,10,32,32,32,32,84,104,101,32, - 99,111,110,115,116,114,117,99,116,111,114,32,105,115,32,100, - 101,115,105,103,110,101,100,32,116,111,32,119,111,114,107,32, - 119,105,116,104,32,70,105,108,101,70,105,110,100,101,114,46, - 10,10,32,32,32,32,99,3,0,0,0,0,0,0,0,3, - 0,0,0,2,0,0,0,67,0,0,0,115,16,0,0,0, - 124,1,124,0,95,0,124,2,124,0,95,1,100,0,83,0, - 41,1,78,41,2,114,106,0,0,0,114,39,0,0,0,41, - 3,114,108,0,0,0,114,106,0,0,0,114,39,0,0,0, - 114,2,0,0,0,114,2,0,0,0,114,4,0,0,0,114, - 191,0,0,0,54,4,0,0,115,4,0,0,0,0,1,6, - 1,122,28,69,120,116,101,110,115,105,111,110,70,105,108,101, - 76,111,97,100,101,114,46,95,95,105,110,105,116,95,95,99, - 2,0,0,0,0,0,0,0,2,0,0,0,2,0,0,0, - 67,0,0,0,115,24,0,0,0,124,0,106,0,124,1,106, - 0,107,2,111,22,124,0,106,1,124,1,106,1,107,2,83, - 0,41,1,78,41,2,114,218,0,0,0,114,119,0,0,0, - 41,2,114,108,0,0,0,114,219,0,0,0,114,2,0,0, - 0,114,2,0,0,0,114,4,0,0,0,114,220,0,0,0, - 58,4,0,0,115,6,0,0,0,0,1,12,1,10,255,122, - 26,69,120,116,101,110,115,105,111,110,70,105,108,101,76,111, - 97,100,101,114,46,95,95,101,113,95,95,99,1,0,0,0, - 0,0,0,0,1,0,0,0,3,0,0,0,67,0,0,0, - 115,20,0,0,0,116,0,124,0,106,1,131,1,116,0,124, - 0,106,2,131,1,65,0,83,0,41,1,78,41,3,114,221, - 0,0,0,114,106,0,0,0,114,39,0,0,0,41,1,114, - 108,0,0,0,114,2,0,0,0,114,2,0,0,0,114,4, - 0,0,0,114,222,0,0,0,62,4,0,0,115,2,0,0, - 0,0,1,122,28,69,120,116,101,110,115,105,111,110,70,105, - 108,101,76,111,97,100,101,114,46,95,95,104,97,115,104,95, - 95,99,2,0,0,0,0,0,0,0,3,0,0,0,5,0, - 0,0,67,0,0,0,115,36,0,0,0,116,0,160,1,116, - 2,106,3,124,1,161,2,125,2,116,0,160,4,100,1,124, - 1,106,5,124,0,106,6,161,3,1,0,124,2,83,0,41, - 2,122,38,67,114,101,97,116,101,32,97,110,32,117,110,105, - 116,105,97,108,105,122,101,100,32,101,120,116,101,110,115,105, - 111,110,32,109,111,100,117,108,101,122,38,101,120,116,101,110, - 115,105,111,110,32,109,111,100,117,108,101,32,123,33,114,125, - 32,108,111,97,100,101,100,32,102,114,111,109,32,123,33,114, - 125,41,7,114,122,0,0,0,114,194,0,0,0,114,149,0, - 0,0,90,14,99,114,101,97,116,101,95,100,121,110,97,109, - 105,99,114,136,0,0,0,114,106,0,0,0,114,39,0,0, - 0,41,3,114,108,0,0,0,114,171,0,0,0,114,196,0, - 0,0,114,2,0,0,0,114,2,0,0,0,114,4,0,0, - 0,114,192,0,0,0,65,4,0,0,115,18,0,0,0,0, - 2,4,1,4,0,2,255,4,2,6,1,4,0,4,255,4, - 2,122,33,69,120,116,101,110,115,105,111,110,70,105,108,101, - 76,111,97,100,101,114,46,99,114,101,97,116,101,95,109,111, - 100,117,108,101,99,2,0,0,0,0,0,0,0,2,0,0, - 0,5,0,0,0,67,0,0,0,115,36,0,0,0,116,0, - 160,1,116,2,106,3,124,1,161,2,1,0,116,0,160,4, - 100,1,124,0,106,5,124,0,106,6,161,3,1,0,100,2, - 83,0,41,3,122,30,73,110,105,116,105,97,108,105,122,101, - 32,97,110,32,101,120,116,101,110,115,105,111,110,32,109,111, - 100,117,108,101,122,40,101,120,116,101,110,115,105,111,110,32, - 109,111,100,117,108,101,32,123,33,114,125,32,101,120,101,99, - 117,116,101,100,32,102,114,111,109,32,123,33,114,125,78,41, - 7,114,122,0,0,0,114,194,0,0,0,114,149,0,0,0, - 90,12,101,120,101,99,95,100,121,110,97,109,105,99,114,136, - 0,0,0,114,106,0,0,0,114,39,0,0,0,41,2,114, - 108,0,0,0,114,196,0,0,0,114,2,0,0,0,114,2, - 0,0,0,114,4,0,0,0,114,197,0,0,0,73,4,0, - 0,115,10,0,0,0,0,2,14,1,6,1,4,0,4,255, - 122,31,69,120,116,101,110,115,105,111,110,70,105,108,101,76, - 111,97,100,101,114,46,101,120,101,99,95,109,111,100,117,108, - 101,99,2,0,0,0,0,0,0,0,2,0,0,0,4,0, - 0,0,3,0,0,0,115,36,0,0,0,116,0,124,0,106, - 1,131,1,100,1,25,0,137,0,116,2,135,0,102,1,100, - 2,100,3,132,8,116,3,68,0,131,1,131,1,83,0,41, - 4,122,49,82,101,116,117,114,110,32,84,114,117,101,32,105, - 102,32,116,104,101,32,101,120,116,101,110,115,105,111,110,32, - 109,111,100,117,108,101,32,105,115,32,97,32,112,97,99,107, - 97,103,101,46,114,34,0,0,0,99,1,0,0,0,0,0, - 0,0,2,0,0,0,4,0,0,0,51,0,0,0,115,26, - 0,0,0,124,0,93,18,125,1,136,0,100,0,124,1,23, - 0,107,2,86,0,1,0,113,2,100,1,83,0,41,2,114, - 191,0,0,0,78,114,2,0,0,0,41,2,114,27,0,0, - 0,218,6,115,117,102,102,105,120,41,1,218,9,102,105,108, - 101,95,110,97,109,101,114,2,0,0,0,114,4,0,0,0, - 218,9,60,103,101,110,101,120,112,114,62,82,4,0,0,115, - 4,0,0,0,4,1,2,255,122,49,69,120,116,101,110,115, - 105,111,110,70,105,108,101,76,111,97,100,101,114,46,105,115, - 95,112,97,99,107,97,103,101,46,60,108,111,99,97,108,115, - 62,46,60,103,101,110,101,120,112,114,62,41,4,114,42,0, - 0,0,114,39,0,0,0,218,3,97,110,121,218,18,69,88, - 84,69,78,83,73,79,78,95,83,85,70,70,73,88,69,83, - 41,2,114,108,0,0,0,114,127,0,0,0,114,2,0,0, - 0,41,1,114,242,0,0,0,114,4,0,0,0,114,166,0, - 0,0,79,4,0,0,115,8,0,0,0,0,2,14,1,12, - 1,2,255,122,30,69,120,116,101,110,115,105,111,110,70,105, - 108,101,76,111,97,100,101,114,46,105,115,95,112,97,99,107, - 97,103,101,99,2,0,0,0,0,0,0,0,2,0,0,0, - 1,0,0,0,67,0,0,0,115,4,0,0,0,100,1,83, - 0,41,2,122,63,82,101,116,117,114,110,32,78,111,110,101, - 32,97,115,32,97,110,32,101,120,116,101,110,115,105,111,110, - 32,109,111,100,117,108,101,32,99,97,110,110,111,116,32,99, - 114,101,97,116,101,32,97,32,99,111,100,101,32,111,98,106, - 101,99,116,46,78,114,2,0,0,0,41,2,114,108,0,0, - 0,114,127,0,0,0,114,2,0,0,0,114,2,0,0,0, - 114,4,0,0,0,114,193,0,0,0,85,4,0,0,115,2, - 0,0,0,0,2,122,28,69,120,116,101,110,115,105,111,110, - 70,105,108,101,76,111,97,100,101,114,46,103,101,116,95,99, - 111,100,101,99,2,0,0,0,0,0,0,0,2,0,0,0, - 1,0,0,0,67,0,0,0,115,4,0,0,0,100,1,83, - 0,41,2,122,53,82,101,116,117,114,110,32,78,111,110,101, - 32,97,115,32,101,120,116,101,110,115,105,111,110,32,109,111, - 100,117,108,101,115,32,104,97,118,101,32,110,111,32,115,111, - 117,114,99,101,32,99,111,100,101,46,78,114,2,0,0,0, - 41,2,114,108,0,0,0,114,127,0,0,0,114,2,0,0, - 0,114,2,0,0,0,114,4,0,0,0,114,207,0,0,0, + 2,122,63,82,101,116,117,114,110,32,78,111,110,101,32,97, + 115,32,97,110,32,101,120,116,101,110,115,105,111,110,32,109, + 111,100,117,108,101,32,99,97,110,110,111,116,32,99,114,101, + 97,116,101,32,97,32,99,111,100,101,32,111,98,106,101,99, + 116,46,78,114,3,0,0,0,114,219,0,0,0,114,3,0, + 0,0,114,3,0,0,0,114,6,0,0,0,114,213,0,0, + 0,85,4,0,0,115,2,0,0,0,0,2,122,28,69,120, + 116,101,110,115,105,111,110,70,105,108,101,76,111,97,100,101, + 114,46,103,101,116,95,99,111,100,101,99,2,0,0,0,0, + 0,0,0,2,0,0,0,1,0,0,0,67,0,0,0,115, + 4,0,0,0,100,1,83,0,41,2,122,53,82,101,116,117, + 114,110,32,78,111,110,101,32,97,115,32,101,120,116,101,110, + 115,105,111,110,32,109,111,100,117,108,101,115,32,104,97,118, + 101,32,110,111,32,115,111,117,114,99,101,32,99,111,100,101, + 46,78,114,3,0,0,0,114,219,0,0,0,114,3,0,0, + 0,114,3,0,0,0,114,6,0,0,0,114,229,0,0,0, 89,4,0,0,115,2,0,0,0,0,2,122,30,69,120,116, 101,110,115,105,111,110,70,105,108,101,76,111,97,100,101,114, 46,103,101,116,95,115,111,117,114,99,101,99,2,0,0,0, 0,0,0,0,2,0,0,0,1,0,0,0,67,0,0,0, - 115,6,0,0,0,124,0,106,0,83,0,41,1,122,58,82, - 101,116,117,114,110,32,116,104,101,32,112,97,116,104,32,116, - 111,32,116,104,101,32,115,111,117,114,99,101,32,102,105,108, - 101,32,97,115,32,102,111,117,110,100,32,98,121,32,116,104, - 101,32,102,105,110,100,101,114,46,41,1,114,39,0,0,0, - 41,2,114,108,0,0,0,114,127,0,0,0,114,2,0,0, - 0,114,2,0,0,0,114,4,0,0,0,114,164,0,0,0, - 93,4,0,0,115,2,0,0,0,0,3,122,32,69,120,116, - 101,110,115,105,111,110,70,105,108,101,76,111,97,100,101,114, - 46,103,101,116,95,102,105,108,101,110,97,109,101,78,41,14, - 114,113,0,0,0,114,112,0,0,0,114,114,0,0,0,114, - 115,0,0,0,114,191,0,0,0,114,220,0,0,0,114,222, - 0,0,0,114,192,0,0,0,114,197,0,0,0,114,166,0, - 0,0,114,193,0,0,0,114,207,0,0,0,114,124,0,0, - 0,114,164,0,0,0,114,2,0,0,0,114,2,0,0,0, - 114,2,0,0,0,114,4,0,0,0,114,240,0,0,0,46, - 4,0,0,115,22,0,0,0,8,6,4,2,8,4,8,4, - 8,3,8,8,8,6,8,6,8,4,8,4,2,1,114,240, - 0,0,0,99,0,0,0,0,0,0,0,0,0,0,0,0, - 2,0,0,0,64,0,0,0,115,96,0,0,0,101,0,90, - 1,100,0,90,2,100,1,90,3,100,2,100,3,132,0,90, - 4,100,4,100,5,132,0,90,5,100,6,100,7,132,0,90, - 6,100,8,100,9,132,0,90,7,100,10,100,11,132,0,90, - 8,100,12,100,13,132,0,90,9,100,14,100,15,132,0,90, - 10,100,16,100,17,132,0,90,11,100,18,100,19,132,0,90, - 12,100,20,100,21,132,0,90,13,100,22,83,0,41,23,218, - 14,95,78,97,109,101,115,112,97,99,101,80,97,116,104,97, - 38,1,0,0,82,101,112,114,101,115,101,110,116,115,32,97, - 32,110,97,109,101,115,112,97,99,101,32,112,97,99,107,97, - 103,101,39,115,32,112,97,116,104,46,32,32,73,116,32,117, - 115,101,115,32,116,104,101,32,109,111,100,117,108,101,32,110, - 97,109,101,10,32,32,32,32,116,111,32,102,105,110,100,32, - 105,116,115,32,112,97,114,101,110,116,32,109,111,100,117,108, - 101,44,32,97,110,100,32,102,114,111,109,32,116,104,101,114, - 101,32,105,116,32,108,111,111,107,115,32,117,112,32,116,104, - 101,32,112,97,114,101,110,116,39,115,10,32,32,32,32,95, - 95,112,97,116,104,95,95,46,32,32,87,104,101,110,32,116, - 104,105,115,32,99,104,97,110,103,101,115,44,32,116,104,101, - 32,109,111,100,117,108,101,39,115,32,111,119,110,32,112,97, - 116,104,32,105,115,32,114,101,99,111,109,112,117,116,101,100, - 44,10,32,32,32,32,117,115,105,110,103,32,112,97,116,104, - 95,102,105,110,100,101,114,46,32,32,70,111,114,32,116,111, - 112,45,108,101,118,101,108,32,109,111,100,117,108,101,115,44, - 32,116,104,101,32,112,97,114,101,110,116,32,109,111,100,117, - 108,101,39,115,32,112,97,116,104,10,32,32,32,32,105,115, - 32,115,121,115,46,112,97,116,104,46,99,4,0,0,0,0, - 0,0,0,4,0,0,0,3,0,0,0,67,0,0,0,115, - 36,0,0,0,124,1,124,0,95,0,124,2,124,0,95,1, - 116,2,124,0,160,3,161,0,131,1,124,0,95,4,124,3, - 124,0,95,5,100,0,83,0,41,1,78,41,6,218,5,95, - 110,97,109,101,218,5,95,112,97,116,104,114,102,0,0,0, + 115,6,0,0,0,124,0,106,0,83,0,114,250,0,0,0, + 114,48,0,0,0,114,219,0,0,0,114,3,0,0,0,114, + 3,0,0,0,114,6,0,0,0,114,179,0,0,0,93,4, + 0,0,115,2,0,0,0,0,3,122,32,69,120,116,101,110, + 115,105,111,110,70,105,108,101,76,111,97,100,101,114,46,103, + 101,116,95,102,105,108,101,110,97,109,101,78,41,14,114,125, + 0,0,0,114,124,0,0,0,114,126,0,0,0,114,127,0, + 0,0,114,209,0,0,0,114,243,0,0,0,114,247,0,0, + 0,114,212,0,0,0,114,217,0,0,0,114,182,0,0,0, + 114,213,0,0,0,114,229,0,0,0,114,136,0,0,0,114, + 179,0,0,0,114,3,0,0,0,114,3,0,0,0,114,3, + 0,0,0,114,6,0,0,0,114,15,1,0,0,46,4,0, + 0,115,22,0,0,0,8,6,4,2,8,4,8,4,8,3, + 8,8,8,6,8,6,8,4,8,4,2,1,114,15,1,0, + 0,99,0,0,0,0,0,0,0,0,0,0,0,0,2,0, + 0,0,64,0,0,0,115,96,0,0,0,101,0,90,1,100, + 0,90,2,100,1,90,3,100,2,100,3,132,0,90,4,100, + 4,100,5,132,0,90,5,100,6,100,7,132,0,90,6,100, + 8,100,9,132,0,90,7,100,10,100,11,132,0,90,8,100, + 12,100,13,132,0,90,9,100,14,100,15,132,0,90,10,100, + 16,100,17,132,0,90,11,100,18,100,19,132,0,90,12,100, + 20,100,21,132,0,90,13,100,22,83,0,41,23,218,14,95, + 78,97,109,101,115,112,97,99,101,80,97,116,104,97,38,1, + 0,0,82,101,112,114,101,115,101,110,116,115,32,97,32,110, + 97,109,101,115,112,97,99,101,32,112,97,99,107,97,103,101, + 39,115,32,112,97,116,104,46,32,32,73,116,32,117,115,101, + 115,32,116,104,101,32,109,111,100,117,108,101,32,110,97,109, + 101,10,32,32,32,32,116,111,32,102,105,110,100,32,105,116, + 115,32,112,97,114,101,110,116,32,109,111,100,117,108,101,44, + 32,97,110,100,32,102,114,111,109,32,116,104,101,114,101,32, + 105,116,32,108,111,111,107,115,32,117,112,32,116,104,101,32, + 112,97,114,101,110,116,39,115,10,32,32,32,32,95,95,112, + 97,116,104,95,95,46,32,32,87,104,101,110,32,116,104,105, + 115,32,99,104,97,110,103,101,115,44,32,116,104,101,32,109, + 111,100,117,108,101,39,115,32,111,119,110,32,112,97,116,104, + 32,105,115,32,114,101,99,111,109,112,117,116,101,100,44,10, + 32,32,32,32,117,115,105,110,103,32,112,97,116,104,95,102, + 105,110,100,101,114,46,32,32,70,111,114,32,116,111,112,45, + 108,101,118,101,108,32,109,111,100,117,108,101,115,44,32,116, + 104,101,32,112,97,114,101,110,116,32,109,111,100,117,108,101, + 39,115,32,112,97,116,104,10,32,32,32,32,105,115,32,115, + 121,115,46,112,97,116,104,46,99,4,0,0,0,0,0,0, + 0,4,0,0,0,3,0,0,0,67,0,0,0,115,36,0, + 0,0,124,1,124,0,95,0,124,2,124,0,95,1,116,2, + 124,0,160,3,161,0,131,1,124,0,95,4,124,3,124,0, + 95,5,100,0,83,0,114,110,0,0,0,41,6,218,5,95, + 110,97,109,101,218,5,95,112,97,116,104,114,112,0,0,0, 218,16,95,103,101,116,95,112,97,114,101,110,116,95,112,97, 116,104,218,17,95,108,97,115,116,95,112,97,114,101,110,116, 95,112,97,116,104,218,12,95,112,97,116,104,95,102,105,110, - 100,101,114,41,4,114,108,0,0,0,114,106,0,0,0,114, - 39,0,0,0,218,11,112,97,116,104,95,102,105,110,100,101, - 114,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, - 114,191,0,0,0,106,4,0,0,115,8,0,0,0,0,1, + 100,101,114,169,4,114,119,0,0,0,114,117,0,0,0,114, + 44,0,0,0,90,11,112,97,116,104,95,102,105,110,100,101, + 114,114,3,0,0,0,114,3,0,0,0,114,6,0,0,0, + 114,209,0,0,0,106,4,0,0,115,8,0,0,0,0,1, 6,1,6,1,14,1,122,23,95,78,97,109,101,115,112,97, 99,101,80,97,116,104,46,95,95,105,110,105,116,95,95,99, 1,0,0,0,0,0,0,0,4,0,0,0,3,0,0,0, @@ -1840,11 +1820,11 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 108,101,32,111,102,32,40,112,97,114,101,110,116,45,109,111, 100,117,108,101,45,110,97,109,101,44,32,112,97,114,101,110, 116,45,112,97,116,104,45,97,116,116,114,45,110,97,109,101, - 41,114,63,0,0,0,114,35,0,0,0,41,2,114,6,0, - 0,0,114,39,0,0,0,90,8,95,95,112,97,116,104,95, - 95,41,2,114,247,0,0,0,114,36,0,0,0,41,4,114, - 108,0,0,0,114,238,0,0,0,218,3,100,111,116,90,2, - 109,101,114,2,0,0,0,114,2,0,0,0,114,4,0,0, + 41,114,71,0,0,0,114,40,0,0,0,41,2,114,8,0, + 0,0,114,44,0,0,0,90,8,95,95,112,97,116,104,95, + 95,41,2,114,23,1,0,0,114,41,0,0,0,41,4,114, + 119,0,0,0,114,13,1,0,0,218,3,100,111,116,90,2, + 109,101,114,3,0,0,0,114,3,0,0,0,114,6,0,0, 0,218,23,95,102,105,110,100,95,112,97,114,101,110,116,95, 112,97,116,104,95,110,97,109,101,115,112,4,0,0,115,8, 0,0,0,0,2,18,1,8,2,4,3,122,38,95,78,97, @@ -1853,188 +1833,182 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 109,101,115,99,1,0,0,0,0,0,0,0,3,0,0,0, 3,0,0,0,67,0,0,0,115,28,0,0,0,124,0,160, 0,161,0,92,2,125,1,125,2,116,1,116,2,106,3,124, - 1,25,0,124,2,131,2,83,0,41,1,78,41,4,114,254, - 0,0,0,114,118,0,0,0,114,6,0,0,0,218,7,109, - 111,100,117,108,101,115,41,3,114,108,0,0,0,90,18,112, - 97,114,101,110,116,95,109,111,100,117,108,101,95,110,97,109, - 101,90,14,112,97,116,104,95,97,116,116,114,95,110,97,109, - 101,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, - 114,249,0,0,0,122,4,0,0,115,4,0,0,0,0,1, - 12,1,122,31,95,78,97,109,101,115,112,97,99,101,80,97, - 116,104,46,95,103,101,116,95,112,97,114,101,110,116,95,112, - 97,116,104,99,1,0,0,0,0,0,0,0,3,0,0,0, - 4,0,0,0,67,0,0,0,115,80,0,0,0,116,0,124, - 0,160,1,161,0,131,1,125,1,124,1,124,0,106,2,107, - 3,114,74,124,0,160,3,124,0,106,4,124,1,161,2,125, - 2,124,2,100,0,107,9,114,68,124,2,106,5,100,0,107, - 8,114,68,124,2,106,6,114,68,124,2,106,6,124,0,95, - 7,124,1,124,0,95,2,124,0,106,7,83,0,41,1,78, - 41,8,114,102,0,0,0,114,249,0,0,0,114,250,0,0, - 0,114,251,0,0,0,114,247,0,0,0,114,128,0,0,0, - 114,163,0,0,0,114,248,0,0,0,41,3,114,108,0,0, - 0,90,11,112,97,114,101,110,116,95,112,97,116,104,114,171, - 0,0,0,114,2,0,0,0,114,2,0,0,0,114,4,0, - 0,0,218,12,95,114,101,99,97,108,99,117,108,97,116,101, - 126,4,0,0,115,16,0,0,0,0,2,12,1,10,1,14, - 3,18,1,6,1,8,1,6,1,122,27,95,78,97,109,101, - 115,112,97,99,101,80,97,116,104,46,95,114,101,99,97,108, - 99,117,108,97,116,101,99,1,0,0,0,0,0,0,0,1, - 0,0,0,3,0,0,0,67,0,0,0,115,12,0,0,0, - 116,0,124,0,160,1,161,0,131,1,83,0,41,1,78,41, - 2,114,231,0,0,0,114,0,1,0,0,41,1,114,108,0, - 0,0,114,2,0,0,0,114,2,0,0,0,114,4,0,0, - 0,218,8,95,95,105,116,101,114,95,95,139,4,0,0,115, - 2,0,0,0,0,1,122,23,95,78,97,109,101,115,112,97, - 99,101,80,97,116,104,46,95,95,105,116,101,114,95,95,99, - 3,0,0,0,0,0,0,0,3,0,0,0,3,0,0,0, - 67,0,0,0,115,14,0,0,0,124,2,124,0,106,0,124, - 1,60,0,100,0,83,0,41,1,78,41,1,114,248,0,0, - 0,41,3,114,108,0,0,0,218,5,105,110,100,101,120,114, - 39,0,0,0,114,2,0,0,0,114,2,0,0,0,114,4, - 0,0,0,218,11,95,95,115,101,116,105,116,101,109,95,95, - 142,4,0,0,115,2,0,0,0,0,1,122,26,95,78,97, - 109,101,115,112,97,99,101,80,97,116,104,46,95,95,115,101, - 116,105,116,101,109,95,95,99,1,0,0,0,0,0,0,0, - 1,0,0,0,3,0,0,0,67,0,0,0,115,12,0,0, - 0,116,0,124,0,160,1,161,0,131,1,83,0,41,1,78, - 41,2,114,18,0,0,0,114,0,1,0,0,41,1,114,108, - 0,0,0,114,2,0,0,0,114,2,0,0,0,114,4,0, - 0,0,218,7,95,95,108,101,110,95,95,145,4,0,0,115, - 2,0,0,0,0,1,122,22,95,78,97,109,101,115,112,97, - 99,101,80,97,116,104,46,95,95,108,101,110,95,95,99,1, - 0,0,0,0,0,0,0,1,0,0,0,3,0,0,0,67, - 0,0,0,115,12,0,0,0,100,1,160,0,124,0,106,1, - 161,1,83,0,41,2,78,122,20,95,78,97,109,101,115,112, - 97,99,101,80,97,116,104,40,123,33,114,125,41,41,2,114, - 54,0,0,0,114,248,0,0,0,41,1,114,108,0,0,0, - 114,2,0,0,0,114,2,0,0,0,114,4,0,0,0,218, - 8,95,95,114,101,112,114,95,95,148,4,0,0,115,2,0, - 0,0,0,1,122,23,95,78,97,109,101,115,112,97,99,101, - 80,97,116,104,46,95,95,114,101,112,114,95,95,99,2,0, - 0,0,0,0,0,0,2,0,0,0,3,0,0,0,67,0, - 0,0,115,12,0,0,0,124,1,124,0,160,0,161,0,107, - 6,83,0,41,1,78,41,1,114,0,1,0,0,41,2,114, - 108,0,0,0,218,4,105,116,101,109,114,2,0,0,0,114, - 2,0,0,0,114,4,0,0,0,218,12,95,95,99,111,110, - 116,97,105,110,115,95,95,151,4,0,0,115,2,0,0,0, - 0,1,122,27,95,78,97,109,101,115,112,97,99,101,80,97, - 116,104,46,95,95,99,111,110,116,97,105,110,115,95,95,99, - 2,0,0,0,0,0,0,0,2,0,0,0,3,0,0,0, - 67,0,0,0,115,16,0,0,0,124,0,106,0,160,1,124, - 1,161,1,1,0,100,0,83,0,41,1,78,41,2,114,248, - 0,0,0,114,170,0,0,0,41,2,114,108,0,0,0,114, - 6,1,0,0,114,2,0,0,0,114,2,0,0,0,114,4, - 0,0,0,114,170,0,0,0,154,4,0,0,115,2,0,0, - 0,0,1,122,21,95,78,97,109,101,115,112,97,99,101,80, - 97,116,104,46,97,112,112,101,110,100,78,41,14,114,113,0, - 0,0,114,112,0,0,0,114,114,0,0,0,114,115,0,0, - 0,114,191,0,0,0,114,254,0,0,0,114,249,0,0,0, - 114,0,1,0,0,114,1,1,0,0,114,3,1,0,0,114, - 4,1,0,0,114,5,1,0,0,114,7,1,0,0,114,170, - 0,0,0,114,2,0,0,0,114,2,0,0,0,114,2,0, - 0,0,114,4,0,0,0,114,246,0,0,0,99,4,0,0, - 115,22,0,0,0,8,5,4,2,8,6,8,10,8,4,8, - 13,8,3,8,3,8,3,8,3,8,3,114,246,0,0,0, - 99,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0, - 0,64,0,0,0,115,80,0,0,0,101,0,90,1,100,0, - 90,2,100,1,100,2,132,0,90,3,101,4,100,3,100,4, - 132,0,131,1,90,5,100,5,100,6,132,0,90,6,100,7, - 100,8,132,0,90,7,100,9,100,10,132,0,90,8,100,11, - 100,12,132,0,90,9,100,13,100,14,132,0,90,10,100,15, - 100,16,132,0,90,11,100,17,83,0,41,18,218,16,95,78, - 97,109,101,115,112,97,99,101,76,111,97,100,101,114,99,4, - 0,0,0,0,0,0,0,4,0,0,0,4,0,0,0,67, - 0,0,0,115,18,0,0,0,116,0,124,1,124,2,124,3, - 131,3,124,0,95,1,100,0,83,0,41,1,78,41,2,114, - 246,0,0,0,114,248,0,0,0,41,4,114,108,0,0,0, - 114,106,0,0,0,114,39,0,0,0,114,252,0,0,0,114, - 2,0,0,0,114,2,0,0,0,114,4,0,0,0,114,191, - 0,0,0,160,4,0,0,115,2,0,0,0,0,1,122,25, - 95,78,97,109,101,115,112,97,99,101,76,111,97,100,101,114, - 46,95,95,105,110,105,116,95,95,99,2,0,0,0,0,0, - 0,0,2,0,0,0,3,0,0,0,67,0,0,0,115,12, - 0,0,0,100,1,160,0,124,1,106,1,161,1,83,0,41, - 2,122,115,82,101,116,117,114,110,32,114,101,112,114,32,102, - 111,114,32,116,104,101,32,109,111,100,117,108,101,46,10,10, - 32,32,32,32,32,32,32,32,84,104,101,32,109,101,116,104, - 111,100,32,105,115,32,100,101,112,114,101,99,97,116,101,100, - 46,32,32,84,104,101,32,105,109,112,111,114,116,32,109,97, - 99,104,105,110,101,114,121,32,100,111,101,115,32,116,104,101, - 32,106,111,98,32,105,116,115,101,108,102,46,10,10,32,32, - 32,32,32,32,32,32,122,25,60,109,111,100,117,108,101,32, - 123,33,114,125,32,40,110,97,109,101,115,112,97,99,101,41, - 62,41,2,114,54,0,0,0,114,113,0,0,0,41,2,114, - 177,0,0,0,114,196,0,0,0,114,2,0,0,0,114,2, - 0,0,0,114,4,0,0,0,218,11,109,111,100,117,108,101, - 95,114,101,112,114,163,4,0,0,115,2,0,0,0,0,7, - 122,28,95,78,97,109,101,115,112,97,99,101,76,111,97,100, - 101,114,46,109,111,100,117,108,101,95,114,101,112,114,99,2, - 0,0,0,0,0,0,0,2,0,0,0,1,0,0,0,67, - 0,0,0,115,4,0,0,0,100,1,83,0,41,2,78,84, - 114,2,0,0,0,41,2,114,108,0,0,0,114,127,0,0, - 0,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, - 114,166,0,0,0,172,4,0,0,115,2,0,0,0,0,1, - 122,27,95,78,97,109,101,115,112,97,99,101,76,111,97,100, - 101,114,46,105,115,95,112,97,99,107,97,103,101,99,2,0, - 0,0,0,0,0,0,2,0,0,0,1,0,0,0,67,0, - 0,0,115,4,0,0,0,100,1,83,0,41,2,78,114,35, - 0,0,0,114,2,0,0,0,41,2,114,108,0,0,0,114, - 127,0,0,0,114,2,0,0,0,114,2,0,0,0,114,4, - 0,0,0,114,207,0,0,0,175,4,0,0,115,2,0,0, - 0,0,1,122,27,95,78,97,109,101,115,112,97,99,101,76, - 111,97,100,101,114,46,103,101,116,95,115,111,117,114,99,101, - 99,2,0,0,0,0,0,0,0,2,0,0,0,6,0,0, - 0,67,0,0,0,115,16,0,0,0,116,0,100,1,100,2, - 100,3,100,4,100,5,141,4,83,0,41,6,78,114,35,0, - 0,0,122,8,60,115,116,114,105,110,103,62,114,195,0,0, - 0,84,41,1,114,209,0,0,0,41,1,114,210,0,0,0, - 41,2,114,108,0,0,0,114,127,0,0,0,114,2,0,0, - 0,114,2,0,0,0,114,4,0,0,0,114,193,0,0,0, - 178,4,0,0,115,2,0,0,0,0,1,122,25,95,78,97, - 109,101,115,112,97,99,101,76,111,97,100,101,114,46,103,101, - 116,95,99,111,100,101,99,2,0,0,0,0,0,0,0,2, - 0,0,0,1,0,0,0,67,0,0,0,115,4,0,0,0, - 100,1,83,0,41,2,122,42,85,115,101,32,100,101,102,97, - 117,108,116,32,115,101,109,97,110,116,105,99,115,32,102,111, - 114,32,109,111,100,117,108,101,32,99,114,101,97,116,105,111, - 110,46,78,114,2,0,0,0,41,2,114,108,0,0,0,114, - 171,0,0,0,114,2,0,0,0,114,2,0,0,0,114,4, - 0,0,0,114,192,0,0,0,181,4,0,0,115,2,0,0, - 0,0,1,122,30,95,78,97,109,101,115,112,97,99,101,76, - 111,97,100,101,114,46,99,114,101,97,116,101,95,109,111,100, - 117,108,101,99,2,0,0,0,0,0,0,0,2,0,0,0, - 1,0,0,0,67,0,0,0,115,4,0,0,0,100,0,83, - 0,41,1,78,114,2,0,0,0,41,2,114,108,0,0,0, - 114,196,0,0,0,114,2,0,0,0,114,2,0,0,0,114, - 4,0,0,0,114,197,0,0,0,184,4,0,0,115,2,0, - 0,0,0,1,122,28,95,78,97,109,101,115,112,97,99,101, - 76,111,97,100,101,114,46,101,120,101,99,95,109,111,100,117, - 108,101,99,2,0,0,0,0,0,0,0,2,0,0,0,4, - 0,0,0,67,0,0,0,115,26,0,0,0,116,0,160,1, - 100,1,124,0,106,2,161,2,1,0,116,0,160,3,124,0, - 124,1,161,2,83,0,41,2,122,98,76,111,97,100,32,97, - 32,110,97,109,101,115,112,97,99,101,32,109,111,100,117,108, - 101,46,10,10,32,32,32,32,32,32,32,32,84,104,105,115, - 32,109,101,116,104,111,100,32,105,115,32,100,101,112,114,101, - 99,97,116,101,100,46,32,32,85,115,101,32,101,120,101,99, - 95,109,111,100,117,108,101,40,41,32,105,110,115,116,101,97, - 100,46,10,10,32,32,32,32,32,32,32,32,122,38,110,97, - 109,101,115,112,97,99,101,32,109,111,100,117,108,101,32,108, - 111,97,100,101,100,32,119,105,116,104,32,112,97,116,104,32, - 123,33,114,125,41,4,114,122,0,0,0,114,136,0,0,0, - 114,248,0,0,0,114,198,0,0,0,41,2,114,108,0,0, - 0,114,127,0,0,0,114,2,0,0,0,114,2,0,0,0, - 114,4,0,0,0,114,199,0,0,0,187,4,0,0,115,8, + 1,25,0,124,2,131,2,83,0,114,110,0,0,0,41,4, + 114,30,1,0,0,114,130,0,0,0,114,8,0,0,0,218, + 7,109,111,100,117,108,101,115,41,3,114,119,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,3,0,0,0,114,3,0,0,0,114,6,0, + 0,0,114,25,1,0,0,122,4,0,0,115,4,0,0,0, + 0,1,12,1,122,31,95,78,97,109,101,115,112,97,99,101, + 80,97,116,104,46,95,103,101,116,95,112,97,114,101,110,116, + 95,112,97,116,104,99,1,0,0,0,0,0,0,0,3,0, + 0,0,4,0,0,0,67,0,0,0,115,80,0,0,0,116, + 0,124,0,160,1,161,0,131,1,125,1,124,1,124,0,106, + 2,107,3,114,74,124,0,160,3,124,0,106,4,124,1,161, + 2,125,2,124,2,100,0,107,9,114,68,124,2,106,5,100, + 0,107,8,114,68,124,2,106,6,114,68,124,2,106,6,124, + 0,95,7,124,1,124,0,95,2,124,0,106,7,83,0,114, + 110,0,0,0,41,8,114,112,0,0,0,114,25,1,0,0, + 114,26,1,0,0,114,27,1,0,0,114,23,1,0,0,114, + 140,0,0,0,114,178,0,0,0,114,24,1,0,0,41,3, + 114,119,0,0,0,90,11,112,97,114,101,110,116,95,112,97, + 116,104,114,187,0,0,0,114,3,0,0,0,114,3,0,0, + 0,114,6,0,0,0,218,12,95,114,101,99,97,108,99,117, + 108,97,116,101,126,4,0,0,115,16,0,0,0,0,2,12, + 1,10,1,14,3,18,1,6,1,8,1,6,1,122,27,95, + 78,97,109,101,115,112,97,99,101,80,97,116,104,46,95,114, + 101,99,97,108,99,117,108,97,116,101,99,1,0,0,0,0, + 0,0,0,1,0,0,0,3,0,0,0,67,0,0,0,115, + 12,0,0,0,116,0,124,0,160,1,161,0,131,1,83,0, + 114,110,0,0,0,41,2,114,5,1,0,0,114,32,1,0, + 0,114,246,0,0,0,114,3,0,0,0,114,3,0,0,0, + 114,6,0,0,0,218,8,95,95,105,116,101,114,95,95,139, + 4,0,0,115,2,0,0,0,0,1,122,23,95,78,97,109, + 101,115,112,97,99,101,80,97,116,104,46,95,95,105,116,101, + 114,95,95,99,3,0,0,0,0,0,0,0,3,0,0,0, + 3,0,0,0,67,0,0,0,115,14,0,0,0,124,2,124, + 0,106,0,124,1,60,0,100,0,83,0,114,110,0,0,0, + 41,1,114,24,1,0,0,41,3,114,119,0,0,0,218,5, + 105,110,100,101,120,114,44,0,0,0,114,3,0,0,0,114, + 3,0,0,0,114,6,0,0,0,218,11,95,95,115,101,116, + 105,116,101,109,95,95,142,4,0,0,115,2,0,0,0,0, + 1,122,26,95,78,97,109,101,115,112,97,99,101,80,97,116, + 104,46,95,95,115,101,116,105,116,101,109,95,95,99,1,0, + 0,0,0,0,0,0,1,0,0,0,3,0,0,0,67,0, + 0,0,115,12,0,0,0,116,0,124,0,160,1,161,0,131, + 1,83,0,114,110,0,0,0,41,2,114,22,0,0,0,114, + 32,1,0,0,114,246,0,0,0,114,3,0,0,0,114,3, + 0,0,0,114,6,0,0,0,218,7,95,95,108,101,110,95, + 95,145,4,0,0,115,2,0,0,0,0,1,122,22,95,78, + 97,109,101,115,112,97,99,101,80,97,116,104,46,95,95,108, + 101,110,95,95,99,1,0,0,0,0,0,0,0,1,0,0, + 0,3,0,0,0,67,0,0,0,115,12,0,0,0,100,1, + 160,0,124,0,106,1,161,1,83,0,41,2,78,122,20,95, + 78,97,109,101,115,112,97,99,101,80,97,116,104,40,123,33, + 114,125,41,41,2,114,62,0,0,0,114,24,1,0,0,114, + 246,0,0,0,114,3,0,0,0,114,3,0,0,0,114,6, + 0,0,0,218,8,95,95,114,101,112,114,95,95,148,4,0, + 0,115,2,0,0,0,0,1,122,23,95,78,97,109,101,115, + 112,97,99,101,80,97,116,104,46,95,95,114,101,112,114,95, + 95,99,2,0,0,0,0,0,0,0,2,0,0,0,3,0, + 0,0,67,0,0,0,115,12,0,0,0,124,1,124,0,160, + 0,161,0,107,6,83,0,114,110,0,0,0,41,1,114,32, + 1,0,0,169,2,114,119,0,0,0,218,4,105,116,101,109, + 114,3,0,0,0,114,3,0,0,0,114,6,0,0,0,218, + 12,95,95,99,111,110,116,97,105,110,115,95,95,151,4,0, + 0,115,2,0,0,0,0,1,122,27,95,78,97,109,101,115, + 112,97,99,101,80,97,116,104,46,95,95,99,111,110,116,97, + 105,110,115,95,95,99,2,0,0,0,0,0,0,0,2,0, + 0,0,3,0,0,0,67,0,0,0,115,16,0,0,0,124, + 0,106,0,160,1,124,1,161,1,1,0,100,0,83,0,114, + 110,0,0,0,41,2,114,24,1,0,0,114,186,0,0,0, + 114,38,1,0,0,114,3,0,0,0,114,3,0,0,0,114, + 6,0,0,0,114,186,0,0,0,154,4,0,0,115,2,0, + 0,0,0,1,122,21,95,78,97,109,101,115,112,97,99,101, + 80,97,116,104,46,97,112,112,101,110,100,78,41,14,114,125, + 0,0,0,114,124,0,0,0,114,126,0,0,0,114,127,0, + 0,0,114,209,0,0,0,114,30,1,0,0,114,25,1,0, + 0,114,32,1,0,0,114,33,1,0,0,114,35,1,0,0, + 114,36,1,0,0,114,37,1,0,0,114,40,1,0,0,114, + 186,0,0,0,114,3,0,0,0,114,3,0,0,0,114,3, + 0,0,0,114,6,0,0,0,114,22,1,0,0,99,4,0, + 0,115,22,0,0,0,8,5,4,2,8,6,8,10,8,4, + 8,13,8,3,8,3,8,3,8,3,8,3,114,22,1,0, + 0,99,0,0,0,0,0,0,0,0,0,0,0,0,3,0, + 0,0,64,0,0,0,115,80,0,0,0,101,0,90,1,100, + 0,90,2,100,1,100,2,132,0,90,3,101,4,100,3,100, + 4,132,0,131,1,90,5,100,5,100,6,132,0,90,6,100, + 7,100,8,132,0,90,7,100,9,100,10,132,0,90,8,100, + 11,100,12,132,0,90,9,100,13,100,14,132,0,90,10,100, + 15,100,16,132,0,90,11,100,17,83,0,41,18,218,16,95, + 78,97,109,101,115,112,97,99,101,76,111,97,100,101,114,99, + 4,0,0,0,0,0,0,0,4,0,0,0,4,0,0,0, + 67,0,0,0,115,18,0,0,0,116,0,124,1,124,2,124, + 3,131,3,124,0,95,1,100,0,83,0,114,110,0,0,0, + 41,2,114,22,1,0,0,114,24,1,0,0,114,28,1,0, + 0,114,3,0,0,0,114,3,0,0,0,114,6,0,0,0, + 114,209,0,0,0,160,4,0,0,115,2,0,0,0,0,1, + 122,25,95,78,97,109,101,115,112,97,99,101,76,111,97,100, + 101,114,46,95,95,105,110,105,116,95,95,99,2,0,0,0, + 0,0,0,0,2,0,0,0,3,0,0,0,67,0,0,0, + 115,12,0,0,0,100,1,160,0,124,1,106,1,161,1,83, + 0,41,2,122,115,82,101,116,117,114,110,32,114,101,112,114, + 32,102,111,114,32,116,104,101,32,109,111,100,117,108,101,46, + 10,10,32,32,32,32,32,32,32,32,84,104,101,32,109,101, + 116,104,111,100,32,105,115,32,100,101,112,114,101,99,97,116, + 101,100,46,32,32,84,104,101,32,105,109,112,111,114,116,32, + 109,97,99,104,105,110,101,114,121,32,100,111,101,115,32,116, + 104,101,32,106,111,98,32,105,116,115,101,108,102,46,10,10, + 32,32,32,32,32,32,32,32,122,25,60,109,111,100,117,108, + 101,32,123,33,114,125,32,40,110,97,109,101,115,112,97,99, + 101,41,62,41,2,114,62,0,0,0,114,125,0,0,0,41, + 2,114,193,0,0,0,114,216,0,0,0,114,3,0,0,0, + 114,3,0,0,0,114,6,0,0,0,218,11,109,111,100,117, + 108,101,95,114,101,112,114,163,4,0,0,115,2,0,0,0, + 0,7,122,28,95,78,97,109,101,115,112,97,99,101,76,111, + 97,100,101,114,46,109,111,100,117,108,101,95,114,101,112,114, + 99,2,0,0,0,0,0,0,0,2,0,0,0,1,0,0, + 0,67,0,0,0,115,4,0,0,0,100,1,83,0,41,2, + 78,84,114,3,0,0,0,114,219,0,0,0,114,3,0,0, + 0,114,3,0,0,0,114,6,0,0,0,114,182,0,0,0, + 172,4,0,0,115,2,0,0,0,0,1,122,27,95,78,97, + 109,101,115,112,97,99,101,76,111,97,100,101,114,46,105,115, + 95,112,97,99,107,97,103,101,99,2,0,0,0,0,0,0, + 0,2,0,0,0,1,0,0,0,67,0,0,0,115,4,0, + 0,0,100,1,83,0,41,2,78,114,40,0,0,0,114,3, + 0,0,0,114,219,0,0,0,114,3,0,0,0,114,3,0, + 0,0,114,6,0,0,0,114,229,0,0,0,175,4,0,0, + 115,2,0,0,0,0,1,122,27,95,78,97,109,101,115,112, + 97,99,101,76,111,97,100,101,114,46,103,101,116,95,115,111, + 117,114,99,101,99,2,0,0,0,0,0,0,0,2,0,0, + 0,6,0,0,0,67,0,0,0,115,16,0,0,0,116,0, + 100,1,100,2,100,3,100,4,100,5,141,4,83,0,41,6, + 78,114,40,0,0,0,122,8,60,115,116,114,105,110,103,62, + 114,215,0,0,0,84,41,1,114,231,0,0,0,41,1,114, + 232,0,0,0,114,219,0,0,0,114,3,0,0,0,114,3, + 0,0,0,114,6,0,0,0,114,213,0,0,0,178,4,0, + 0,115,2,0,0,0,0,1,122,25,95,78,97,109,101,115, + 112,97,99,101,76,111,97,100,101,114,46,103,101,116,95,99, + 111,100,101,99,2,0,0,0,0,0,0,0,2,0,0,0, + 1,0,0,0,67,0,0,0,115,4,0,0,0,100,1,83, + 0,114,210,0,0,0,114,3,0,0,0,114,211,0,0,0, + 114,3,0,0,0,114,3,0,0,0,114,6,0,0,0,114, + 212,0,0,0,181,4,0,0,115,2,0,0,0,0,1,122, + 30,95,78,97,109,101,115,112,97,99,101,76,111,97,100,101, + 114,46,99,114,101,97,116,101,95,109,111,100,117,108,101,99, + 2,0,0,0,0,0,0,0,2,0,0,0,1,0,0,0, + 67,0,0,0,115,4,0,0,0,100,0,83,0,114,110,0, + 0,0,114,3,0,0,0,114,252,0,0,0,114,3,0,0, + 0,114,3,0,0,0,114,6,0,0,0,114,217,0,0,0, + 184,4,0,0,115,2,0,0,0,0,1,122,28,95,78,97, + 109,101,115,112,97,99,101,76,111,97,100,101,114,46,101,120, + 101,99,95,109,111,100,117,108,101,99,2,0,0,0,0,0, + 0,0,2,0,0,0,4,0,0,0,67,0,0,0,115,26, + 0,0,0,116,0,160,1,100,1,124,0,106,2,161,2,1, + 0,116,0,160,3,124,0,124,1,161,2,83,0,41,2,122, + 98,76,111,97,100,32,97,32,110,97,109,101,115,112,97,99, + 101,32,109,111,100,117,108,101,46,10,10,32,32,32,32,32, + 32,32,32,84,104,105,115,32,109,101,116,104,111,100,32,105, + 115,32,100,101,112,114,101,99,97,116,101,100,46,32,32,85, + 115,101,32,101,120,101,99,95,109,111,100,117,108,101,40,41, + 32,105,110,115,116,101,97,100,46,10,10,32,32,32,32,32, + 32,32,32,122,38,110,97,109,101,115,112,97,99,101,32,109, + 111,100,117,108,101,32,108,111,97,100,101,100,32,119,105,116, + 104,32,112,97,116,104,32,123,33,114,125,41,4,114,134,0, + 0,0,114,149,0,0,0,114,24,1,0,0,114,218,0,0, + 0,114,219,0,0,0,114,3,0,0,0,114,3,0,0,0, + 114,6,0,0,0,114,220,0,0,0,187,4,0,0,115,8, 0,0,0,0,7,6,1,4,255,4,2,122,28,95,78,97, 109,101,115,112,97,99,101,76,111,97,100,101,114,46,108,111, - 97,100,95,109,111,100,117,108,101,78,41,12,114,113,0,0, - 0,114,112,0,0,0,114,114,0,0,0,114,191,0,0,0, - 114,189,0,0,0,114,9,1,0,0,114,166,0,0,0,114, - 207,0,0,0,114,193,0,0,0,114,192,0,0,0,114,197, - 0,0,0,114,199,0,0,0,114,2,0,0,0,114,2,0, - 0,0,114,2,0,0,0,114,4,0,0,0,114,8,1,0, + 97,100,95,109,111,100,117,108,101,78,41,12,114,125,0,0, + 0,114,124,0,0,0,114,126,0,0,0,114,209,0,0,0, + 114,207,0,0,0,114,42,1,0,0,114,182,0,0,0,114, + 229,0,0,0,114,213,0,0,0,114,212,0,0,0,114,217, + 0,0,0,114,220,0,0,0,114,3,0,0,0,114,3,0, + 0,0,114,3,0,0,0,114,6,0,0,0,114,41,1,0, 0,159,4,0,0,115,18,0,0,0,8,1,8,3,2,1, - 10,8,8,3,8,3,8,3,8,3,8,3,114,8,1,0, + 10,8,8,3,8,3,8,3,8,3,8,3,114,41,1,0, 0,99,0,0,0,0,0,0,0,0,0,0,0,0,4,0, 0,0,64,0,0,0,115,106,0,0,0,101,0,90,1,100, 0,90,2,100,1,90,3,101,4,100,2,100,3,132,0,131, @@ -2063,12 +2037,12 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 101,114,95,99,97,99,104,101,115,32,40,119,104,101,114,101, 32,105,109,112,108,101,109,101,110,116,101,100,41,46,78,218, 17,105,110,118,97,108,105,100,97,116,101,95,99,97,99,104, - 101,115,41,6,218,4,108,105,115,116,114,6,0,0,0,218, + 101,115,41,6,218,4,108,105,115,116,114,8,0,0,0,218, 19,112,97,116,104,95,105,109,112,111,114,116,101,114,95,99, - 97,99,104,101,218,5,105,116,101,109,115,114,116,0,0,0, - 114,11,1,0,0,41,3,114,177,0,0,0,114,106,0,0, - 0,218,6,102,105,110,100,101,114,114,2,0,0,0,114,2, - 0,0,0,114,4,0,0,0,114,11,1,0,0,205,4,0, + 97,99,104,101,218,5,105,116,101,109,115,114,128,0,0,0, + 114,44,1,0,0,41,3,114,193,0,0,0,114,117,0,0, + 0,218,6,102,105,110,100,101,114,114,3,0,0,0,114,3, + 0,0,0,114,6,0,0,0,114,44,1,0,0,205,4,0, 0,115,10,0,0,0,0,4,22,1,8,1,10,1,10,1, 122,28,80,97,116,104,70,105,110,100,101,114,46,105,110,118, 97,108,105,100,97,116,101,95,99,97,99,104,101,115,99,2, @@ -2083,11 +2057,11 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 104,111,111,107,115,32,102,111,114,32,97,32,102,105,110,100, 101,114,32,102,111,114,32,39,112,97,116,104,39,46,78,122, 23,115,121,115,46,112,97,116,104,95,104,111,111,107,115,32, - 105,115,32,101,109,112,116,121,41,6,114,6,0,0,0,218, - 10,112,97,116,104,95,104,111,111,107,115,114,66,0,0,0, - 114,67,0,0,0,114,126,0,0,0,114,107,0,0,0,41, - 3,114,177,0,0,0,114,39,0,0,0,90,4,104,111,111, - 107,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, + 105,115,32,101,109,112,116,121,41,6,114,8,0,0,0,218, + 10,112,97,116,104,95,104,111,111,107,115,114,75,0,0,0, + 114,76,0,0,0,114,138,0,0,0,114,118,0,0,0,41, + 3,114,193,0,0,0,114,44,0,0,0,90,4,104,111,111, + 107,114,3,0,0,0,114,3,0,0,0,114,6,0,0,0, 218,11,95,112,97,116,104,95,104,111,111,107,115,215,4,0, 0,115,16,0,0,0,0,3,16,1,12,1,10,1,2,1, 14,1,14,1,12,2,122,22,80,97,116,104,70,105,110,100, @@ -2113,12 +2087,12 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 101,32,105,116,46,32,73,102,32,110,111,32,102,105,110,100, 101,114,32,105,115,32,97,118,97,105,108,97,98,108,101,44, 32,115,116,111,114,101,32,78,111,110,101,46,10,10,32,32, - 32,32,32,32,32,32,114,35,0,0,0,78,41,7,114,1, - 0,0,0,114,49,0,0,0,114,229,0,0,0,114,6,0, - 0,0,114,13,1,0,0,218,8,75,101,121,69,114,114,111, - 114,114,17,1,0,0,41,3,114,177,0,0,0,114,39,0, - 0,0,114,15,1,0,0,114,2,0,0,0,114,2,0,0, - 0,114,4,0,0,0,218,20,95,112,97,116,104,95,105,109, + 32,32,32,32,32,32,114,40,0,0,0,78,41,7,114,2, + 0,0,0,114,55,0,0,0,114,2,1,0,0,114,8,0, + 0,0,114,46,1,0,0,218,8,75,101,121,69,114,114,111, + 114,114,50,1,0,0,41,3,114,193,0,0,0,114,44,0, + 0,0,114,48,1,0,0,114,3,0,0,0,114,3,0,0, + 0,114,6,0,0,0,218,20,95,112,97,116,104,95,105,109, 112,111,114,116,101,114,95,99,97,99,104,101,228,4,0,0, 115,22,0,0,0,0,8,8,1,2,1,12,1,14,3,8, 1,2,1,14,1,14,1,10,1,16,1,122,31,80,97,116, @@ -2130,13 +2104,13 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 124,2,160,2,124,1,161,1,125,3,103,0,125,4,124,3, 100,0,107,9,114,60,116,3,160,4,124,1,124,3,161,2, 83,0,116,3,160,5,124,1,100,0,161,2,125,5,124,4, - 124,5,95,6,124,5,83,0,41,2,78,114,125,0,0,0, - 41,7,114,116,0,0,0,114,125,0,0,0,114,188,0,0, - 0,114,122,0,0,0,114,185,0,0,0,114,167,0,0,0, - 114,163,0,0,0,41,6,114,177,0,0,0,114,127,0,0, - 0,114,15,1,0,0,114,128,0,0,0,114,129,0,0,0, - 114,171,0,0,0,114,2,0,0,0,114,2,0,0,0,114, - 4,0,0,0,218,16,95,108,101,103,97,99,121,95,103,101, + 124,5,95,6,124,5,83,0,41,2,78,114,137,0,0,0, + 41,7,114,128,0,0,0,114,137,0,0,0,114,206,0,0, + 0,114,134,0,0,0,114,201,0,0,0,114,183,0,0,0, + 114,178,0,0,0,41,6,114,193,0,0,0,114,139,0,0, + 0,114,48,1,0,0,114,140,0,0,0,114,141,0,0,0, + 114,187,0,0,0,114,3,0,0,0,114,3,0,0,0,114, + 6,0,0,0,218,16,95,108,101,103,97,99,121,95,103,101, 116,95,115,112,101,99,250,4,0,0,115,18,0,0,0,0, 4,10,1,16,2,10,1,4,1,8,1,12,1,12,1,6, 1,122,27,80,97,116,104,70,105,110,100,101,114,46,95,108, @@ -2157,17 +2131,17 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 101,114,32,111,114,32,110,97,109,101,115,112,97,99,101,95, 112,97,116,104,32,102,111,114,32,116,104,105,115,32,109,111, 100,117,108,101,47,112,97,99,107,97,103,101,32,110,97,109, - 101,46,78,114,187,0,0,0,122,19,115,112,101,99,32,109, + 101,46,78,114,203,0,0,0,122,19,115,112,101,99,32,109, 105,115,115,105,110,103,32,108,111,97,100,101,114,41,13,114, - 147,0,0,0,114,76,0,0,0,218,5,98,121,116,101,115, - 114,19,1,0,0,114,116,0,0,0,114,187,0,0,0,114, - 20,1,0,0,114,128,0,0,0,114,163,0,0,0,114,107, - 0,0,0,114,153,0,0,0,114,122,0,0,0,114,167,0, - 0,0,41,9,114,177,0,0,0,114,127,0,0,0,114,39, - 0,0,0,114,186,0,0,0,218,14,110,97,109,101,115,112, + 161,0,0,0,114,85,0,0,0,218,5,98,121,116,101,115, + 114,52,1,0,0,114,128,0,0,0,114,203,0,0,0,114, + 53,1,0,0,114,140,0,0,0,114,178,0,0,0,114,118, + 0,0,0,114,167,0,0,0,114,134,0,0,0,114,183,0, + 0,0,41,9,114,193,0,0,0,114,139,0,0,0,114,44, + 0,0,0,114,202,0,0,0,218,14,110,97,109,101,115,112, 97,99,101,95,112,97,116,104,90,5,101,110,116,114,121,114, - 15,1,0,0,114,171,0,0,0,114,129,0,0,0,114,2, - 0,0,0,114,2,0,0,0,114,4,0,0,0,218,9,95, + 48,1,0,0,114,187,0,0,0,114,141,0,0,0,114,3, + 0,0,0,114,3,0,0,0,114,6,0,0,0,218,9,95, 103,101,116,95,115,112,101,99,9,5,0,0,115,40,0,0, 0,0,5,4,1,8,1,14,1,2,1,10,1,8,1,10, 1,14,2,12,1,8,1,2,1,10,1,8,1,6,1,8, @@ -2190,12 +2164,12 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 116,104,95,104,111,111,107,115,32,97,110,100,32,115,121,115, 46,112,97,116,104,95,105,109,112,111,114,116,101,114,95,99, 97,99,104,101,46,10,32,32,32,32,32,32,32,32,78,41, - 7,114,6,0,0,0,114,39,0,0,0,114,23,1,0,0, - 114,128,0,0,0,114,163,0,0,0,114,165,0,0,0,114, - 246,0,0,0,41,6,114,177,0,0,0,114,127,0,0,0, - 114,39,0,0,0,114,186,0,0,0,114,171,0,0,0,114, - 22,1,0,0,114,2,0,0,0,114,2,0,0,0,114,4, - 0,0,0,114,187,0,0,0,41,5,0,0,115,26,0,0, + 7,114,8,0,0,0,114,44,0,0,0,114,56,1,0,0, + 114,140,0,0,0,114,178,0,0,0,114,181,0,0,0,114, + 22,1,0,0,41,6,114,193,0,0,0,114,139,0,0,0, + 114,44,0,0,0,114,202,0,0,0,114,187,0,0,0,114, + 55,1,0,0,114,3,0,0,0,114,3,0,0,0,114,6, + 0,0,0,114,203,0,0,0,41,5,0,0,115,26,0,0, 0,0,6,8,1,6,1,14,1,8,1,4,1,10,1,6, 1,4,3,6,1,16,1,4,2,6,2,122,20,80,97,116, 104,70,105,110,100,101,114,46,102,105,110,100,95,115,112,101, @@ -2213,471 +2187,467 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 116,104,111,100,32,105,115,32,100,101,112,114,101,99,97,116, 101,100,46,32,32,85,115,101,32,102,105,110,100,95,115,112, 101,99,40,41,32,105,110,115,116,101,97,100,46,10,10,32, - 32,32,32,32,32,32,32,78,41,2,114,187,0,0,0,114, - 128,0,0,0,41,4,114,177,0,0,0,114,127,0,0,0, - 114,39,0,0,0,114,171,0,0,0,114,2,0,0,0,114, - 2,0,0,0,114,4,0,0,0,114,188,0,0,0,65,5, - 0,0,115,8,0,0,0,0,8,12,1,8,1,4,1,122, - 22,80,97,116,104,70,105,110,100,101,114,46,102,105,110,100, - 95,109,111,100,117,108,101,41,1,78,41,2,78,78,41,1, - 78,41,12,114,113,0,0,0,114,112,0,0,0,114,114,0, - 0,0,114,115,0,0,0,114,189,0,0,0,114,11,1,0, - 0,114,17,1,0,0,114,19,1,0,0,114,20,1,0,0, - 114,23,1,0,0,114,187,0,0,0,114,188,0,0,0,114, - 2,0,0,0,114,2,0,0,0,114,2,0,0,0,114,4, - 0,0,0,114,10,1,0,0,201,4,0,0,115,30,0,0, - 0,8,2,4,2,2,1,10,9,2,1,10,12,2,1,10, - 21,2,1,10,14,2,1,12,31,2,1,12,23,2,1,114, - 10,1,0,0,99,0,0,0,0,0,0,0,0,0,0,0, - 0,3,0,0,0,64,0,0,0,115,90,0,0,0,101,0, - 90,1,100,0,90,2,100,1,90,3,100,2,100,3,132,0, - 90,4,100,4,100,5,132,0,90,5,101,6,90,7,100,6, - 100,7,132,0,90,8,100,8,100,9,132,0,90,9,100,19, - 100,11,100,12,132,1,90,10,100,13,100,14,132,0,90,11, - 101,12,100,15,100,16,132,0,131,1,90,13,100,17,100,18, - 132,0,90,14,100,10,83,0,41,20,218,10,70,105,108,101, - 70,105,110,100,101,114,122,172,70,105,108,101,45,98,97,115, - 101,100,32,102,105,110,100,101,114,46,10,10,32,32,32,32, - 73,110,116,101,114,97,99,116,105,111,110,115,32,119,105,116, - 104,32,116,104,101,32,102,105,108,101,32,115,121,115,116,101, - 109,32,97,114,101,32,99,97,99,104,101,100,32,102,111,114, - 32,112,101,114,102,111,114,109,97,110,99,101,44,32,98,101, - 105,110,103,10,32,32,32,32,114,101,102,114,101,115,104,101, - 100,32,119,104,101,110,32,116,104,101,32,100,105,114,101,99, - 116,111,114,121,32,116,104,101,32,102,105,110,100,101,114,32, - 105,115,32,104,97,110,100,108,105,110,103,32,104,97,115,32, - 98,101,101,110,32,109,111,100,105,102,105,101,100,46,10,10, - 32,32,32,32,99,2,0,0,0,0,0,0,0,5,0,0, - 0,6,0,0,0,7,0,0,0,115,84,0,0,0,103,0, - 125,3,124,2,68,0,93,32,92,2,137,0,125,4,124,3, - 160,0,135,0,102,1,100,1,100,2,132,8,124,4,68,0, - 131,1,161,1,1,0,113,8,124,3,124,0,95,1,124,1, - 112,54,100,3,124,0,95,2,100,4,124,0,95,3,116,4, - 131,0,124,0,95,5,116,4,131,0,124,0,95,6,100,5, - 83,0,41,6,122,154,73,110,105,116,105,97,108,105,122,101, - 32,119,105,116,104,32,116,104,101,32,112,97,116,104,32,116, - 111,32,115,101,97,114,99,104,32,111,110,32,97,110,100,32, - 97,32,118,97,114,105,97,98,108,101,32,110,117,109,98,101, - 114,32,111,102,10,32,32,32,32,32,32,32,32,50,45,116, - 117,112,108,101,115,32,99,111,110,116,97,105,110,105,110,103, - 32,116,104,101,32,108,111,97,100,101,114,32,97,110,100,32, - 116,104,101,32,102,105,108,101,32,115,117,102,102,105,120,101, - 115,32,116,104,101,32,108,111,97,100,101,114,10,32,32,32, - 32,32,32,32,32,114,101,99,111,103,110,105,122,101,115,46, - 99,1,0,0,0,0,0,0,0,2,0,0,0,3,0,0, - 0,51,0,0,0,115,22,0,0,0,124,0,93,14,125,1, - 124,1,136,0,102,2,86,0,1,0,113,2,100,0,83,0, - 41,1,78,114,2,0,0,0,41,2,114,27,0,0,0,114, - 241,0,0,0,41,1,114,128,0,0,0,114,2,0,0,0, - 114,4,0,0,0,114,243,0,0,0,94,5,0,0,115,4, - 0,0,0,4,0,2,0,122,38,70,105,108,101,70,105,110, - 100,101,114,46,95,95,105,110,105,116,95,95,46,60,108,111, - 99,97,108,115,62,46,60,103,101,110,101,120,112,114,62,114, - 63,0,0,0,114,96,0,0,0,78,41,7,114,153,0,0, - 0,218,8,95,108,111,97,100,101,114,115,114,39,0,0,0, - 218,11,95,112,97,116,104,95,109,116,105,109,101,218,3,115, - 101,116,218,11,95,112,97,116,104,95,99,97,99,104,101,218, - 19,95,114,101,108,97,120,101,100,95,112,97,116,104,95,99, - 97,99,104,101,41,5,114,108,0,0,0,114,39,0,0,0, - 218,14,108,111,97,100,101,114,95,100,101,116,97,105,108,115, - 90,7,108,111,97,100,101,114,115,114,173,0,0,0,114,2, - 0,0,0,41,1,114,128,0,0,0,114,4,0,0,0,114, - 191,0,0,0,88,5,0,0,115,16,0,0,0,0,4,4, - 1,12,1,26,1,6,2,10,1,6,1,8,1,122,19,70, - 105,108,101,70,105,110,100,101,114,46,95,95,105,110,105,116, - 95,95,99,1,0,0,0,0,0,0,0,1,0,0,0,2, - 0,0,0,67,0,0,0,115,10,0,0,0,100,1,124,0, - 95,0,100,2,83,0,41,3,122,31,73,110,118,97,108,105, - 100,97,116,101,32,116,104,101,32,100,105,114,101,99,116,111, - 114,121,32,109,116,105,109,101,46,114,96,0,0,0,78,41, - 1,114,26,1,0,0,41,1,114,108,0,0,0,114,2,0, - 0,0,114,2,0,0,0,114,4,0,0,0,114,11,1,0, - 0,102,5,0,0,115,2,0,0,0,0,2,122,28,70,105, - 108,101,70,105,110,100,101,114,46,105,110,118,97,108,105,100, - 97,116,101,95,99,97,99,104,101,115,99,2,0,0,0,0, - 0,0,0,3,0,0,0,3,0,0,0,67,0,0,0,115, - 42,0,0,0,124,0,160,0,124,1,161,1,125,2,124,2, - 100,1,107,8,114,26,100,1,103,0,102,2,83,0,124,2, - 106,1,124,2,106,2,112,38,103,0,102,2,83,0,41,2, - 122,197,84,114,121,32,116,111,32,102,105,110,100,32,97,32, - 108,111,97,100,101,114,32,102,111,114,32,116,104,101,32,115, - 112,101,99,105,102,105,101,100,32,109,111,100,117,108,101,44, - 32,111,114,32,116,104,101,32,110,97,109,101,115,112,97,99, - 101,10,32,32,32,32,32,32,32,32,112,97,99,107,97,103, - 101,32,112,111,114,116,105,111,110,115,46,32,82,101,116,117, - 114,110,115,32,40,108,111,97,100,101,114,44,32,108,105,115, - 116,45,111,102,45,112,111,114,116,105,111,110,115,41,46,10, - 10,32,32,32,32,32,32,32,32,84,104,105,115,32,109,101, - 116,104,111,100,32,105,115,32,100,101,112,114,101,99,97,116, - 101,100,46,32,32,85,115,101,32,102,105,110,100,95,115,112, - 101,99,40,41,32,105,110,115,116,101,97,100,46,10,10,32, - 32,32,32,32,32,32,32,78,41,3,114,187,0,0,0,114, - 128,0,0,0,114,163,0,0,0,41,3,114,108,0,0,0, - 114,127,0,0,0,114,171,0,0,0,114,2,0,0,0,114, - 2,0,0,0,114,4,0,0,0,114,125,0,0,0,108,5, - 0,0,115,8,0,0,0,0,7,10,1,8,1,8,1,122, - 22,70,105,108,101,70,105,110,100,101,114,46,102,105,110,100, - 95,108,111,97,100,101,114,99,6,0,0,0,0,0,0,0, - 7,0,0,0,6,0,0,0,67,0,0,0,115,26,0,0, - 0,124,1,124,2,124,3,131,2,125,6,116,0,124,2,124, - 3,124,6,124,4,100,1,141,4,83,0,41,2,78,41,2, - 114,128,0,0,0,114,163,0,0,0,41,1,114,174,0,0, - 0,41,7,114,108,0,0,0,114,172,0,0,0,114,127,0, - 0,0,114,39,0,0,0,90,4,115,109,115,108,114,186,0, - 0,0,114,128,0,0,0,114,2,0,0,0,114,2,0,0, - 0,114,4,0,0,0,114,23,1,0,0,120,5,0,0,115, - 8,0,0,0,0,1,10,1,8,1,2,255,122,20,70,105, - 108,101,70,105,110,100,101,114,46,95,103,101,116,95,115,112, - 101,99,78,99,3,0,0,0,0,0,0,0,14,0,0,0, - 8,0,0,0,67,0,0,0,115,102,1,0,0,100,1,125, - 3,124,1,160,0,100,2,161,1,100,3,25,0,125,4,122, - 24,116,1,124,0,106,2,112,34,116,3,160,4,161,0,131, - 1,106,5,125,5,87,0,110,24,4,0,116,6,107,10,114, - 66,1,0,1,0,1,0,100,4,125,5,89,0,110,2,88, - 0,124,5,124,0,106,7,107,3,114,92,124,0,160,8,161, - 0,1,0,124,5,124,0,95,7,116,9,131,0,114,114,124, - 0,106,10,125,6,124,4,160,11,161,0,125,7,110,10,124, - 0,106,12,125,6,124,4,125,7,124,7,124,6,107,6,114, - 218,116,13,124,0,106,2,124,4,131,2,125,8,124,0,106, - 14,68,0,93,58,92,2,125,9,125,10,100,5,124,9,23, - 0,125,11,116,13,124,8,124,11,131,2,125,12,116,15,124, - 12,131,1,114,208,124,0,160,16,124,10,124,1,124,12,124, - 8,103,1,124,2,161,5,2,0,1,0,83,0,113,150,116, - 17,124,8,131,1,125,3,124,0,106,14,68,0,93,86,92, - 2,125,9,125,10,116,13,124,0,106,2,124,4,124,9,23, - 0,131,2,125,12,116,18,106,19,100,6,124,12,100,3,100, - 7,141,3,1,0,124,7,124,9,23,0,124,6,107,6,144, - 1,114,54,116,15,124,12,131,1,144,1,114,54,124,0,160, - 16,124,10,124,1,124,12,100,8,124,2,161,5,2,0,1, - 0,83,0,113,224,124,3,144,1,114,98,116,18,160,19,100, - 9,124,8,161,2,1,0,116,18,160,20,124,1,100,8,161, - 2,125,13,124,8,103,1,124,13,95,21,124,13,83,0,100, - 8,83,0,41,10,122,111,84,114,121,32,116,111,32,102,105, - 110,100,32,97,32,115,112,101,99,32,102,111,114,32,116,104, - 101,32,115,112,101,99,105,102,105,101,100,32,109,111,100,117, - 108,101,46,10,10,32,32,32,32,32,32,32,32,82,101,116, - 117,114,110,115,32,116,104,101,32,109,97,116,99,104,105,110, - 103,32,115,112,101,99,44,32,111,114,32,78,111,110,101,32, - 105,102,32,110,111,116,32,102,111,117,110,100,46,10,32,32, - 32,32,32,32,32,32,70,114,63,0,0,0,114,23,0,0, - 0,114,96,0,0,0,114,191,0,0,0,122,9,116,114,121, - 105,110,103,32,123,125,41,1,90,9,118,101,114,98,111,115, - 105,116,121,78,122,25,112,111,115,115,105,98,108,101,32,110, - 97,109,101,115,112,97,99,101,32,102,111,114,32,123,125,41, - 22,114,36,0,0,0,114,43,0,0,0,114,39,0,0,0, - 114,1,0,0,0,114,49,0,0,0,114,235,0,0,0,114, - 44,0,0,0,114,26,1,0,0,218,11,95,102,105,108,108, - 95,99,97,99,104,101,114,5,0,0,0,114,29,1,0,0, - 114,97,0,0,0,114,28,1,0,0,114,33,0,0,0,114, - 25,1,0,0,114,48,0,0,0,114,23,1,0,0,114,50, - 0,0,0,114,122,0,0,0,114,136,0,0,0,114,167,0, - 0,0,114,163,0,0,0,41,14,114,108,0,0,0,114,127, - 0,0,0,114,186,0,0,0,90,12,105,115,95,110,97,109, - 101,115,112,97,99,101,90,11,116,97,105,108,95,109,111,100, - 117,108,101,114,155,0,0,0,90,5,99,97,99,104,101,90, - 12,99,97,99,104,101,95,109,111,100,117,108,101,90,9,98, - 97,115,101,95,112,97,116,104,114,241,0,0,0,114,172,0, - 0,0,90,13,105,110,105,116,95,102,105,108,101,110,97,109, - 101,90,9,102,117,108,108,95,112,97,116,104,114,171,0,0, - 0,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, - 114,187,0,0,0,125,5,0,0,115,74,0,0,0,0,5, - 4,1,14,1,2,1,24,1,14,1,10,1,10,1,8,1, - 6,2,6,1,6,1,10,2,6,1,4,2,8,1,12,1, - 14,1,8,1,10,1,8,1,26,4,8,2,14,1,16,1, - 16,1,14,1,10,1,10,1,2,0,2,255,10,2,6,1, - 12,1,12,1,8,1,4,1,122,20,70,105,108,101,70,105, - 110,100,101,114,46,102,105,110,100,95,115,112,101,99,99,1, - 0,0,0,0,0,0,0,9,0,0,0,10,0,0,0,67, - 0,0,0,115,190,0,0,0,124,0,106,0,125,1,122,22, - 116,1,160,2,124,1,112,22,116,1,160,3,161,0,161,1, - 125,2,87,0,110,30,4,0,116,4,116,5,116,6,102,3, - 107,10,114,58,1,0,1,0,1,0,103,0,125,2,89,0, - 110,2,88,0,116,7,106,8,160,9,100,1,161,1,115,84, - 116,10,124,2,131,1,124,0,95,11,110,74,116,10,131,0, - 125,3,124,2,68,0,93,56,125,4,124,4,160,12,100,2, - 161,1,92,3,125,5,125,6,125,7,124,6,114,136,100,3, - 160,13,124,5,124,7,160,14,161,0,161,2,125,8,110,4, - 124,5,125,8,124,3,160,15,124,8,161,1,1,0,113,94, - 124,3,124,0,95,11,116,7,106,8,160,9,116,16,161,1, - 114,186,100,4,100,5,132,0,124,2,68,0,131,1,124,0, - 95,17,100,6,83,0,41,7,122,68,70,105,108,108,32,116, - 104,101,32,99,97,99,104,101,32,111,102,32,112,111,116,101, - 110,116,105,97,108,32,109,111,100,117,108,101,115,32,97,110, - 100,32,112,97,99,107,97,103,101,115,32,102,111,114,32,116, - 104,105,115,32,100,105,114,101,99,116,111,114,121,46,114,0, - 0,0,0,114,63,0,0,0,122,5,123,125,46,123,125,99, - 1,0,0,0,0,0,0,0,2,0,0,0,4,0,0,0, - 83,0,0,0,115,20,0,0,0,104,0,124,0,93,12,125, - 1,124,1,160,0,161,0,146,2,113,4,83,0,114,2,0, - 0,0,41,1,114,97,0,0,0,41,2,114,27,0,0,0, - 90,2,102,110,114,2,0,0,0,114,2,0,0,0,114,4, - 0,0,0,218,9,60,115,101,116,99,111,109,112,62,202,5, - 0,0,115,4,0,0,0,6,0,2,0,122,41,70,105,108, - 101,70,105,110,100,101,114,46,95,102,105,108,108,95,99,97, - 99,104,101,46,60,108,111,99,97,108,115,62,46,60,115,101, - 116,99,111,109,112,62,78,41,18,114,39,0,0,0,114,1, - 0,0,0,114,232,0,0,0,114,49,0,0,0,114,229,0, - 0,0,218,15,80,101,114,109,105,115,115,105,111,110,69,114, - 114,111,114,218,18,78,111,116,65,68,105,114,101,99,116,111, - 114,121,69,114,114,111,114,114,6,0,0,0,114,7,0,0, - 0,114,8,0,0,0,114,27,1,0,0,114,28,1,0,0, - 114,92,0,0,0,114,54,0,0,0,114,97,0,0,0,218, - 3,97,100,100,114,9,0,0,0,114,29,1,0,0,41,9, - 114,108,0,0,0,114,39,0,0,0,114,233,0,0,0,90, - 21,108,111,119,101,114,95,115,117,102,102,105,120,95,99,111, - 110,116,101,110,116,115,114,6,1,0,0,114,106,0,0,0, - 114,253,0,0,0,114,241,0,0,0,90,8,110,101,119,95, - 110,97,109,101,114,2,0,0,0,114,2,0,0,0,114,4, - 0,0,0,114,31,1,0,0,173,5,0,0,115,34,0,0, - 0,0,2,6,1,2,1,22,1,20,3,10,3,12,1,12, - 7,6,1,8,1,16,1,4,1,18,2,4,1,12,1,6, - 1,12,1,122,22,70,105,108,101,70,105,110,100,101,114,46, - 95,102,105,108,108,95,99,97,99,104,101,99,1,0,0,0, - 0,0,0,0,3,0,0,0,3,0,0,0,7,0,0,0, - 115,18,0,0,0,135,0,135,1,102,2,100,1,100,2,132, - 8,125,2,124,2,83,0,41,3,97,20,1,0,0,65,32, - 99,108,97,115,115,32,109,101,116,104,111,100,32,119,104,105, - 99,104,32,114,101,116,117,114,110,115,32,97,32,99,108,111, - 115,117,114,101,32,116,111,32,117,115,101,32,111,110,32,115, - 121,115,46,112,97,116,104,95,104,111,111,107,10,32,32,32, - 32,32,32,32,32,119,104,105,99,104,32,119,105,108,108,32, - 114,101,116,117,114,110,32,97,110,32,105,110,115,116,97,110, - 99,101,32,117,115,105,110,103,32,116,104,101,32,115,112,101, - 99,105,102,105,101,100,32,108,111,97,100,101,114,115,32,97, - 110,100,32,116,104,101,32,112,97,116,104,10,32,32,32,32, - 32,32,32,32,99,97,108,108,101,100,32,111,110,32,116,104, - 101,32,99,108,111,115,117,114,101,46,10,10,32,32,32,32, - 32,32,32,32,73,102,32,116,104,101,32,112,97,116,104,32, - 99,97,108,108,101,100,32,111,110,32,116,104,101,32,99,108, - 111,115,117,114,101,32,105,115,32,110,111,116,32,97,32,100, - 105,114,101,99,116,111,114,121,44,32,73,109,112,111,114,116, - 69,114,114,111,114,32,105,115,10,32,32,32,32,32,32,32, - 32,114,97,105,115,101,100,46,10,10,32,32,32,32,32,32, - 32,32,99,1,0,0,0,0,0,0,0,1,0,0,0,4, - 0,0,0,19,0,0,0,115,34,0,0,0,116,0,124,0, - 131,1,115,20,116,1,100,1,124,0,100,2,141,2,130,1, - 136,0,124,0,102,1,136,1,158,2,142,0,83,0,41,3, - 122,45,80,97,116,104,32,104,111,111,107,32,102,111,114,32, - 105,109,112,111,114,116,108,105,98,46,109,97,99,104,105,110, - 101,114,121,46,70,105,108,101,70,105,110,100,101,114,46,122, - 30,111,110,108,121,32,100,105,114,101,99,116,111,114,105,101, - 115,32,97,114,101,32,115,117,112,112,111,114,116,101,100,41, - 1,114,39,0,0,0,41,2,114,50,0,0,0,114,107,0, - 0,0,41,1,114,39,0,0,0,41,2,114,177,0,0,0, - 114,30,1,0,0,114,2,0,0,0,114,4,0,0,0,218, - 24,112,97,116,104,95,104,111,111,107,95,102,111,114,95,70, - 105,108,101,70,105,110,100,101,114,214,5,0,0,115,6,0, - 0,0,0,2,8,1,12,1,122,54,70,105,108,101,70,105, - 110,100,101,114,46,112,97,116,104,95,104,111,111,107,46,60, - 108,111,99,97,108,115,62,46,112,97,116,104,95,104,111,111, - 107,95,102,111,114,95,70,105,108,101,70,105,110,100,101,114, - 114,2,0,0,0,41,3,114,177,0,0,0,114,30,1,0, - 0,114,36,1,0,0,114,2,0,0,0,41,2,114,177,0, - 0,0,114,30,1,0,0,114,4,0,0,0,218,9,112,97, - 116,104,95,104,111,111,107,204,5,0,0,115,4,0,0,0, - 0,10,14,6,122,20,70,105,108,101,70,105,110,100,101,114, - 46,112,97,116,104,95,104,111,111,107,99,1,0,0,0,0, - 0,0,0,1,0,0,0,3,0,0,0,67,0,0,0,115, - 12,0,0,0,100,1,160,0,124,0,106,1,161,1,83,0, - 41,2,78,122,16,70,105,108,101,70,105,110,100,101,114,40, - 123,33,114,125,41,41,2,114,54,0,0,0,114,39,0,0, - 0,41,1,114,108,0,0,0,114,2,0,0,0,114,2,0, - 0,0,114,4,0,0,0,114,5,1,0,0,222,5,0,0, - 115,2,0,0,0,0,1,122,19,70,105,108,101,70,105,110, - 100,101,114,46,95,95,114,101,112,114,95,95,41,1,78,41, - 15,114,113,0,0,0,114,112,0,0,0,114,114,0,0,0, - 114,115,0,0,0,114,191,0,0,0,114,11,1,0,0,114, - 131,0,0,0,114,188,0,0,0,114,125,0,0,0,114,23, - 1,0,0,114,187,0,0,0,114,31,1,0,0,114,189,0, - 0,0,114,37,1,0,0,114,5,1,0,0,114,2,0,0, - 0,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, - 114,24,1,0,0,79,5,0,0,115,22,0,0,0,8,7, - 4,2,8,14,8,4,4,2,8,12,8,5,10,48,8,31, - 2,1,10,17,114,24,1,0,0,99,4,0,0,0,0,0, - 0,0,6,0,0,0,8,0,0,0,67,0,0,0,115,146, - 0,0,0,124,0,160,0,100,1,161,1,125,4,124,0,160, - 0,100,2,161,1,125,5,124,4,115,66,124,5,114,36,124, - 5,106,1,125,4,110,30,124,2,124,3,107,2,114,56,116, - 2,124,1,124,2,131,2,125,4,110,10,116,3,124,1,124, - 2,131,2,125,4,124,5,115,84,116,4,124,1,124,2,124, - 4,100,3,141,3,125,5,122,36,124,5,124,0,100,2,60, - 0,124,4,124,0,100,1,60,0,124,2,124,0,100,4,60, - 0,124,3,124,0,100,5,60,0,87,0,110,20,4,0,116, - 5,107,10,114,140,1,0,1,0,1,0,89,0,110,2,88, - 0,100,0,83,0,41,6,78,218,10,95,95,108,111,97,100, - 101,114,95,95,218,8,95,95,115,112,101,99,95,95,41,1, - 114,128,0,0,0,90,8,95,95,102,105,108,101,95,95,90, - 10,95,95,99,97,99,104,101,100,95,95,41,6,218,3,103, - 101,116,114,128,0,0,0,114,239,0,0,0,114,234,0,0, - 0,114,174,0,0,0,218,9,69,120,99,101,112,116,105,111, - 110,41,6,90,2,110,115,114,106,0,0,0,90,8,112,97, - 116,104,110,97,109,101,90,9,99,112,97,116,104,110,97,109, - 101,114,128,0,0,0,114,171,0,0,0,114,2,0,0,0, - 114,2,0,0,0,114,4,0,0,0,218,14,95,102,105,120, - 95,117,112,95,109,111,100,117,108,101,228,5,0,0,115,34, - 0,0,0,0,2,10,1,10,1,4,1,4,1,8,1,8, - 1,12,2,10,1,4,1,14,1,2,1,8,1,8,1,8, - 1,12,1,14,2,114,42,1,0,0,99,0,0,0,0,0, - 0,0,0,3,0,0,0,3,0,0,0,67,0,0,0,115, - 38,0,0,0,116,0,116,1,160,2,161,0,102,2,125,0, - 116,3,116,4,102,2,125,1,116,5,116,6,102,2,125,2, - 124,0,124,1,124,2,103,3,83,0,41,1,122,95,82,101, - 116,117,114,110,115,32,97,32,108,105,115,116,32,111,102,32, - 102,105,108,101,45,98,97,115,101,100,32,109,111,100,117,108, - 101,32,108,111,97,100,101,114,115,46,10,10,32,32,32,32, - 69,97,99,104,32,105,116,101,109,32,105,115,32,97,32,116, - 117,112,108,101,32,40,108,111,97,100,101,114,44,32,115,117, - 102,102,105,120,101,115,41,46,10,32,32,32,32,41,7,114, - 240,0,0,0,114,149,0,0,0,218,18,101,120,116,101,110, - 115,105,111,110,95,115,117,102,102,105,120,101,115,114,234,0, - 0,0,114,93,0,0,0,114,239,0,0,0,114,80,0,0, - 0,41,3,90,10,101,120,116,101,110,115,105,111,110,115,90, - 6,115,111,117,114,99,101,90,8,98,121,116,101,99,111,100, - 101,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, - 114,168,0,0,0,251,5,0,0,115,8,0,0,0,0,5, - 12,1,8,1,8,1,114,168,0,0,0,99,1,0,0,0, - 0,0,0,0,12,0,0,0,9,0,0,0,67,0,0,0, - 115,178,1,0,0,124,0,97,0,116,0,106,1,97,1,116, - 0,106,2,97,2,116,1,106,3,116,4,25,0,125,1,100, - 1,68,0,93,48,125,2,124,2,116,1,106,3,107,7,114, - 56,116,0,160,5,124,2,161,1,125,3,110,10,116,1,106, - 3,124,2,25,0,125,3,116,6,124,1,124,2,124,3,131, - 3,1,0,113,30,100,2,100,3,103,1,102,2,100,4,100, - 5,100,3,103,2,102,2,102,2,125,4,124,4,68,0,93, - 110,92,2,125,5,125,6,116,7,100,6,100,7,132,0,124, - 6,68,0,131,1,131,1,115,136,116,8,130,1,124,6,100, - 8,25,0,125,7,124,5,116,1,106,3,107,6,114,170,116, - 1,106,3,124,5,25,0,125,8,1,0,113,226,113,106,122, - 20,116,0,160,5,124,5,161,1,125,8,87,0,1,0,113, - 226,87,0,113,106,4,0,116,9,107,10,114,214,1,0,1, - 0,1,0,89,0,113,106,89,0,113,106,88,0,113,106,116, - 9,100,9,131,1,130,1,116,6,124,1,100,10,124,8,131, - 3,1,0,116,6,124,1,100,11,124,7,131,3,1,0,116, - 6,124,1,100,12,100,13,160,10,124,6,161,1,131,3,1, - 0,116,6,124,1,100,14,100,15,100,16,132,0,124,6,68, - 0,131,1,131,3,1,0,116,0,160,5,100,17,161,1,125, - 9,116,6,124,1,100,17,124,9,131,3,1,0,116,0,160, - 5,100,18,161,1,125,10,116,6,124,1,100,18,124,10,131, - 3,1,0,124,5,100,4,107,2,144,1,114,110,116,0,160, - 5,100,19,161,1,125,11,116,6,124,1,100,20,124,11,131, - 3,1,0,116,6,124,1,100,21,116,11,131,0,131,3,1, - 0,116,12,160,13,116,2,160,14,161,0,161,1,1,0,124, - 5,100,4,107,2,144,1,114,174,116,15,160,16,100,22,161, - 1,1,0,100,23,116,12,107,6,144,1,114,174,100,24,116, - 17,95,18,100,25,83,0,41,26,122,205,83,101,116,117,112, + 32,32,32,32,32,32,32,78,114,204,0,0,0,114,205,0, + 0,0,114,3,0,0,0,114,3,0,0,0,114,6,0,0, + 0,114,206,0,0,0,65,5,0,0,115,8,0,0,0,0, + 8,12,1,8,1,4,1,122,22,80,97,116,104,70,105,110, + 100,101,114,46,102,105,110,100,95,109,111,100,117,108,101,41, + 1,78,41,2,78,78,41,1,78,41,12,114,125,0,0,0, + 114,124,0,0,0,114,126,0,0,0,114,127,0,0,0,114, + 207,0,0,0,114,44,1,0,0,114,50,1,0,0,114,52, + 1,0,0,114,53,1,0,0,114,56,1,0,0,114,203,0, + 0,0,114,206,0,0,0,114,3,0,0,0,114,3,0,0, + 0,114,3,0,0,0,114,6,0,0,0,114,43,1,0,0, + 201,4,0,0,115,30,0,0,0,8,2,4,2,2,1,10, + 9,2,1,10,12,2,1,10,21,2,1,10,14,2,1,12, + 31,2,1,12,23,2,1,114,43,1,0,0,99,0,0,0, + 0,0,0,0,0,0,0,0,0,3,0,0,0,64,0,0, + 0,115,90,0,0,0,101,0,90,1,100,0,90,2,100,1, + 90,3,100,2,100,3,132,0,90,4,100,4,100,5,132,0, + 90,5,101,6,90,7,100,6,100,7,132,0,90,8,100,8, + 100,9,132,0,90,9,100,19,100,11,100,12,132,1,90,10, + 100,13,100,14,132,0,90,11,101,12,100,15,100,16,132,0, + 131,1,90,13,100,17,100,18,132,0,90,14,100,10,83,0, + 41,20,218,10,70,105,108,101,70,105,110,100,101,114,122,172, + 70,105,108,101,45,98,97,115,101,100,32,102,105,110,100,101, + 114,46,10,10,32,32,32,32,73,110,116,101,114,97,99,116, + 105,111,110,115,32,119,105,116,104,32,116,104,101,32,102,105, + 108,101,32,115,121,115,116,101,109,32,97,114,101,32,99,97, + 99,104,101,100,32,102,111,114,32,112,101,114,102,111,114,109, + 97,110,99,101,44,32,98,101,105,110,103,10,32,32,32,32, + 114,101,102,114,101,115,104,101,100,32,119,104,101,110,32,116, + 104,101,32,100,105,114,101,99,116,111,114,121,32,116,104,101, + 32,102,105,110,100,101,114,32,105,115,32,104,97,110,100,108, + 105,110,103,32,104,97,115,32,98,101,101,110,32,109,111,100, + 105,102,105,101,100,46,10,10,32,32,32,32,99,2,0,0, + 0,0,0,0,0,5,0,0,0,6,0,0,0,7,0,0, + 0,115,84,0,0,0,103,0,125,3,124,2,68,0,93,32, + 92,2,137,0,125,4,124,3,160,0,135,0,102,1,100,1, + 100,2,132,8,124,4,68,0,131,1,161,1,1,0,113,8, + 124,3,124,0,95,1,124,1,112,54,100,3,124,0,95,2, + 100,4,124,0,95,3,116,4,131,0,124,0,95,5,116,4, + 131,0,124,0,95,6,100,5,83,0,41,6,122,154,73,110, + 105,116,105,97,108,105,122,101,32,119,105,116,104,32,116,104, + 101,32,112,97,116,104,32,116,111,32,115,101,97,114,99,104, + 32,111,110,32,97,110,100,32,97,32,118,97,114,105,97,98, + 108,101,32,110,117,109,98,101,114,32,111,102,10,32,32,32, + 32,32,32,32,32,50,45,116,117,112,108,101,115,32,99,111, + 110,116,97,105,110,105,110,103,32,116,104,101,32,108,111,97, + 100,101,114,32,97,110,100,32,116,104,101,32,102,105,108,101, + 32,115,117,102,102,105,120,101,115,32,116,104,101,32,108,111, + 97,100,101,114,10,32,32,32,32,32,32,32,32,114,101,99, + 111,103,110,105,122,101,115,46,99,1,0,0,0,0,0,0, + 0,2,0,0,0,3,0,0,0,51,0,0,0,115,22,0, + 0,0,124,0,93,14,125,1,124,1,136,0,102,2,86,0, + 1,0,113,2,100,0,83,0,114,110,0,0,0,114,3,0, + 0,0,114,16,1,0,0,169,1,114,140,0,0,0,114,3, + 0,0,0,114,6,0,0,0,114,19,1,0,0,94,5,0, + 0,115,4,0,0,0,4,0,2,0,122,38,70,105,108,101, + 70,105,110,100,101,114,46,95,95,105,110,105,116,95,95,46, + 60,108,111,99,97,108,115,62,46,60,103,101,110,101,120,112, + 114,62,114,71,0,0,0,114,105,0,0,0,78,41,7,114, + 167,0,0,0,218,8,95,108,111,97,100,101,114,115,114,44, + 0,0,0,218,11,95,112,97,116,104,95,109,116,105,109,101, + 218,3,115,101,116,218,11,95,112,97,116,104,95,99,97,99, + 104,101,218,19,95,114,101,108,97,120,101,100,95,112,97,116, + 104,95,99,97,99,104,101,41,5,114,119,0,0,0,114,44, + 0,0,0,218,14,108,111,97,100,101,114,95,100,101,116,97, + 105,108,115,90,7,108,111,97,100,101,114,115,114,189,0,0, + 0,114,3,0,0,0,114,58,1,0,0,114,6,0,0,0, + 114,209,0,0,0,88,5,0,0,115,16,0,0,0,0,4, + 4,1,12,1,26,1,6,2,10,1,6,1,8,1,122,19, + 70,105,108,101,70,105,110,100,101,114,46,95,95,105,110,105, + 116,95,95,99,1,0,0,0,0,0,0,0,1,0,0,0, + 2,0,0,0,67,0,0,0,115,10,0,0,0,100,1,124, + 0,95,0,100,2,83,0,41,3,122,31,73,110,118,97,108, + 105,100,97,116,101,32,116,104,101,32,100,105,114,101,99,116, + 111,114,121,32,109,116,105,109,101,46,114,105,0,0,0,78, + 41,1,114,60,1,0,0,114,246,0,0,0,114,3,0,0, + 0,114,3,0,0,0,114,6,0,0,0,114,44,1,0,0, + 102,5,0,0,115,2,0,0,0,0,2,122,28,70,105,108, + 101,70,105,110,100,101,114,46,105,110,118,97,108,105,100,97, + 116,101,95,99,97,99,104,101,115,99,2,0,0,0,0,0, + 0,0,3,0,0,0,3,0,0,0,67,0,0,0,115,42, + 0,0,0,124,0,160,0,124,1,161,1,125,2,124,2,100, + 1,107,8,114,26,100,1,103,0,102,2,83,0,124,2,106, + 1,124,2,106,2,112,38,103,0,102,2,83,0,41,2,122, + 197,84,114,121,32,116,111,32,102,105,110,100,32,97,32,108, + 111,97,100,101,114,32,102,111,114,32,116,104,101,32,115,112, + 101,99,105,102,105,101,100,32,109,111,100,117,108,101,44,32, + 111,114,32,116,104,101,32,110,97,109,101,115,112,97,99,101, + 10,32,32,32,32,32,32,32,32,112,97,99,107,97,103,101, + 32,112,111,114,116,105,111,110,115,46,32,82,101,116,117,114, + 110,115,32,40,108,111,97,100,101,114,44,32,108,105,115,116, + 45,111,102,45,112,111,114,116,105,111,110,115,41,46,10,10, + 32,32,32,32,32,32,32,32,84,104,105,115,32,109,101,116, + 104,111,100,32,105,115,32,100,101,112,114,101,99,97,116,101, + 100,46,32,32,85,115,101,32,102,105,110,100,95,115,112,101, + 99,40,41,32,105,110,115,116,101,97,100,46,10,10,32,32, + 32,32,32,32,32,32,78,41,3,114,203,0,0,0,114,140, + 0,0,0,114,178,0,0,0,41,3,114,119,0,0,0,114, + 139,0,0,0,114,187,0,0,0,114,3,0,0,0,114,3, + 0,0,0,114,6,0,0,0,114,137,0,0,0,108,5,0, + 0,115,8,0,0,0,0,7,10,1,8,1,8,1,122,22, + 70,105,108,101,70,105,110,100,101,114,46,102,105,110,100,95, + 108,111,97,100,101,114,99,6,0,0,0,0,0,0,0,7, + 0,0,0,6,0,0,0,67,0,0,0,115,26,0,0,0, + 124,1,124,2,124,3,131,2,125,6,116,0,124,2,124,3, + 124,6,124,4,100,1,141,4,83,0,41,2,78,114,177,0, + 0,0,41,1,114,190,0,0,0,41,7,114,119,0,0,0, + 114,188,0,0,0,114,139,0,0,0,114,44,0,0,0,90, + 4,115,109,115,108,114,202,0,0,0,114,140,0,0,0,114, + 3,0,0,0,114,3,0,0,0,114,6,0,0,0,114,56, + 1,0,0,120,5,0,0,115,8,0,0,0,0,1,10,1, + 8,1,2,255,122,20,70,105,108,101,70,105,110,100,101,114, + 46,95,103,101,116,95,115,112,101,99,78,99,3,0,0,0, + 0,0,0,0,14,0,0,0,8,0,0,0,67,0,0,0, + 115,102,1,0,0,100,1,125,3,124,1,160,0,100,2,161, + 1,100,3,25,0,125,4,122,24,116,1,124,0,106,2,112, + 34,116,3,160,4,161,0,131,1,106,5,125,5,87,0,110, + 24,4,0,116,6,107,10,114,66,1,0,1,0,1,0,100, + 4,125,5,89,0,110,2,88,0,124,5,124,0,106,7,107, + 3,114,92,124,0,160,8,161,0,1,0,124,5,124,0,95, + 7,116,9,131,0,114,114,124,0,106,10,125,6,124,4,160, + 11,161,0,125,7,110,10,124,0,106,12,125,6,124,4,125, + 7,124,7,124,6,107,6,114,218,116,13,124,0,106,2,124, + 4,131,2,125,8,124,0,106,14,68,0,93,58,92,2,125, + 9,125,10,100,5,124,9,23,0,125,11,116,13,124,8,124, + 11,131,2,125,12,116,15,124,12,131,1,114,208,124,0,160, + 16,124,10,124,1,124,12,124,8,103,1,124,2,161,5,2, + 0,1,0,83,0,113,150,116,17,124,8,131,1,125,3,124, + 0,106,14,68,0,93,86,92,2,125,9,125,10,116,13,124, + 0,106,2,124,4,124,9,23,0,131,2,125,12,116,18,106, + 19,100,6,124,12,100,3,100,7,141,3,1,0,124,7,124, + 9,23,0,124,6,107,6,144,1,114,54,116,15,124,12,131, + 1,144,1,114,54,124,0,160,16,124,10,124,1,124,12,100, + 8,124,2,161,5,2,0,1,0,83,0,113,224,124,3,144, + 1,114,98,116,18,160,19,100,9,124,8,161,2,1,0,116, + 18,160,20,124,1,100,8,161,2,125,13,124,8,103,1,124, + 13,95,21,124,13,83,0,100,8,83,0,41,10,122,111,84, + 114,121,32,116,111,32,102,105,110,100,32,97,32,115,112,101, + 99,32,102,111,114,32,116,104,101,32,115,112,101,99,105,102, + 105,101,100,32,109,111,100,117,108,101,46,10,10,32,32,32, + 32,32,32,32,32,82,101,116,117,114,110,115,32,116,104,101, + 32,109,97,116,99,104,105,110,103,32,115,112,101,99,44,32, + 111,114,32,78,111,110,101,32,105,102,32,110,111,116,32,102, + 111,117,110,100,46,10,32,32,32,32,32,32,32,32,70,114, + 71,0,0,0,114,28,0,0,0,114,105,0,0,0,114,209, + 0,0,0,122,9,116,114,121,105,110,103,32,123,125,41,1, + 90,9,118,101,114,98,111,115,105,116,121,78,122,25,112,111, + 115,115,105,98,108,101,32,110,97,109,101,115,112,97,99,101, + 32,102,111,114,32,123,125,41,22,114,41,0,0,0,114,49, + 0,0,0,114,44,0,0,0,114,2,0,0,0,114,55,0, + 0,0,114,9,1,0,0,114,50,0,0,0,114,60,1,0, + 0,218,11,95,102,105,108,108,95,99,97,99,104,101,114,7, + 0,0,0,114,63,1,0,0,114,106,0,0,0,114,62,1, + 0,0,114,38,0,0,0,114,59,1,0,0,114,54,0,0, + 0,114,56,1,0,0,114,56,0,0,0,114,134,0,0,0, + 114,149,0,0,0,114,183,0,0,0,114,178,0,0,0,41, + 14,114,119,0,0,0,114,139,0,0,0,114,202,0,0,0, + 90,12,105,115,95,110,97,109,101,115,112,97,99,101,90,11, + 116,97,105,108,95,109,111,100,117,108,101,114,169,0,0,0, + 90,5,99,97,99,104,101,90,12,99,97,99,104,101,95,109, + 111,100,117,108,101,90,9,98,97,115,101,95,112,97,116,104, + 114,17,1,0,0,114,188,0,0,0,90,13,105,110,105,116, + 95,102,105,108,101,110,97,109,101,90,9,102,117,108,108,95, + 112,97,116,104,114,187,0,0,0,114,3,0,0,0,114,3, + 0,0,0,114,6,0,0,0,114,203,0,0,0,125,5,0, + 0,115,74,0,0,0,0,5,4,1,14,1,2,1,24,1, + 14,1,10,1,10,1,8,1,6,2,6,1,6,1,10,2, + 6,1,4,2,8,1,12,1,14,1,8,1,10,1,8,1, + 26,4,8,2,14,1,16,1,16,1,14,1,10,1,10,1, + 2,0,2,255,10,2,6,1,12,1,12,1,8,1,4,1, + 122,20,70,105,108,101,70,105,110,100,101,114,46,102,105,110, + 100,95,115,112,101,99,99,1,0,0,0,0,0,0,0,9, + 0,0,0,10,0,0,0,67,0,0,0,115,190,0,0,0, + 124,0,106,0,125,1,122,22,116,1,160,2,124,1,112,22, + 116,1,160,3,161,0,161,1,125,2,87,0,110,30,4,0, + 116,4,116,5,116,6,102,3,107,10,114,58,1,0,1,0, + 1,0,103,0,125,2,89,0,110,2,88,0,116,7,106,8, + 160,9,100,1,161,1,115,84,116,10,124,2,131,1,124,0, + 95,11,110,74,116,10,131,0,125,3,124,2,68,0,93,56, + 125,4,124,4,160,12,100,2,161,1,92,3,125,5,125,6, + 125,7,124,6,114,136,100,3,160,13,124,5,124,7,160,14, + 161,0,161,2,125,8,110,4,124,5,125,8,124,3,160,15, + 124,8,161,1,1,0,113,94,124,3,124,0,95,11,116,7, + 106,8,160,9,116,16,161,1,114,186,100,4,100,5,132,0, + 124,2,68,0,131,1,124,0,95,17,100,6,83,0,41,7, + 122,68,70,105,108,108,32,116,104,101,32,99,97,99,104,101, + 32,111,102,32,112,111,116,101,110,116,105,97,108,32,109,111, + 100,117,108,101,115,32,97,110,100,32,112,97,99,107,97,103, + 101,115,32,102,111,114,32,116,104,105,115,32,100,105,114,101, + 99,116,111,114,121,46,114,0,0,0,0,114,71,0,0,0, + 114,61,0,0,0,99,1,0,0,0,0,0,0,0,2,0, + 0,0,4,0,0,0,83,0,0,0,115,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,3,0,0,0,41,1,114,106,0,0,0,41, + 2,114,32,0,0,0,90,2,102,110,114,3,0,0,0,114, + 3,0,0,0,114,6,0,0,0,218,9,60,115,101,116,99, + 111,109,112,62,202,5,0,0,115,4,0,0,0,6,0,2, + 0,122,41,70,105,108,101,70,105,110,100,101,114,46,95,102, + 105,108,108,95,99,97,99,104,101,46,60,108,111,99,97,108, + 115,62,46,60,115,101,116,99,111,109,112,62,78,41,18,114, + 44,0,0,0,114,2,0,0,0,114,6,1,0,0,114,55, + 0,0,0,114,2,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,8,0, + 0,0,114,9,0,0,0,114,10,0,0,0,114,61,1,0, + 0,114,62,1,0,0,114,101,0,0,0,114,62,0,0,0, + 114,106,0,0,0,218,3,97,100,100,114,11,0,0,0,114, + 63,1,0,0,41,9,114,119,0,0,0,114,44,0,0,0, + 114,7,1,0,0,90,21,108,111,119,101,114,95,115,117,102, + 102,105,120,95,99,111,110,116,101,110,116,115,114,39,1,0, + 0,114,117,0,0,0,114,29,1,0,0,114,17,1,0,0, + 90,8,110,101,119,95,110,97,109,101,114,3,0,0,0,114, + 3,0,0,0,114,6,0,0,0,114,65,1,0,0,173,5, + 0,0,115,34,0,0,0,0,2,6,1,2,1,22,1,20, + 3,10,3,12,1,12,7,6,1,8,1,16,1,4,1,18, + 2,4,1,12,1,6,1,12,1,122,22,70,105,108,101,70, + 105,110,100,101,114,46,95,102,105,108,108,95,99,97,99,104, + 101,99,1,0,0,0,0,0,0,0,3,0,0,0,3,0, + 0,0,7,0,0,0,115,18,0,0,0,135,0,135,1,102, + 2,100,1,100,2,132,8,125,2,124,2,83,0,41,3,97, + 20,1,0,0,65,32,99,108,97,115,115,32,109,101,116,104, + 111,100,32,119,104,105,99,104,32,114,101,116,117,114,110,115, + 32,97,32,99,108,111,115,117,114,101,32,116,111,32,117,115, + 101,32,111,110,32,115,121,115,46,112,97,116,104,95,104,111, + 111,107,10,32,32,32,32,32,32,32,32,119,104,105,99,104, + 32,119,105,108,108,32,114,101,116,117,114,110,32,97,110,32, + 105,110,115,116,97,110,99,101,32,117,115,105,110,103,32,116, + 104,101,32,115,112,101,99,105,102,105,101,100,32,108,111,97, + 100,101,114,115,32,97,110,100,32,116,104,101,32,112,97,116, + 104,10,32,32,32,32,32,32,32,32,99,97,108,108,101,100, + 32,111,110,32,116,104,101,32,99,108,111,115,117,114,101,46, + 10,10,32,32,32,32,32,32,32,32,73,102,32,116,104,101, + 32,112,97,116,104,32,99,97,108,108,101,100,32,111,110,32, + 116,104,101,32,99,108,111,115,117,114,101,32,105,115,32,110, + 111,116,32,97,32,100,105,114,101,99,116,111,114,121,44,32, + 73,109,112,111,114,116,69,114,114,111,114,32,105,115,10,32, + 32,32,32,32,32,32,32,114,97,105,115,101,100,46,10,10, + 32,32,32,32,32,32,32,32,99,1,0,0,0,0,0,0, + 0,1,0,0,0,4,0,0,0,19,0,0,0,115,34,0, + 0,0,116,0,124,0,131,1,115,20,116,1,100,1,124,0, + 100,2,141,2,130,1,136,0,124,0,102,1,136,1,158,2, + 142,0,83,0,41,3,122,45,80,97,116,104,32,104,111,111, + 107,32,102,111,114,32,105,109,112,111,114,116,108,105,98,46, + 109,97,99,104,105,110,101,114,121,46,70,105,108,101,70,105, + 110,100,101,114,46,122,30,111,110,108,121,32,100,105,114,101, + 99,116,111,114,105,101,115,32,97,114,101,32,115,117,112,112, + 111,114,116,101,100,114,48,0,0,0,41,2,114,56,0,0, + 0,114,118,0,0,0,114,48,0,0,0,169,2,114,193,0, + 0,0,114,64,1,0,0,114,3,0,0,0,114,6,0,0, + 0,218,24,112,97,116,104,95,104,111,111,107,95,102,111,114, + 95,70,105,108,101,70,105,110,100,101,114,214,5,0,0,115, + 6,0,0,0,0,2,8,1,12,1,122,54,70,105,108,101, + 70,105,110,100,101,114,46,112,97,116,104,95,104,111,111,107, + 46,60,108,111,99,97,108,115,62,46,112,97,116,104,95,104, + 111,111,107,95,102,111,114,95,70,105,108,101,70,105,110,100, + 101,114,114,3,0,0,0,41,3,114,193,0,0,0,114,64, + 1,0,0,114,71,1,0,0,114,3,0,0,0,114,70,1, + 0,0,114,6,0,0,0,218,9,112,97,116,104,95,104,111, + 111,107,204,5,0,0,115,4,0,0,0,0,10,14,6,122, + 20,70,105,108,101,70,105,110,100,101,114,46,112,97,116,104, + 95,104,111,111,107,99,1,0,0,0,0,0,0,0,1,0, + 0,0,3,0,0,0,67,0,0,0,115,12,0,0,0,100, + 1,160,0,124,0,106,1,161,1,83,0,41,2,78,122,16, + 70,105,108,101,70,105,110,100,101,114,40,123,33,114,125,41, + 41,2,114,62,0,0,0,114,44,0,0,0,114,246,0,0, + 0,114,3,0,0,0,114,3,0,0,0,114,6,0,0,0, + 114,37,1,0,0,222,5,0,0,115,2,0,0,0,0,1, + 122,19,70,105,108,101,70,105,110,100,101,114,46,95,95,114, + 101,112,114,95,95,41,1,78,41,15,114,125,0,0,0,114, + 124,0,0,0,114,126,0,0,0,114,127,0,0,0,114,209, + 0,0,0,114,44,1,0,0,114,143,0,0,0,114,206,0, + 0,0,114,137,0,0,0,114,56,1,0,0,114,203,0,0, + 0,114,65,1,0,0,114,207,0,0,0,114,72,1,0,0, + 114,37,1,0,0,114,3,0,0,0,114,3,0,0,0,114, + 3,0,0,0,114,6,0,0,0,114,57,1,0,0,79,5, + 0,0,115,22,0,0,0,8,7,4,2,8,14,8,4,4, + 2,8,12,8,5,10,48,8,31,2,1,10,17,114,57,1, + 0,0,99,4,0,0,0,0,0,0,0,6,0,0,0,8, + 0,0,0,67,0,0,0,115,146,0,0,0,124,0,160,0, + 100,1,161,1,125,4,124,0,160,0,100,2,161,1,125,5, + 124,4,115,66,124,5,114,36,124,5,106,1,125,4,110,30, + 124,2,124,3,107,2,114,56,116,2,124,1,124,2,131,2, + 125,4,110,10,116,3,124,1,124,2,131,2,125,4,124,5, + 115,84,116,4,124,1,124,2,124,4,100,3,141,3,125,5, + 122,36,124,5,124,0,100,2,60,0,124,4,124,0,100,1, + 60,0,124,2,124,0,100,4,60,0,124,3,124,0,100,5, + 60,0,87,0,110,20,4,0,116,5,107,10,114,140,1,0, + 1,0,1,0,89,0,110,2,88,0,100,0,83,0,41,6, + 78,218,10,95,95,108,111,97,100,101,114,95,95,218,8,95, + 95,115,112,101,99,95,95,114,58,1,0,0,90,8,95,95, + 102,105,108,101,95,95,90,10,95,95,99,97,99,104,101,100, + 95,95,41,6,218,3,103,101,116,114,140,0,0,0,114,14, + 1,0,0,114,8,1,0,0,114,190,0,0,0,218,9,69, + 120,99,101,112,116,105,111,110,41,6,90,2,110,115,114,117, + 0,0,0,90,8,112,97,116,104,110,97,109,101,90,9,99, + 112,97,116,104,110,97,109,101,114,140,0,0,0,114,187,0, + 0,0,114,3,0,0,0,114,3,0,0,0,114,6,0,0, + 0,218,14,95,102,105,120,95,117,112,95,109,111,100,117,108, + 101,228,5,0,0,115,34,0,0,0,0,2,10,1,10,1, + 4,1,4,1,8,1,8,1,12,2,10,1,4,1,14,1, + 2,1,8,1,8,1,8,1,12,1,14,2,114,77,1,0, + 0,99,0,0,0,0,0,0,0,0,3,0,0,0,3,0, + 0,0,67,0,0,0,115,38,0,0,0,116,0,116,1,160, + 2,161,0,102,2,125,0,116,3,116,4,102,2,125,1,116, + 5,116,6,102,2,125,2,124,0,124,1,124,2,103,3,83, + 0,41,1,122,95,82,101,116,117,114,110,115,32,97,32,108, + 105,115,116,32,111,102,32,102,105,108,101,45,98,97,115,101, + 100,32,109,111,100,117,108,101,32,108,111,97,100,101,114,115, + 46,10,10,32,32,32,32,69,97,99,104,32,105,116,101,109, + 32,105,115,32,97,32,116,117,112,108,101,32,40,108,111,97, + 100,101,114,44,32,115,117,102,102,105,120,101,115,41,46,10, + 32,32,32,32,41,7,114,15,1,0,0,114,163,0,0,0, + 218,18,101,120,116,101,110,115,105,111,110,95,115,117,102,102, + 105,120,101,115,114,8,1,0,0,114,102,0,0,0,114,14, + 1,0,0,114,89,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,3,0,0,0,114,3,0, + 0,0,114,6,0,0,0,114,184,0,0,0,251,5,0,0, + 115,8,0,0,0,0,5,12,1,8,1,8,1,114,184,0, + 0,0,99,1,0,0,0,0,0,0,0,12,0,0,0,9, + 0,0,0,67,0,0,0,115,178,1,0,0,124,0,97,0, + 116,0,106,1,97,1,116,0,106,2,97,2,116,1,106,3, + 116,4,25,0,125,1,100,1,68,0,93,48,125,2,124,2, + 116,1,106,3,107,7,114,56,116,0,160,5,124,2,161,1, + 125,3,110,10,116,1,106,3,124,2,25,0,125,3,116,6, + 124,1,124,2,124,3,131,3,1,0,113,30,100,2,100,3, + 103,1,102,2,100,4,100,5,100,3,103,2,102,2,102,2, + 125,4,124,4,68,0,93,110,92,2,125,5,125,6,116,7, + 100,6,100,7,132,0,124,6,68,0,131,1,131,1,115,136, + 116,8,130,1,124,6,100,8,25,0,125,7,124,5,116,1, + 106,3,107,6,114,170,116,1,106,3,124,5,25,0,125,8, + 1,0,113,226,113,106,122,20,116,0,160,5,124,5,161,1, + 125,8,87,0,1,0,113,226,87,0,113,106,4,0,116,9, + 107,10,114,214,1,0,1,0,1,0,89,0,113,106,89,0, + 113,106,88,0,113,106,116,9,100,9,131,1,130,1,116,6, + 124,1,100,10,124,8,131,3,1,0,116,6,124,1,100,11, + 124,7,131,3,1,0,116,6,124,1,100,12,100,13,160,10, + 124,6,161,1,131,3,1,0,116,6,124,1,100,14,100,15, + 100,16,132,0,124,6,68,0,131,1,131,3,1,0,116,0, + 160,5,100,17,161,1,125,9,116,6,124,1,100,17,124,9, + 131,3,1,0,116,0,160,5,100,18,161,1,125,10,116,6, + 124,1,100,18,124,10,131,3,1,0,124,5,100,4,107,2, + 144,1,114,110,116,0,160,5,100,19,161,1,125,11,116,6, + 124,1,100,20,124,11,131,3,1,0,116,6,124,1,100,21, + 116,11,131,0,131,3,1,0,116,12,160,13,116,2,160,14, + 161,0,161,1,1,0,124,5,100,4,107,2,144,1,114,174, + 116,15,160,16,100,22,161,1,1,0,100,23,116,12,107,6, + 144,1,114,174,100,24,116,17,95,18,100,25,83,0,41,26, + 122,205,83,101,116,117,112,32,116,104,101,32,112,97,116,104, + 45,98,97,115,101,100,32,105,109,112,111,114,116,101,114,115, + 32,102,111,114,32,105,109,112,111,114,116,108,105,98,32,98, + 121,32,105,109,112,111,114,116,105,110,103,32,110,101,101,100, + 101,100,10,32,32,32,32,98,117,105,108,116,45,105,110,32, + 109,111,100,117,108,101,115,32,97,110,100,32,105,110,106,101, + 99,116,105,110,103,32,116,104,101,109,32,105,110,116,111,32, + 116,104,101,32,103,108,111,98,97,108,32,110,97,109,101,115, + 112,97,99,101,46,10,10,32,32,32,32,79,116,104,101,114, + 32,99,111,109,112,111,110,101,110,116,115,32,97,114,101,32, + 101,120,116,114,97,99,116,101,100,32,102,114,111,109,32,116, + 104,101,32,99,111,114,101,32,98,111,111,116,115,116,114,97, + 112,32,109,111,100,117,108,101,46,10,10,32,32,32,32,41, + 4,114,64,0,0,0,114,75,0,0,0,218,8,98,117,105, + 108,116,105,110,115,114,160,0,0,0,90,5,112,111,115,105, + 120,250,1,47,90,2,110,116,250,1,92,99,1,0,0,0, + 0,0,0,0,2,0,0,0,3,0,0,0,115,0,0,0, + 115,26,0,0,0,124,0,93,18,125,1,116,0,124,1,131, + 1,100,0,107,2,86,0,1,0,113,2,100,1,83,0,41, + 2,114,39,0,0,0,78,41,1,114,22,0,0,0,41,2, + 114,32,0,0,0,114,95,0,0,0,114,3,0,0,0,114, + 3,0,0,0,114,6,0,0,0,114,19,1,0,0,31,6, + 0,0,115,4,0,0,0,4,0,2,0,122,25,95,115,101, + 116,117,112,46,60,108,111,99,97,108,115,62,46,60,103,101, + 110,101,120,112,114,62,114,73,0,0,0,122,30,105,109,112, + 111,114,116,108,105,98,32,114,101,113,117,105,114,101,115,32, + 112,111,115,105,120,32,111,114,32,110,116,114,2,0,0,0, + 114,35,0,0,0,114,31,0,0,0,114,40,0,0,0,114, + 58,0,0,0,99,1,0,0,0,0,0,0,0,2,0,0, + 0,4,0,0,0,83,0,0,0,115,22,0,0,0,104,0, + 124,0,93,14,125,1,100,0,124,1,155,0,157,2,146,2, + 113,4,83,0,41,1,114,74,0,0,0,114,3,0,0,0, + 41,2,114,32,0,0,0,218,1,115,114,3,0,0,0,114, + 3,0,0,0,114,6,0,0,0,114,66,1,0,0,47,6, + 0,0,115,4,0,0,0,6,0,2,0,122,25,95,115,101, + 116,117,112,46,60,108,111,99,97,108,115,62,46,60,115,101, + 116,99,111,109,112,62,90,7,95,116,104,114,101,97,100,90, + 8,95,119,101,97,107,114,101,102,90,6,119,105,110,114,101, + 103,114,192,0,0,0,114,7,0,0,0,122,4,46,112,121, + 119,122,6,95,100,46,112,121,100,84,78,41,19,114,134,0, + 0,0,114,8,0,0,0,114,163,0,0,0,114,31,1,0, + 0,114,125,0,0,0,90,18,95,98,117,105,108,116,105,110, + 95,102,114,111,109,95,110,97,109,101,114,129,0,0,0,218, + 3,97,108,108,114,23,0,0,0,114,118,0,0,0,114,36, + 0,0,0,114,13,0,0,0,114,21,1,0,0,114,167,0, + 0,0,114,78,1,0,0,114,102,0,0,0,114,186,0,0, + 0,114,191,0,0,0,114,195,0,0,0,41,12,218,17,95, + 98,111,111,116,115,116,114,97,112,95,109,111,100,117,108,101, + 90,11,115,101,108,102,95,109,111,100,117,108,101,90,12,98, + 117,105,108,116,105,110,95,110,97,109,101,90,14,98,117,105, + 108,116,105,110,95,109,111,100,117,108,101,90,10,111,115,95, + 100,101,116,97,105,108,115,90,10,98,117,105,108,116,105,110, + 95,111,115,114,31,0,0,0,114,35,0,0,0,90,9,111, + 115,95,109,111,100,117,108,101,90,13,116,104,114,101,97,100, + 95,109,111,100,117,108,101,90,14,119,101,97,107,114,101,102, + 95,109,111,100,117,108,101,90,13,119,105,110,114,101,103,95, + 109,111,100,117,108,101,114,3,0,0,0,114,3,0,0,0, + 114,6,0,0,0,218,6,95,115,101,116,117,112,6,6,0, + 0,115,78,0,0,0,0,8,4,1,6,1,6,3,10,1, + 8,1,10,1,12,2,10,1,14,3,22,1,12,2,22,1, + 8,1,10,1,10,1,6,2,2,1,10,1,10,1,14,1, + 12,2,8,1,12,1,12,1,18,1,22,3,10,1,12,3, + 10,1,12,3,10,1,10,1,12,3,14,1,14,1,10,1, + 10,1,10,1,114,85,1,0,0,99,1,0,0,0,0,0, + 0,0,2,0,0,0,4,0,0,0,67,0,0,0,115,50, + 0,0,0,116,0,124,0,131,1,1,0,116,1,131,0,125, + 1,116,2,106,3,160,4,116,5,106,6,124,1,142,0,103, + 1,161,1,1,0,116,2,106,7,160,8,116,9,161,1,1, + 0,100,1,83,0,41,2,122,41,73,110,115,116,97,108,108, 32,116,104,101,32,112,97,116,104,45,98,97,115,101,100,32, - 105,109,112,111,114,116,101,114,115,32,102,111,114,32,105,109, - 112,111,114,116,108,105,98,32,98,121,32,105,109,112,111,114, - 116,105,110,103,32,110,101,101,100,101,100,10,32,32,32,32, - 98,117,105,108,116,45,105,110,32,109,111,100,117,108,101,115, - 32,97,110,100,32,105,110,106,101,99,116,105,110,103,32,116, - 104,101,109,32,105,110,116,111,32,116,104,101,32,103,108,111, - 98,97,108,32,110,97,109,101,115,112,97,99,101,46,10,10, - 32,32,32,32,79,116,104,101,114,32,99,111,109,112,111,110, - 101,110,116,115,32,97,114,101,32,101,120,116,114,97,99,116, - 101,100,32,102,114,111,109,32,116,104,101,32,99,111,114,101, - 32,98,111,111,116,115,116,114,97,112,32,109,111,100,117,108, - 101,46,10,10,32,32,32,32,41,4,114,56,0,0,0,114, - 66,0,0,0,218,8,98,117,105,108,116,105,110,115,114,146, - 0,0,0,90,5,112,111,115,105,120,250,1,47,90,2,110, - 116,250,1,92,99,1,0,0,0,0,0,0,0,2,0,0, - 0,3,0,0,0,115,0,0,0,115,26,0,0,0,124,0, - 93,18,125,1,116,0,124,1,131,1,100,0,107,2,86,0, - 1,0,113,2,100,1,83,0,41,2,114,34,0,0,0,78, - 41,1,114,18,0,0,0,41,2,114,27,0,0,0,114,86, - 0,0,0,114,2,0,0,0,114,2,0,0,0,114,4,0, - 0,0,114,243,0,0,0,31,6,0,0,115,4,0,0,0, - 4,0,2,0,122,25,95,115,101,116,117,112,46,60,108,111, - 99,97,108,115,62,46,60,103,101,110,101,120,112,114,62,114, - 64,0,0,0,122,30,105,109,112,111,114,116,108,105,98,32, - 114,101,113,117,105,114,101,115,32,112,111,115,105,120,32,111, - 114,32,110,116,114,1,0,0,0,114,30,0,0,0,114,26, - 0,0,0,114,35,0,0,0,114,52,0,0,0,99,1,0, - 0,0,0,0,0,0,2,0,0,0,4,0,0,0,83,0, - 0,0,115,22,0,0,0,104,0,124,0,93,14,125,1,100, - 0,124,1,155,0,157,2,146,2,113,4,83,0,41,1,114, - 65,0,0,0,114,2,0,0,0,41,2,114,27,0,0,0, - 218,1,115,114,2,0,0,0,114,2,0,0,0,114,4,0, - 0,0,114,32,1,0,0,47,6,0,0,115,4,0,0,0, - 6,0,2,0,122,25,95,115,101,116,117,112,46,60,108,111, - 99,97,108,115,62,46,60,115,101,116,99,111,109,112,62,90, - 7,95,116,104,114,101,97,100,90,8,95,119,101,97,107,114, - 101,102,90,6,119,105,110,114,101,103,114,176,0,0,0,114, - 5,0,0,0,122,4,46,112,121,119,122,6,95,100,46,112, - 121,100,84,78,41,19,114,122,0,0,0,114,6,0,0,0, - 114,149,0,0,0,114,255,0,0,0,114,113,0,0,0,90, - 18,95,98,117,105,108,116,105,110,95,102,114,111,109,95,110, - 97,109,101,114,117,0,0,0,218,3,97,108,108,114,19,0, - 0,0,114,107,0,0,0,114,31,0,0,0,114,11,0,0, - 0,114,245,0,0,0,114,153,0,0,0,114,43,1,0,0, - 114,93,0,0,0,114,170,0,0,0,114,175,0,0,0,114, - 179,0,0,0,41,12,218,17,95,98,111,111,116,115,116,114, - 97,112,95,109,111,100,117,108,101,90,11,115,101,108,102,95, - 109,111,100,117,108,101,90,12,98,117,105,108,116,105,110,95, - 110,97,109,101,90,14,98,117,105,108,116,105,110,95,109,111, - 100,117,108,101,90,10,111,115,95,100,101,116,97,105,108,115, - 90,10,98,117,105,108,116,105,110,95,111,115,114,26,0,0, - 0,114,30,0,0,0,90,9,111,115,95,109,111,100,117,108, - 101,90,13,116,104,114,101,97,100,95,109,111,100,117,108,101, - 90,14,119,101,97,107,114,101,102,95,109,111,100,117,108,101, - 90,13,119,105,110,114,101,103,95,109,111,100,117,108,101,114, - 2,0,0,0,114,2,0,0,0,114,4,0,0,0,218,6, - 95,115,101,116,117,112,6,6,0,0,115,78,0,0,0,0, - 8,4,1,6,1,6,3,10,1,8,1,10,1,12,2,10, - 1,14,3,22,1,12,2,22,1,8,1,10,1,10,1,6, - 2,2,1,10,1,10,1,14,1,12,2,8,1,12,1,12, - 1,18,1,22,3,10,1,12,3,10,1,12,3,10,1,10, - 1,12,3,14,1,14,1,10,1,10,1,10,1,114,50,1, - 0,0,99,1,0,0,0,0,0,0,0,2,0,0,0,4, - 0,0,0,67,0,0,0,115,50,0,0,0,116,0,124,0, - 131,1,1,0,116,1,131,0,125,1,116,2,106,3,160,4, - 116,5,106,6,124,1,142,0,103,1,161,1,1,0,116,2, - 106,7,160,8,116,9,161,1,1,0,100,1,83,0,41,2, - 122,41,73,110,115,116,97,108,108,32,116,104,101,32,112,97, - 116,104,45,98,97,115,101,100,32,105,109,112,111,114,116,32, - 99,111,109,112,111,110,101,110,116,115,46,78,41,10,114,50, - 1,0,0,114,168,0,0,0,114,6,0,0,0,114,16,1, - 0,0,114,153,0,0,0,114,24,1,0,0,114,37,1,0, - 0,218,9,109,101,116,97,95,112,97,116,104,114,170,0,0, - 0,114,10,1,0,0,41,2,114,49,1,0,0,90,17,115, - 117,112,112,111,114,116,101,100,95,108,111,97,100,101,114,115, - 114,2,0,0,0,114,2,0,0,0,114,4,0,0,0,218, - 8,95,105,110,115,116,97,108,108,71,6,0,0,115,8,0, - 0,0,0,2,8,1,6,1,20,1,114,52,1,0,0,41, - 63,114,115,0,0,0,114,10,0,0,0,90,37,95,67,65, - 83,69,95,73,78,83,69,78,83,73,84,73,86,69,95,80, - 76,65,84,70,79,82,77,83,95,66,89,84,69,83,95,75, - 69,89,114,9,0,0,0,114,11,0,0,0,114,17,0,0, - 0,114,22,0,0,0,114,24,0,0,0,114,33,0,0,0, - 114,42,0,0,0,114,43,0,0,0,114,47,0,0,0,114, - 48,0,0,0,114,50,0,0,0,114,53,0,0,0,114,61, - 0,0,0,218,4,116,121,112,101,218,8,95,95,99,111,100, - 101,95,95,114,148,0,0,0,114,15,0,0,0,114,135,0, - 0,0,114,14,0,0,0,114,20,0,0,0,114,214,0,0, - 0,114,83,0,0,0,114,79,0,0,0,114,93,0,0,0, - 114,80,0,0,0,90,23,68,69,66,85,71,95,66,89,84, - 69,67,79,68,69,95,83,85,70,70,73,88,69,83,90,27, - 79,80,84,73,77,73,90,69,68,95,66,89,84,69,67,79, - 68,69,95,83,85,70,70,73,88,69,83,114,89,0,0,0, - 114,94,0,0,0,114,100,0,0,0,114,103,0,0,0,114, - 105,0,0,0,114,124,0,0,0,114,131,0,0,0,114,139, - 0,0,0,114,143,0,0,0,114,145,0,0,0,114,151,0, - 0,0,114,156,0,0,0,114,157,0,0,0,114,162,0,0, - 0,218,6,111,98,106,101,99,116,114,169,0,0,0,114,174, - 0,0,0,114,175,0,0,0,114,190,0,0,0,114,200,0, - 0,0,114,217,0,0,0,114,234,0,0,0,114,239,0,0, - 0,114,245,0,0,0,114,240,0,0,0,114,246,0,0,0, - 114,8,1,0,0,114,10,1,0,0,114,24,1,0,0,114, - 42,1,0,0,114,168,0,0,0,114,50,1,0,0,114,52, - 1,0,0,114,2,0,0,0,114,2,0,0,0,114,2,0, - 0,0,114,4,0,0,0,218,8,60,109,111,100,117,108,101, - 62,8,0,0,0,115,126,0,0,0,4,15,4,1,4,1, - 2,1,2,255,4,4,8,17,8,5,8,5,8,6,8,6, - 8,12,8,10,8,9,8,5,8,7,8,9,12,22,10,127, - 0,7,16,1,12,2,4,1,4,2,6,2,6,2,8,2, - 18,71,8,40,8,19,8,12,8,12,8,28,8,17,8,33, - 8,28,8,24,16,13,14,10,12,11,8,14,6,3,6,1, - 2,255,12,68,14,64,14,29,16,127,0,17,14,68,18,45, - 18,26,4,3,18,53,14,60,14,42,14,127,0,7,14,127, - 0,22,12,23,8,11,8,65, + 105,109,112,111,114,116,32,99,111,109,112,111,110,101,110,116, + 115,46,78,41,10,114,85,1,0,0,114,184,0,0,0,114, + 8,0,0,0,114,49,1,0,0,114,167,0,0,0,114,57, + 1,0,0,114,72,1,0,0,218,9,109,101,116,97,95,112, + 97,116,104,114,186,0,0,0,114,43,1,0,0,41,2,114, + 84,1,0,0,90,17,115,117,112,112,111,114,116,101,100,95, + 108,111,97,100,101,114,115,114,3,0,0,0,114,3,0,0, + 0,114,6,0,0,0,218,8,95,105,110,115,116,97,108,108, + 71,6,0,0,115,8,0,0,0,0,2,8,1,6,1,20, + 1,114,87,1,0,0,41,63,114,127,0,0,0,114,12,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,11,0,0,0,114,13, + 0,0,0,114,20,0,0,0,114,27,0,0,0,114,29,0, + 0,0,114,38,0,0,0,114,47,0,0,0,114,49,0,0, + 0,114,53,0,0,0,114,54,0,0,0,114,56,0,0,0, + 114,59,0,0,0,114,69,0,0,0,218,4,116,121,112,101, + 218,8,95,95,99,111,100,101,95,95,114,162,0,0,0,114, + 18,0,0,0,114,148,0,0,0,114,17,0,0,0,114,24, + 0,0,0,114,236,0,0,0,114,92,0,0,0,114,88,0, + 0,0,114,102,0,0,0,114,89,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,98,0,0,0,114,103,0,0,0,114,109,0,0, + 0,114,113,0,0,0,114,115,0,0,0,114,136,0,0,0, + 114,143,0,0,0,114,152,0,0,0,114,156,0,0,0,114, + 158,0,0,0,114,165,0,0,0,114,170,0,0,0,114,171, + 0,0,0,114,176,0,0,0,218,6,111,98,106,101,99,116, + 114,185,0,0,0,114,190,0,0,0,114,191,0,0,0,114, + 208,0,0,0,114,221,0,0,0,114,239,0,0,0,114,8, + 1,0,0,114,14,1,0,0,114,21,1,0,0,114,15,1, + 0,0,114,22,1,0,0,114,41,1,0,0,114,43,1,0, + 0,114,57,1,0,0,114,77,1,0,0,114,184,0,0,0, + 114,85,1,0,0,114,87,1,0,0,114,3,0,0,0,114, + 3,0,0,0,114,3,0,0,0,114,6,0,0,0,218,8, + 60,109,111,100,117,108,101,62,8,0,0,0,115,126,0,0, + 0,4,15,4,1,4,1,2,1,2,255,4,4,8,17,8, + 5,8,5,8,6,8,6,8,12,8,10,8,9,8,5,8, + 7,8,9,12,22,10,127,0,7,16,1,12,2,4,1,4, + 2,6,2,6,2,8,2,18,71,8,40,8,19,8,12,8, + 12,8,28,8,17,8,33,8,28,8,24,16,13,14,10,12, + 11,8,14,6,3,6,1,2,255,12,68,14,64,14,29,16, + 127,0,17,14,68,18,45,18,26,4,3,18,53,14,60,14, + 42,14,127,0,7,14,127,0,22,12,23,8,11,8,65, }; diff --git a/Python/importlib_zipimport.h b/Python/importlib_zipimport.h index 779de5fb4488..2d6868ec80cf 100644 --- a/Python/importlib_zipimport.h +++ b/Python/importlib_zipimport.h @@ -137,7 +137,7 @@ const unsigned char _Py_M__zipimport[] = { 32,124,0,4,0,106,21,116,7,55,0,2,0,95,21,100, 0,83,0,41,8,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,41,1,218,4,112,97,116,104,122,14,110,111,116,32, + 116,121,169,1,218,4,112,97,116,104,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, @@ -155,7 +155,7 @@ const unsigned char _Py_M__zipimport[] = { 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,12,0,0,0,114,16,0,0,0,114,30,0,0, + 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, @@ -206,8 +206,8 @@ const unsigned char _Py_M__zipimport[] = { 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,28,0,0,0,114,19,0,0,0,41,5,114,31,0,0, - 0,218,8,102,117,108,108,110,97,109,101,114,12,0,0,0, + 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,109,0,0,0,115,14,0, @@ -241,8 +241,8 @@ const unsigned char _Py_M__zipimport[] = { 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,32,32,32, - 32,32,32,32,32,114,0,0,0,0,41,1,114,40,0,0, - 0,41,3,114,31,0,0,0,114,37,0,0,0,114,12,0, + 32,32,32,32,32,114,0,0,0,0,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,141,0, 0,0,115,2,0,0,0,0,9,122,23,122,105,112,105,109, @@ -260,10 +260,10 @@ const unsigned char _Py_M__zipimport[] = { 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,46,10,32, - 32,32,32,32,32,32,32,41,1,218,16,95,103,101,116,95, - 109,111,100,117,108,101,95,99,111,100,101,41,5,114,31,0, - 0,0,114,37,0,0,0,218,4,99,111,100,101,218,9,105, - 115,112,97,99,107,97,103,101,114,39,0,0,0,114,9,0, + 32,32,32,32,32,32,32,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,153,0,0,0,115,4,0,0,0,0, 6,16,1,122,20,122,105,112,105,109,112,111,114,116,101,114, @@ -287,11 +287,11 @@ const unsigned char _Py_M__zipimport[] = { 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,17,0,0,0,114,18,0,0,0,114,19,0,0,0, - 218,10,115,116,97,114,116,115,119,105,116,104,114,28,0,0, - 0,218,3,108,101,110,114,27,0,0,0,114,25,0,0,0, - 114,21,0,0,0,218,9,95,103,101,116,95,100,97,116,97, - 41,4,114,31,0,0,0,218,8,112,97,116,104,110,97,109, + 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,163,0,0,0,115,20, @@ -307,779 +307,769 @@ const unsigned char _Py_M__zipimport[] = { 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,46, - 10,32,32,32,32,32,32,32,32,41,1,114,42,0,0,0, - 41,5,114,31,0,0,0,114,37,0,0,0,114,43,0,0, - 0,114,44,0,0,0,114,39,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,184,0,0,0,115,4,0,0, - 0,0,7,16,1,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,6,0,0,0,8,0,0,0, - 67,0,0,0,115,128,0,0,0,116,0,124,0,124,1,131, - 2,125,2,124,2,100,1,107,8,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,22,4,0,116,6,107,10,114,110,1,0,1,0,1, - 0,89,0,100,1,83,0,88,0,116,7,124,0,106,8,124, - 5,131,2,160,9,161,0,83,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,122,18,99,97,110, - 39,116,32,102,105,110,100,32,109,111,100,117,108,101,32,41, - 1,218,4,110,97,109,101,122,11,95,95,105,110,105,116,95, - 95,46,112,121,122,3,46,112,121,41,10,114,34,0,0,0, - 114,3,0,0,0,114,35,0,0,0,114,20,0,0,0,114, - 29,0,0,0,114,27,0,0,0,114,25,0,0,0,114,49, - 0,0,0,114,28,0,0,0,218,6,100,101,99,111,100,101, - 41,6,114,31,0,0,0,114,37,0,0,0,114,38,0,0, - 0,114,12,0,0,0,218,8,102,117,108,108,112,97,116,104, - 114,51,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, - 195,0,0,0,115,24,0,0,0,0,7,10,1,8,1,18, - 2,10,1,4,1,14,2,10,2,2,1,14,1,14,2,8, - 1,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,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,107,8,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,122,18,99,97,110, - 39,116,32,102,105,110,100,32,109,111,100,117,108,101,32,41, - 1,114,54,0,0,0,41,2,114,34,0,0,0,114,3,0, - 0,0,41,3,114,31,0,0,0,114,37,0,0,0,114,38, + 10,32,32,32,32,32,32,32,32,114,43,0,0,0,114,45, 0,0,0,114,9,0,0,0,114,9,0,0,0,114,10,0, - 0,0,218,10,105,115,95,112,97,99,107,97,103,101,221,0, - 0,0,115,8,0,0,0,0,6,10,1,8,1,18,1,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, - 8,0,0,0,8,0,0,0,67,0,0,0,115,248,0,0, - 0,116,0,124,0,124,1,131,2,92,3,125,2,125,3,125, - 4,116,1,106,2,160,3,124,1,161,1,125,5,124,5,100, - 1,107,8,115,46,116,4,124,5,116,5,131,2,115,64,116, - 5,124,1,131,1,125,5,124,5,116,1,106,2,124,1,60, - 0,124,0,124,5,95,6,122,84,124,3,114,108,116,7,124, - 0,124,1,131,2,125,6,116,8,160,9,124,0,106,10,124, - 6,161,2,125,7,124,7,103,1,124,5,95,11,116,12,124, - 5,100,2,131,2,115,124,116,13,124,5,95,13,116,8,160, - 14,124,5,106,15,124,1,124,4,161,3,1,0,116,16,124, - 2,124,5,106,15,131,2,1,0,87,0,110,22,1,0,1, - 0,1,0,116,1,106,2,124,1,61,0,130,0,89,0,110, - 2,88,0,122,14,116,1,106,2,124,1,25,0,125,5,87, - 0,110,36,4,0,116,17,107,10,114,228,1,0,1,0,1, - 0,116,18,100,3,124,1,155,2,100,4,157,3,131,1,130, - 1,89,0,110,2,88,0,116,19,160,20,100,5,124,1,124, - 4,161,3,1,0,124,5,83,0,41,6,122,245,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,119,97,115,110, - 39,116,32,102,111,117,110,100,46,10,32,32,32,32,32,32, - 32,32,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,21,114,42, - 0,0,0,218,3,115,121,115,218,7,109,111,100,117,108,101, - 115,218,3,103,101,116,114,14,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,35,0,0,0,114,20,0,0,0,114, - 29,0,0,0,114,28,0,0,0,90,8,95,95,112,97,116, - 104,95,95,218,7,104,97,115,97,116,116,114,114,59,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,25,0,0,0,218,11,73,109,112,111,114,116,69,114, - 114,111,114,218,10,95,98,111,111,116,115,116,114,97,112,218, - 16,95,118,101,114,98,111,115,101,95,109,101,115,115,97,103, - 101,41,8,114,31,0,0,0,114,37,0,0,0,114,43,0, - 0,0,114,44,0,0,0,114,39,0,0,0,90,3,109,111, - 100,114,12,0,0,0,114,56,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,234,0,0,0,115,48,0,0,0, - 0,7,16,1,12,1,18,1,8,1,10,1,6,2,2,1, - 4,3,10,1,14,1,8,2,10,1,6,1,16,1,16,1, - 6,1,8,1,8,2,2,1,14,1,14,1,22,1,14,1, - 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,3,0,0,0,8,0,0,0,67,0,0,0,115,88, - 0,0,0,122,20,124,0,160,0,124,1,161,1,115,18,87, - 0,100,1,83,0,87,0,110,22,4,0,116,1,107,10,114, - 42,1,0,1,0,1,0,89,0,100,1,83,0,88,0,116, - 2,106,3,115,78,100,2,100,3,108,4,109,5,125,2,1, - 0,124,2,160,6,116,2,161,1,1,0,100,4,116,2,95, - 3,116,2,124,0,124,1,131,2,83,0,41,5,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,14,82,101,115,111,117,114,99,101,82,101,97, - 100,101,114,84,41,7,114,58,0,0,0,114,3,0,0,0, - 218,24,95,90,105,112,73,109,112,111,114,116,82,101,115,111, - 117,114,99,101,82,101,97,100,101,114,218,11,95,114,101,103, - 105,115,116,101,114,101,100,90,13,105,109,112,111,114,116,108, - 105,98,46,97,98,99,114,72,0,0,0,90,8,114,101,103, - 105,115,116,101,114,41,3,114,31,0,0,0,114,37,0,0, - 0,114,72,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,16,1,0,0,115,20, - 0,0,0,0,6,2,1,10,1,10,1,14,1,8,1,6, - 1,12,1,10,1,6,1,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,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,28,0,0,0,114, - 19,0,0,0,114,30,0,0,0,41,1,114,31,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,34,1,0,0,115,2,0, - 0,0,0,1,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,15,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,33,0,0,0,114, - 40,0,0,0,114,41,0,0,0,114,45,0,0,0,114,52, - 0,0,0,114,53,0,0,0,114,57,0,0,0,114,58,0, - 0,0,114,71,0,0,0,114,75,0,0,0,114,76,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,45,0,0,0,115,24, - 0,0,0,8,13,4,5,8,46,10,32,10,12,8,10,8, - 21,8,11,8,26,8,13,8,38,8,18,122,12,95,95,105, - 110,105,116,95,95,46,112,121,99,84,122,11,95,95,105,110, - 105,116,95,95,46,112,121,70,41,3,122,4,46,112,121,99, - 84,70,41,3,122,3,46,112,121,70,70,99,2,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,30,0,0,0,218,10,114,112,97, - 114,116,105,116,105,111,110,41,2,114,31,0,0,0,114,37, - 0,0,0,114,9,0,0,0,114,9,0,0,0,114,10,0, - 0,0,114,35,0,0,0,52,1,0,0,115,2,0,0,0, - 0,1,114,35,0,0,0,99,2,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,107, - 6,83,0,41,1,78,41,2,114,19,0,0,0,114,27,0, - 0,0,41,3,114,31,0,0,0,114,12,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,36,0,0,0,56,1,0,0,115, - 4,0,0,0,0,4,8,2,114,36,0,0,0,99,2,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,107,6,114, - 14,124,5,2,0,1,0,83,0,113,14,100,0,83,0,41, - 1,78,41,3,114,35,0,0,0,218,16,95,122,105,112,95, - 115,101,97,114,99,104,111,114,100,101,114,114,27,0,0,0, - 41,7,114,31,0,0,0,114,37,0,0,0,114,12,0,0, - 0,218,6,115,117,102,102,105,120,218,10,105,115,98,121,116, - 101,99,111,100,101,114,44,0,0,0,114,56,0,0,0,114, - 9,0,0,0,114,9,0,0,0,114,10,0,0,0,114,34, - 0,0,0,65,1,0,0,115,12,0,0,0,0,1,10,1, - 14,1,8,1,10,1,10,1,114,34,0,0,0,99,1,0, - 0,0,0,0,0,0,26,0,0,0,9,0,0,0,67,0, - 0,0,115,254,4,0,0,122,16,116,0,160,1,124,0,100, - 1,161,2,125,1,87,0,110,38,4,0,116,2,107,10,114, - 54,1,0,1,0,1,0,116,3,100,2,124,0,155,2,157, - 2,124,0,100,3,141,2,130,1,89,0,110,2,88,0,124, - 1,144,4,143,168,1,0,122,36,124,1,160,4,116,5,11, - 0,100,4,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,38,4,0,116, - 2,107,10,114,138,1,0,1,0,1,0,116,3,100,5,124, - 0,155,2,157,2,124,0,100,3,141,2,130,1,89,0,110, - 2,88,0,116,8,124,3,131,1,116,5,107,3,114,170,116, - 3,100,5,124,0,155,2,157,2,124,0,100,3,141,2,130, - 1,124,3,100,0,100,6,133,2,25,0,116,9,107,3,144, - 1,114,180,122,24,124,1,160,4,100,7,100,4,161,2,1, - 0,124,1,160,6,161,0,125,4,87,0,110,38,4,0,116, - 2,107,10,114,250,1,0,1,0,1,0,116,3,100,5,124, - 0,155,2,157,2,124,0,100,3,141,2,130,1,89,0,110, - 2,88,0,116,10,124,4,116,11,24,0,116,5,24,0,100, - 7,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,40,4,0,116, - 2,107,10,144,1,114,76,1,0,1,0,1,0,116,3,100, - 5,124,0,155,2,157,2,124,0,100,3,141,2,130,1,89, - 0,110,2,88,0,124,6,160,12,116,9,161,1,125,7,124, - 7,100,7,107,0,144,1,114,116,116,3,100,8,124,0,155, - 2,157,2,124,0,100,3,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,164,116,3,100,9,124,0,155, - 2,157,2,124,0,100,3,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, - 10,100,11,133,2,25,0,131,1,125,8,116,13,124,3,100, - 11,100,12,133,2,25,0,131,1,125,9,124,2,124,8,107, - 0,144,1,114,240,116,3,100,13,124,0,155,2,157,2,124, - 0,100,3,141,2,130,1,124,2,124,9,107,0,144,2,114, - 12,116,3,100,14,124,0,155,2,157,2,124,0,100,3,141, - 2,130,1,124,2,124,8,56,0,125,2,124,2,124,9,24, - 0,125,10,124,10,100,7,107,0,144,2,114,56,116,3,100, - 15,124,0,155,2,157,2,124,0,100,3,141,2,130,1,105, - 0,125,11,100,7,125,12,122,14,124,1,160,4,124,2,161, - 1,1,0,87,0,110,40,4,0,116,2,107,10,144,2,114, - 118,1,0,1,0,1,0,116,3,100,5,124,0,155,2,157, - 2,124,0,100,3,141,2,130,1,89,0,110,2,88,0,124, - 1,160,7,100,16,161,1,125,3,116,8,124,3,131,1,100, - 6,107,0,144,2,114,152,116,14,100,17,131,1,130,1,124, - 3,100,0,100,6,133,2,25,0,100,18,107,3,144,2,114, - 174,144,4,113,226,116,8,124,3,131,1,100,16,107,3,144, - 2,114,196,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,10,133,2,25,0,131,1,125,14,116,15,124,3,100, - 10,100,21,133,2,25,0,131,1,125,15,116,15,124,3,100, - 21,100,11,133,2,25,0,131,1,125,16,116,13,124,3,100, - 11,100,12,133,2,25,0,131,1,125,17,116,13,124,3,100, - 12,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, - 156,116,3,100,28,124,0,155,2,157,2,124,0,100,3,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,40,4,0,116,2,107, - 10,144,3,114,218,1,0,1,0,1,0,116,3,100,5,124, - 0,155,2,157,2,124,0,100,3,141,2,130,1,89,0,110, - 2,88,0,116,8,124,23,131,1,124,19,107,3,144,3,114, - 252,116,3,100,5,124,0,155,2,157,2,124,0,100,3,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, - 44,116,3,100,5,124,0,155,2,157,2,124,0,100,3,141, - 2,130,1,87,0,110,40,4,0,116,2,107,10,144,4,114, - 86,1,0,1,0,1,0,116,3,100,5,124,0,155,2,157, - 2,124,0,100,3,141,2,130,1,89,0,110,2,88,0,124, - 13,100,29,64,0,144,4,114,108,124,23,160,16,161,0,125, - 23,110,54,122,14,124,23,160,16,100,30,161,1,125,23,87, - 0,110,38,4,0,116,17,107,10,144,4,114,160,1,0,1, - 0,1,0,124,23,160,16,100,31,161,1,160,18,116,19,161, - 1,125,23,89,0,110,2,88,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,120,87,0,53,0,81,0,82, - 0,88,0,116,24,160,25,100,34,124,12,124,0,161,3,1, - 0,124,11,83,0,41,35,78,218,2,114,98,122,21,99,97, - 110,39,116,32,111,112,101,110,32,90,105,112,32,102,105,108, - 101,58,32,41,1,114,12,0,0,0,114,79,0,0,0,122, - 21,99,97,110,39,116,32,114,101,97,100,32,90,105,112,32, - 102,105,108,101,58,32,233,4,0,0,0,114,0,0,0,0, - 122,16,110,111,116,32,97,32,90,105,112,32,102,105,108,101, - 58,32,122,18,99,111,114,114,117,112,116,32,90,105,112,32, - 102,105,108,101,58,32,233,12,0,0,0,233,16,0,0,0, - 233,20,0,0,0,122,28,98,97,100,32,99,101,110,116,114, - 97,108,32,100,105,114,101,99,116,111,114,121,32,115,105,122, - 101,58,32,122,30,98,97,100,32,99,101,110,116,114,97,108, - 32,100,105,114,101,99,116,111,114,121,32,111,102,102,115,101, - 116,58,32,122,38,98,97,100,32,99,101,110,116,114,97,108, - 32,100,105,114,101,99,116,111,114,121,32,115,105,122,101,32, - 111,114,32,111,102,102,115,101,116,58,32,233,46,0,0,0, - 122,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,4,111,112,101,110,114,21,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,48,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,55,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,18,0,0,0,114,19,0,0, - 0,114,20,0,0,0,114,29,0,0,0,114,69,0,0,0, - 114,70,0,0,0,41,26,114,28,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,32,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,54,0,0,0,114,12,0,0,0,218, - 1,116,114,9,0,0,0,114,9,0,0,0,114,10,0,0, - 0,114,26,0,0,0,96,1,0,0,115,212,0,0,0,0, - 1,2,1,16,1,14,1,24,2,8,1,2,1,14,1,8, - 1,14,1,14,1,24,1,12,1,18,1,18,3,2,1,12, - 1,12,1,14,1,10,1,2,255,12,2,8,1,2,255,2, - 1,2,255,4,2,2,1,10,1,12,1,16,1,10,1,2, - 255,12,2,10,1,10,1,10,1,2,255,6,2,16,1,14, - 1,10,1,2,255,6,2,16,2,16,1,16,1,10,1,18, - 1,10,1,18,1,8,1,8,1,10,1,18,2,4,2,4, - 1,2,1,14,1,16,1,24,2,10,1,14,1,8,2,18, - 1,4,1,14,1,8,1,16,1,16,1,16,1,16,1,16, - 1,16,1,16,1,16,1,16,1,16,1,16,1,12,1,10, - 1,18,1,8,2,2,1,14,1,16,1,24,1,14,1,18, - 4,2,1,28,1,22,1,16,1,24,2,10,2,10,3,2, - 1,14,1,16,1,22,2,12,1,12,1,20,1,8,1,22, - 1,14,1,114,26,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,1,0,0,0,8,0,0,0,67,0,0,0, - 115,108,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, - 60,122,16,100,4,100,5,108,4,109,5,125,0,1,0,87, - 0,110,38,4,0,116,6,107,10,114,82,1,0,1,0,1, - 0,116,1,160,2,100,1,161,1,1,0,116,3,100,2,131, - 1,130,1,89,0,110,2,88,0,87,0,53,0,100,6,97, - 0,88,0,116,1,160,2,100,7,161,1,1,0,124,0,83, - 0,41,8,78,122,27,122,105,112,105,109,112,111,114,116,58, - 32,122,108,105,98,32,85,78,65,86,65,73,76,65,66,76, - 69,122,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,41,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, - 69,0,0,0,114,70,0,0,0,114,3,0,0,0,90,4, - 122,108,105,98,114,130,0,0,0,218,9,69,120,99,101,112, - 116,105,111,110,41,1,114,130,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, - 254,1,0,0,115,24,0,0,0,0,2,4,3,10,1,8, - 2,4,1,4,1,16,1,14,1,10,1,18,2,6,2,10, - 1,114,133,0,0,0,99,2,0,0,0,0,0,0,0,17, - 0,0,0,9,0,0,0,67,0,0,0,115,130,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,100,3,161,2,144,1, - 143,8,125,10,122,14,124,10,160,3,124,6,161,1,1,0, - 87,0,110,38,4,0,116,4,107,10,114,104,1,0,1,0, - 1,0,116,0,100,4,124,0,155,2,157,2,124,0,100,5, - 141,2,130,1,89,0,110,2,88,0,124,10,160,5,100,6, - 161,1,125,11,116,6,124,11,131,1,100,6,107,3,114,136, - 116,7,100,7,131,1,130,1,124,11,100,0,100,8,133,2, - 25,0,100,9,107,3,114,170,116,0,100,10,124,0,155,2, - 157,2,124,0,100,5,141,2,130,1,116,8,124,11,100,11, - 100,12,133,2,25,0,131,1,125,12,116,8,124,11,100,12, - 100,6,133,2,25,0,131,1,125,13,100,6,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,40,4,0, - 116,4,107,10,144,1,114,20,1,0,1,0,1,0,116,0, - 100,4,124,0,155,2,157,2,124,0,100,5,141,2,130,1, - 89,0,110,2,88,0,124,10,160,5,124,4,161,1,125,15, - 116,6,124,15,131,1,124,4,107,3,144,1,114,54,116,4, - 100,13,131,1,130,1,87,0,53,0,81,0,82,0,88,0, - 124,3,100,1,107,2,144,1,114,78,124,15,83,0,122,10, - 116,9,131,0,125,16,87,0,110,30,4,0,116,10,107,10, - 144,1,114,118,1,0,1,0,1,0,116,0,100,14,131,1, - 130,1,89,0,110,2,88,0,124,16,124,15,100,15,131,2, - 83,0,41,16,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,84, - 0,0,0,122,21,99,97,110,39,116,32,114,101,97,100,32, - 90,105,112,32,102,105,108,101,58,32,41,1,114,12,0,0, - 0,114,95,0,0,0,122,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,114,85,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, - 94,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, - 122,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,105,241,255,255,255, - 41,11,114,3,0,0,0,114,101,0,0,0,114,102,0,0, - 0,114,103,0,0,0,114,21,0,0,0,114,105,0,0,0, - 114,48,0,0,0,114,110,0,0,0,114,1,0,0,0,114, - 133,0,0,0,114,132,0,0,0,41,17,114,28,0,0,0, - 114,51,0,0,0,90,8,100,97,116,97,112,97,116,104,114, - 121,0,0,0,114,125,0,0,0,114,116,0,0,0,114,128, - 0,0,0,114,122,0,0,0,114,123,0,0,0,114,124,0, - 0,0,114,114,0,0,0,114,115,0,0,0,114,126,0,0, - 0,114,127,0,0,0,114,118,0,0,0,90,8,114,97,119, - 95,100,97,116,97,114,130,0,0,0,114,9,0,0,0,114, - 9,0,0,0,114,10,0,0,0,114,49,0,0,0,19,2, - 0,0,115,62,0,0,0,0,1,20,1,8,1,8,2,16, - 2,2,1,14,1,14,1,24,1,10,1,12,1,8,2,16, - 2,18,2,16,1,16,1,12,1,8,1,2,1,14,1,16, - 1,24,1,10,1,14,1,18,2,10,2,4,3,2,1,10, - 1,16,1,14,1,114,49,0,0,0,99,2,0,0,0,0, - 0,0,0,2,0,0,0,3,0,0,0,67,0,0,0,115, - 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,65,2,0,0,115,2,0,0,0, - 0,2,114,136,0,0,0,99,5,0,0,0,0,0,0,0, - 14,0,0,0,8,0,0,0,67,0,0,0,115,68,1,0, - 0,124,3,124,2,100,1,156,2,125,5,122,18,116,0,160, - 1,124,4,124,3,124,5,161,3,125,6,87,0,110,26,4, - 0,116,2,107,10,114,54,1,0,1,0,1,0,89,0,100, - 0,83,0,89,0,110,2,88,0,124,6,100,2,64,0,100, - 3,107,3,125,7,124,7,114,190,124,6,100,4,64,0,100, - 3,107,3,125,8,116,3,106,4,100,5,107,3,114,188,124, - 8,115,108,116,3,106,4,100,6,107,2,114,188,116,5,124, - 0,124,2,131,2,125,9,124,9,100,0,107,9,114,188,116, - 3,160,6,116,0,106,7,124,9,161,2,125,10,122,20,116, - 8,160,9,124,4,124,10,124,3,124,5,161,4,1,0,87, - 0,110,26,4,0,116,2,107,10,114,186,1,0,1,0,1, - 0,89,0,100,0,83,0,89,0,110,2,88,0,110,84,116, - 10,124,0,124,2,131,2,92,2,125,11,125,12,124,11,144, - 1,114,18,116,11,116,12,124,4,100,7,100,8,133,2,25, - 0,131,1,124,11,131,2,114,254,116,12,124,4,100,8,100, - 9,133,2,25,0,131,1,124,12,107,3,144,1,114,18,116, - 13,160,14,100,10,124,3,155,2,157,2,161,1,1,0,100, - 0,83,0,116,15,160,16,124,4,100,9,100,0,133,2,25, - 0,161,1,125,13,116,17,124,13,116,18,131,2,144,1,115, - 64,116,19,100,11,124,1,155,2,100,12,157,3,131,1,130, - 1,124,13,83,0,41,13,78,41,2,114,54,0,0,0,114, - 12,0,0,0,114,5,0,0,0,114,0,0,0,0,114,79, - 0,0,0,90,5,110,101,118,101,114,90,6,97,108,119,97, - 121,115,114,90,0,0,0,114,86,0,0,0,114,87,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,20,114,20,0,0,0,90,13,95,99,108,97,115, - 115,105,102,121,95,112,121,99,114,68,0,0,0,218,4,95, - 105,109,112,90,21,99,104,101,99,107,95,104,97,115,104,95, - 98,97,115,101,100,95,112,121,99,115,218,15,95,103,101,116, - 95,112,121,99,95,115,111,117,114,99,101,218,11,115,111,117, - 114,99,101,95,104,97,115,104,90,17,95,82,65,87,95,77, - 65,71,73,67,95,78,85,77,66,69,82,90,18,95,98,111, - 111,115,116,114,97,112,95,101,120,116,101,114,110,97,108,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,136,0,0,0,114,2,0,0,0,114,69,0,0, - 0,114,70,0,0,0,218,7,109,97,114,115,104,97,108,90, - 5,108,111,97,100,115,114,14,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,31,0,0,0,114,50,0,0,0,114,56, - 0,0,0,114,37,0,0,0,114,117,0,0,0,90,11,101, - 120,99,95,100,101,116,97,105,108,115,114,120,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,139,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,43,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,75,2,0,0, - 115,88,0,0,0,0,2,2,1,2,254,6,5,2,1,18, - 1,14,1,12,2,12,1,4,1,12,1,10,1,2,255,2, - 1,8,255,2,2,10,1,8,1,4,1,4,1,2,254,4, - 5,2,1,4,1,2,0,2,0,2,0,2,255,8,2,14, - 1,14,3,8,255,6,3,6,3,22,1,18,255,4,2,4, - 1,8,255,4,2,4,2,18,1,12,1,16,1,114,144,0, - 0,0,99,1,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,18,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,126,2,0,0,115,6,0,0,0, - 0,1,12,1,12,1,114,148,0,0,0,99,2,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,67,0,0,0,84,41,1,90,12,100,111,110,116,95,105, - 110,104,101,114,105,116,41,2,114,148,0,0,0,218,7,99, - 111,109,112,105,108,101,41,2,114,50,0,0,0,114,147,0, + 0,0,218,12,103,101,116,95,102,105,108,101,110,97,109,101, + 184,0,0,0,115,4,0,0,0,0,7,16,1,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, + 6,0,0,0,8,0,0,0,67,0,0,0,115,128,0,0, + 0,116,0,124,0,124,1,131,2,125,2,124,2,100,1,107, + 8,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,22,4,0,116,6,107, + 10,114,110,1,0,1,0,1,0,89,0,100,1,83,0,88, + 0,116,7,124,0,106,8,124,5,131,2,160,9,161,0,83, + 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,218,4,110,97,109,101,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,52,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,54,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,195,0,0,0,115,24,0,0, + 0,0,7,10,1,8,1,18,2,10,1,4,1,14,2,10, + 2,2,1,14,1,14,2,8,1,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,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,107,8,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,57,0,0,0,114,58,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,218,10,105,115,95,112,97, + 99,107,97,103,101,221,0,0,0,115,8,0,0,0,0,6, + 10,1,8,1,18,1,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,8,0,0,0,8,0,0,0,67, + 0,0,0,115,248,0,0,0,116,0,124,0,124,1,131,2, + 92,3,125,2,125,3,125,4,116,1,106,2,160,3,124,1, + 161,1,125,5,124,5,100,1,107,8,115,46,116,4,124,5, + 116,5,131,2,115,64,116,5,124,1,131,1,125,5,124,5, + 116,1,106,2,124,1,60,0,124,0,124,5,95,6,122,84, + 124,3,114,108,116,7,124,0,124,1,131,2,125,6,116,8, + 160,9,124,0,106,10,124,6,161,2,125,7,124,7,103,1, + 124,5,95,11,116,12,124,5,100,2,131,2,115,124,116,13, + 124,5,95,13,116,8,160,14,124,5,106,15,124,1,124,4, + 161,3,1,0,116,16,124,2,124,5,106,15,131,2,1,0, + 87,0,110,22,1,0,1,0,1,0,116,1,106,2,124,1, + 61,0,130,0,89,0,110,2,88,0,122,14,116,1,106,2, + 124,1,25,0,125,5,87,0,110,36,4,0,116,17,107,10, + 114,228,1,0,1,0,1,0,116,18,100,3,124,1,155,2, + 100,4,157,3,131,1,130,1,89,0,110,2,88,0,116,19, + 160,20,100,5,124,1,124,4,161,3,1,0,124,5,83,0, + 41,6,122,245,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,119,97,115,110,39,116,32,102,111,117,110,100,46, + 10,32,32,32,32,32,32,32,32,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,21,114,44,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,66,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,218,10,95,98,111,111, + 116,115,116,114,97,112,218,16,95,118,101,114,98,111,115,101, + 95,109,101,115,115,97,103,101,41,8,114,32,0,0,0,114, + 38,0,0,0,114,46,0,0,0,114,47,0,0,0,114,40, + 0,0,0,90,3,109,111,100,114,13,0,0,0,114,63,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,133,2,0,0,115,4,0,0,0,0,1,8,1,114, - 150,0,0,0,99,2,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,79,0,0,0,114,13,0, - 0,0,41,2,114,122,0,0,0,90,6,109,107,116,105,109, - 101,41,2,218,1,100,114,129,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,139,2,0,0,115,24, - 0,0,0,0,1,4,1,10,1,10,1,6,1,6,1,10, - 1,10,1,2,0,2,0,2,250,2,255,114,158,0,0,0, - 99,2,0,0,0,0,0,0,0,6,0,0,0,10,0,0, - 0,67,0,0,0,115,116,0,0,0,122,82,124,1,100,1, - 100,0,133,2,25,0,100,2,107,6,115,22,116,0,130,1, - 124,1,100,0,100,1,133,2,25,0,125,1,124,0,106,1, - 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,2, - 124,4,124,3,131,2,124,5,102,2,87,0,83,0,4,0, - 116,3,116,4,116,5,102,3,107,10,114,110,1,0,1,0, - 1,0,89,0,100,6,83,0,88,0,100,0,83,0,41,7, - 78,114,13,0,0,0,41,2,218,1,99,218,1,111,114,152, - 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,6,218,14,65,115,115, - 101,114,116,105,111,110,69,114,114,111,114,114,27,0,0,0, - 114,158,0,0,0,114,25,0,0,0,218,10,73,110,100,101, - 120,69,114,114,111,114,114,143,0,0,0,41,6,114,31,0, - 0,0,114,12,0,0,0,114,51,0,0,0,114,122,0,0, - 0,114,123,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,140,0,0,0,152,2,0, - 0,115,20,0,0,0,0,1,2,2,20,1,12,1,10,3, - 8,1,8,1,8,1,16,1,20,1,114,140,0,0,0,99, - 2,0,0,0,0,0,0,0,3,0,0,0,8,0,0,0, - 67,0,0,0,115,86,0,0,0,124,1,100,1,100,0,133, - 2,25,0,100,2,107,6,115,20,116,0,130,1,124,1,100, - 0,100,1,133,2,25,0,125,1,122,14,124,0,106,1,124, - 1,25,0,125,2,87,0,110,22,4,0,116,2,107,10,114, - 68,1,0,1,0,1,0,89,0,100,0,83,0,88,0,116, - 3,124,0,106,4,124,2,131,2,83,0,100,0,83,0,41, - 3,78,114,13,0,0,0,41,2,114,159,0,0,0,114,160, - 0,0,0,41,5,114,163,0,0,0,114,27,0,0,0,114, - 25,0,0,0,114,49,0,0,0,114,28,0,0,0,41,3, - 114,31,0,0,0,114,12,0,0,0,114,51,0,0,0,114, - 9,0,0,0,114,9,0,0,0,114,10,0,0,0,114,138, - 0,0,0,171,2,0,0,115,14,0,0,0,0,2,20,1, - 12,2,2,1,14,1,14,1,8,2,114,138,0,0,0,99, - 2,0,0,0,0,0,0,0,11,0,0,0,9,0,0,0, - 67,0,0,0,115,198,0,0,0,116,0,124,0,124,1,131, - 2,125,2,116,1,68,0,93,160,92,3,125,3,125,4,125, - 5,124,2,124,3,23,0,125,6,116,2,106,3,100,1,124, - 0,106,4,116,5,124,6,100,2,100,3,141,5,1,0,122, - 14,124,0,106,6,124,6,25,0,125,7,87,0,110,20,4, - 0,116,7,107,10,114,88,1,0,1,0,1,0,89,0,113, - 14,88,0,124,7,100,4,25,0,125,8,116,8,124,0,106, - 4,124,7,131,2,125,9,124,4,114,132,116,9,124,0,124, - 8,124,6,124,1,124,9,131,5,125,10,110,10,116,10,124, - 8,124,9,131,2,125,10,124,10,100,0,107,8,114,152,113, - 14,124,7,100,4,25,0,125,8,124,10,124,5,124,8,102, - 3,2,0,1,0,83,0,113,14,116,11,100,5,124,1,155, - 2,157,2,124,1,100,6,141,2,130,1,100,0,83,0,41, - 7,78,122,13,116,114,121,105,110,103,32,123,125,123,125,123, - 125,114,79,0,0,0,41,1,90,9,118,101,114,98,111,115, - 105,116,121,114,0,0,0,0,122,18,99,97,110,39,116,32, - 102,105,110,100,32,109,111,100,117,108,101,32,41,1,114,54, - 0,0,0,41,12,114,35,0,0,0,114,81,0,0,0,114, - 69,0,0,0,114,70,0,0,0,114,28,0,0,0,114,19, - 0,0,0,114,27,0,0,0,114,25,0,0,0,114,49,0, - 0,0,114,144,0,0,0,114,150,0,0,0,114,3,0,0, - 0,41,11,114,31,0,0,0,114,37,0,0,0,114,12,0, - 0,0,114,82,0,0,0,114,83,0,0,0,114,44,0,0, - 0,114,56,0,0,0,114,51,0,0,0,114,39,0,0,0, - 114,117,0,0,0,114,43,0,0,0,114,9,0,0,0,114, - 9,0,0,0,114,10,0,0,0,114,42,0,0,0,186,2, - 0,0,115,36,0,0,0,0,1,10,1,14,1,8,1,22, - 1,2,1,14,1,14,1,6,2,8,1,12,1,4,1,18, - 2,10,1,8,3,2,1,8,1,16,2,114,42,0,0,0, - 99,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0, - 0,64,0,0,0,115,60,0,0,0,101,0,90,1,100,0, - 90,2,100,1,90,3,100,2,90,4,100,3,100,4,132,0, - 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,83,0,41,14,114,73,0,0,0,122,165,80, - 114,105,118,97,116,101,32,99,108,97,115,115,32,117,115,101, - 100,32,116,111,32,115,117,112,112,111,114,116,32,90,105,112, - 73,109,112,111,114,116,46,103,101,116,95,114,101,115,111,117, - 114,99,101,95,114,101,97,100,101,114,40,41,46,10,10,32, - 32,32,32,84,104,105,115,32,99,108,97,115,115,32,105,115, - 32,97,108,108,111,119,101,100,32,116,111,32,114,101,102,101, - 114,101,110,99,101,32,97,108,108,32,116,104,101,32,105,110, - 110,97,114,100,115,32,97,110,100,32,112,114,105,118,97,116, - 101,32,112,97,114,116,115,32,111,102,10,32,32,32,32,116, - 104,101,32,122,105,112,105,109,112,111,114,116,101,114,46,10, - 32,32,32,32,70,99,3,0,0,0,0,0,0,0,3,0, - 0,0,2,0,0,0,67,0,0,0,115,16,0,0,0,124, - 1,124,0,95,0,124,2,124,0,95,1,100,0,83,0,41, - 1,78,41,2,114,4,0,0,0,114,37,0,0,0,41,3, - 114,31,0,0,0,114,4,0,0,0,114,37,0,0,0,114, - 9,0,0,0,114,9,0,0,0,114,10,0,0,0,114,33, - 0,0,0,220,2,0,0,115,4,0,0,0,0,1,6,1, - 122,33,95,90,105,112,73,109,112,111,114,116,82,101,115,111, - 117,114,99,101,82,101,97,100,101,114,46,95,95,105,110,105, - 116,95,95,99,2,0,0,0,0,0,0,0,5,0,0,0, - 8,0,0,0,67,0,0,0,115,92,0,0,0,124,0,106, - 0,160,1,100,1,100,2,161,2,125,2,124,2,155,0,100, - 2,124,1,155,0,157,3,125,3,100,3,100,4,108,2,109, - 3,125,4,1,0,122,18,124,4,124,0,106,4,160,5,124, - 3,161,1,131,1,87,0,83,0,4,0,116,6,107,10,114, - 86,1,0,1,0,1,0,116,7,124,3,131,1,130,1,89, - 0,110,2,88,0,100,0,83,0,41,5,78,114,78,0,0, - 0,114,100,0,0,0,114,0,0,0,0,41,1,218,7,66, - 121,116,101,115,73,79,41,8,114,37,0,0,0,114,18,0, - 0,0,90,2,105,111,114,165,0,0,0,114,4,0,0,0, - 114,52,0,0,0,114,21,0,0,0,218,17,70,105,108,101, - 78,111,116,70,111,117,110,100,69,114,114,111,114,41,5,114, - 31,0,0,0,218,8,114,101,115,111,117,114,99,101,218,16, - 102,117,108,108,110,97,109,101,95,97,115,95,112,97,116,104, - 114,12,0,0,0,114,165,0,0,0,114,9,0,0,0,114, - 9,0,0,0,114,10,0,0,0,218,13,111,112,101,110,95, - 114,101,115,111,117,114,99,101,224,2,0,0,115,14,0,0, - 0,0,1,14,1,14,1,12,1,2,1,18,1,14,1,122, - 38,95,90,105,112,73,109,112,111,114,116,82,101,115,111,117, - 114,99,101,82,101,97,100,101,114,46,111,112,101,110,95,114, - 101,115,111,117,114,99,101,99,2,0,0,0,0,0,0,0, - 2,0,0,0,1,0,0,0,67,0,0,0,115,8,0,0, - 0,116,0,130,1,100,0,83,0,41,1,78,41,1,114,166, - 0,0,0,41,2,114,31,0,0,0,114,167,0,0,0,114, - 9,0,0,0,114,9,0,0,0,114,10,0,0,0,218,13, - 114,101,115,111,117,114,99,101,95,112,97,116,104,233,2,0, - 0,115,2,0,0,0,0,4,122,38,95,90,105,112,73,109, - 112,111,114,116,82,101,115,111,117,114,99,101,82,101,97,100, - 101,114,46,114,101,115,111,117,114,99,101,95,112,97,116,104, - 99,2,0,0,0,0,0,0,0,4,0,0,0,8,0,0, - 0,67,0,0,0,115,72,0,0,0,124,0,106,0,160,1, - 100,1,100,2,161,2,125,2,124,2,155,0,100,2,124,1, - 155,0,157,3,125,3,122,16,124,0,106,2,160,3,124,3, - 161,1,1,0,87,0,110,22,4,0,116,4,107,10,114,66, - 1,0,1,0,1,0,89,0,100,3,83,0,88,0,100,4, - 83,0,41,5,78,114,78,0,0,0,114,100,0,0,0,70, - 84,41,5,114,37,0,0,0,114,18,0,0,0,114,4,0, - 0,0,114,52,0,0,0,114,21,0,0,0,41,4,114,31, - 0,0,0,114,54,0,0,0,114,168,0,0,0,114,12,0, + 0,218,11,108,111,97,100,95,109,111,100,117,108,101,234,0, + 0,0,115,48,0,0,0,0,7,16,1,12,1,18,1,8, + 1,10,1,6,2,2,1,4,3,10,1,14,1,8,2,10, + 1,6,1,16,1,16,1,6,1,8,1,8,2,2,1,14, + 1,14,1,22,1,14,1,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,3,0,0,0,8,0,0, + 0,67,0,0,0,115,88,0,0,0,122,20,124,0,160,0, + 124,1,161,1,115,18,87,0,100,1,83,0,87,0,110,22, + 4,0,116,1,107,10,114,42,1,0,1,0,1,0,89,0, + 100,1,83,0,88,0,116,2,106,3,115,78,100,2,100,3, + 108,4,109,5,125,2,1,0,124,2,160,6,116,2,161,1, + 1,0,100,4,116,2,95,3,116,2,124,0,124,1,131,2, + 83,0,41,5,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,14,82,101,115,111, + 117,114,99,101,82,101,97,100,101,114,84,41,7,114,65,0, + 0,0,114,3,0,0,0,218,24,95,90,105,112,73,109,112, + 111,114,116,82,101,115,111,117,114,99,101,82,101,97,100,101, + 114,218,11,95,114,101,103,105,115,116,101,114,101,100,90,13, + 105,109,112,111,114,116,108,105,98,46,97,98,99,114,79,0, + 0,0,90,8,114,101,103,105,115,116,101,114,41,3,114,32, + 0,0,0,114,38,0,0,0,114,79,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,16,1,0,0,115,20,0,0,0,0,6,2,1,10,1, + 10,1,14,1,8,1,6,1,12,1,10,1,6,1,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,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, + 34,1,0,0,115,2,0,0,0,0,1,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,15,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,48,0,0,0,114,55,0,0,0,114,56,0,0,0,114, + 64,0,0,0,114,65,0,0,0,114,78,0,0,0,114,82, + 0,0,0,114,83,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,45,0,0,0,115,24,0,0,0,8,13,4,5,8,46, + 10,32,10,12,8,10,8,21,8,11,8,26,8,13,8,38, + 8,18,122,12,95,95,105,110,105,116,95,95,46,112,121,99, + 84,114,60,0,0,0,70,41,3,122,4,46,112,121,99,84, + 70,41,3,114,61,0,0,0,70,70,99,2,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,218,11,105,115,95,114,101,115,111,117,114,99,101,239,2, - 0,0,115,14,0,0,0,0,3,14,1,14,1,2,1,16, - 1,14,1,8,1,122,36,95,90,105,112,73,109,112,111,114, - 116,82,101,115,111,117,114,99,101,82,101,97,100,101,114,46, - 105,115,95,114,101,115,111,117,114,99,101,99,1,0,0,0, - 0,0,0,0,9,0,0,0,9,0,0,0,99,0,0,0, - 115,186,0,0,0,100,1,100,2,108,0,109,1,125,1,1, - 0,124,1,124,0,106,2,160,3,124,0,106,4,161,1,131, - 1,125,2,124,2,160,5,124,0,106,2,106,6,161,1,125, - 3,124,3,106,7,100,3,107,2,115,58,116,8,130,1,124, - 3,106,9,125,4,116,10,131,0,125,5,124,0,106,2,106, - 11,68,0,93,102,125,6,122,18,124,1,124,6,131,1,160, - 5,124,4,161,1,125,7,87,0,110,24,4,0,116,12,107, - 10,114,124,1,0,1,0,1,0,89,0,113,78,89,0,110, - 2,88,0,124,7,106,9,106,7,125,8,116,13,124,8,131, - 1,100,1,107,2,114,156,124,7,106,7,86,0,1,0,113, - 78,124,8,124,5,107,7,114,78,124,5,160,14,124,8,161, - 1,1,0,124,8,86,0,1,0,113,78,100,0,83,0,41, - 4,78,114,0,0,0,0,41,1,218,4,80,97,116,104,122, - 11,95,95,105,110,105,116,95,95,46,112,121,41,15,90,7, - 112,97,116,104,108,105,98,114,172,0,0,0,114,4,0,0, - 0,114,53,0,0,0,114,37,0,0,0,90,11,114,101,108, - 97,116,105,118,101,95,116,111,114,28,0,0,0,114,54,0, - 0,0,114,163,0,0,0,90,6,112,97,114,101,110,116,218, - 3,115,101,116,114,27,0,0,0,114,22,0,0,0,114,48, - 0,0,0,218,3,97,100,100,41,9,114,31,0,0,0,114, - 172,0,0,0,90,13,102,117,108,108,110,97,109,101,95,112, - 97,116,104,90,13,114,101,108,97,116,105,118,101,95,112,97, - 116,104,90,12,112,97,99,107,97,103,101,95,112,97,116,104, - 90,12,115,117,98,100,105,114,115,95,115,101,101,110,218,8, - 102,105,108,101,110,97,109,101,90,8,114,101,108,97,116,105, - 118,101,90,11,112,97,114,101,110,116,95,110,97,109,101,114, - 9,0,0,0,114,9,0,0,0,114,10,0,0,0,218,8, - 99,111,110,116,101,110,116,115,250,2,0,0,115,34,0,0, - 0,0,8,12,1,18,1,14,3,14,1,6,1,6,1,12, - 1,2,1,18,1,14,1,10,5,8,1,12,1,10,1,8, - 1,10,1,122,33,95,90,105,112,73,109,112,111,114,116,82, - 101,115,111,117,114,99,101,82,101,97,100,101,114,46,99,111, - 110,116,101,110,116,115,78,41,10,114,6,0,0,0,114,7, - 0,0,0,114,8,0,0,0,114,77,0,0,0,114,74,0, - 0,0,114,33,0,0,0,114,169,0,0,0,114,170,0,0, - 0,114,171,0,0,0,114,176,0,0,0,114,9,0,0,0, + 0,114,36,0,0,0,52,1,0,0,115,2,0,0,0,0, + 1,114,36,0,0,0,99,2,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,107,6, + 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,56,1,0,0,115,4, + 0,0,0,0,4,8,2,114,37,0,0,0,99,2,0,0, + 0,0,0,0,0,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,107,6,114,14, + 124,5,2,0,1,0,83,0,113,14,100,0,83,0,114,88, + 0,0,0,41,3,114,36,0,0,0,218,16,95,122,105,112, + 95,115,101,97,114,99,104,111,114,100,101,114,114,28,0,0, + 0,41,7,114,32,0,0,0,114,38,0,0,0,114,13,0, + 0,0,218,6,115,117,102,102,105,120,218,10,105,115,98,121, + 116,101,99,111,100,101,114,47,0,0,0,114,63,0,0,0, 114,9,0,0,0,114,9,0,0,0,114,10,0,0,0,114, - 73,0,0,0,212,2,0,0,115,14,0,0,0,8,5,4, - 1,4,2,8,4,8,9,8,6,8,11,114,73,0,0,0, - 41,45,114,77,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,20,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,69,0,0,0,114,137,0,0,0,114, - 101,0,0,0,114,141,0,0,0,114,60,0,0,0,114,122, - 0,0,0,90,7,95,95,97,108,108,95,95,114,19,0,0, - 0,90,15,112,97,116,104,95,115,101,112,97,114,97,116,111, - 114,115,114,17,0,0,0,114,68,0,0,0,114,3,0,0, - 0,114,24,0,0,0,218,4,116,121,112,101,114,63,0,0, - 0,114,104,0,0,0,114,106,0,0,0,114,108,0,0,0, - 114,4,0,0,0,114,81,0,0,0,114,35,0,0,0,114, - 36,0,0,0,114,34,0,0,0,114,26,0,0,0,114,113, - 0,0,0,114,131,0,0,0,114,133,0,0,0,114,49,0, - 0,0,114,136,0,0,0,114,144,0,0,0,218,8,95,95, - 99,111,100,101,95,95,114,142,0,0,0,114,148,0,0,0, - 114,150,0,0,0,114,158,0,0,0,114,140,0,0,0,114, - 138,0,0,0,114,42,0,0,0,114,73,0,0,0,114,9, + 35,0,0,0,65,1,0,0,115,12,0,0,0,0,1,10, + 1,14,1,8,1,10,1,10,1,114,35,0,0,0,99,1, + 0,0,0,0,0,0,0,26,0,0,0,9,0,0,0,67, + 0,0,0,115,254,4,0,0,122,16,116,0,160,1,124,0, + 100,1,161,2,125,1,87,0,110,38,4,0,116,2,107,10, + 114,54,1,0,1,0,1,0,116,3,100,2,124,0,155,2, + 157,2,124,0,100,3,141,2,130,1,89,0,110,2,88,0, + 124,1,144,4,143,168,1,0,122,36,124,1,160,4,116,5, + 11,0,100,4,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,38,4,0, + 116,2,107,10,114,138,1,0,1,0,1,0,116,3,100,5, + 124,0,155,2,157,2,124,0,100,3,141,2,130,1,89,0, + 110,2,88,0,116,8,124,3,131,1,116,5,107,3,114,170, + 116,3,100,5,124,0,155,2,157,2,124,0,100,3,141,2, + 130,1,124,3,100,0,100,6,133,2,25,0,116,9,107,3, + 144,1,114,180,122,24,124,1,160,4,100,7,100,4,161,2, + 1,0,124,1,160,6,161,0,125,4,87,0,110,38,4,0, + 116,2,107,10,114,250,1,0,1,0,1,0,116,3,100,5, + 124,0,155,2,157,2,124,0,100,3,141,2,130,1,89,0, + 110,2,88,0,116,10,124,4,116,11,24,0,116,5,24,0, + 100,7,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,40,4,0, + 116,2,107,10,144,1,114,76,1,0,1,0,1,0,116,3, + 100,5,124,0,155,2,157,2,124,0,100,3,141,2,130,1, + 89,0,110,2,88,0,124,6,160,12,116,9,161,1,125,7, + 124,7,100,7,107,0,144,1,114,116,116,3,100,8,124,0, + 155,2,157,2,124,0,100,3,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,164,116,3,100,9,124,0, + 155,2,157,2,124,0,100,3,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,10,100,11,133,2,25,0,131,1,125,8,116,13,124,3, + 100,11,100,12,133,2,25,0,131,1,125,9,124,2,124,8, + 107,0,144,1,114,240,116,3,100,13,124,0,155,2,157,2, + 124,0,100,3,141,2,130,1,124,2,124,9,107,0,144,2, + 114,12,116,3,100,14,124,0,155,2,157,2,124,0,100,3, + 141,2,130,1,124,2,124,8,56,0,125,2,124,2,124,9, + 24,0,125,10,124,10,100,7,107,0,144,2,114,56,116,3, + 100,15,124,0,155,2,157,2,124,0,100,3,141,2,130,1, + 105,0,125,11,100,7,125,12,122,14,124,1,160,4,124,2, + 161,1,1,0,87,0,110,40,4,0,116,2,107,10,144,2, + 114,118,1,0,1,0,1,0,116,3,100,5,124,0,155,2, + 157,2,124,0,100,3,141,2,130,1,89,0,110,2,88,0, + 124,1,160,7,100,16,161,1,125,3,116,8,124,3,131,1, + 100,6,107,0,144,2,114,152,116,14,100,17,131,1,130,1, + 124,3,100,0,100,6,133,2,25,0,100,18,107,3,144,2, + 114,174,144,4,113,226,116,8,124,3,131,1,100,16,107,3, + 144,2,114,196,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,10,133,2,25,0,131,1,125,14,116,15,124,3, + 100,10,100,21,133,2,25,0,131,1,125,15,116,15,124,3, + 100,21,100,11,133,2,25,0,131,1,125,16,116,13,124,3, + 100,11,100,12,133,2,25,0,131,1,125,17,116,13,124,3, + 100,12,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,156,116,3,100,28,124,0,155,2,157,2,124,0,100,3, + 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,40,4,0,116,2, + 107,10,144,3,114,218,1,0,1,0,1,0,116,3,100,5, + 124,0,155,2,157,2,124,0,100,3,141,2,130,1,89,0, + 110,2,88,0,116,8,124,23,131,1,124,19,107,3,144,3, + 114,252,116,3,100,5,124,0,155,2,157,2,124,0,100,3, + 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,44,116,3,100,5,124,0,155,2,157,2,124,0,100,3, + 141,2,130,1,87,0,110,40,4,0,116,2,107,10,144,4, + 114,86,1,0,1,0,1,0,116,3,100,5,124,0,155,2, + 157,2,124,0,100,3,141,2,130,1,89,0,110,2,88,0, + 124,13,100,29,64,0,144,4,114,108,124,23,160,16,161,0, + 125,23,110,54,122,14,124,23,160,16,100,30,161,1,125,23, + 87,0,110,38,4,0,116,17,107,10,144,4,114,160,1,0, + 1,0,1,0,124,23,160,16,100,31,161,1,160,18,116,19, + 161,1,125,23,89,0,110,2,88,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,120,87,0,53,0,81,0, + 82,0,88,0,116,24,160,25,100,34,124,12,124,0,161,3, + 1,0,124,11,83,0,41,35,78,218,2,114,98,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,86,0,0,0,250,21, + 99,97,110,39,116,32,114,101,97,100,32,90,105,112,32,102, + 105,108,101,58,32,233,4,0,0,0,114,0,0,0,0,122, + 16,110,111,116,32,97,32,90,105,112,32,102,105,108,101,58, + 32,122,18,99,111,114,114,117,112,116,32,90,105,112,32,102, + 105,108,101,58,32,233,12,0,0,0,233,16,0,0,0,233, + 20,0,0,0,122,28,98,97,100,32,99,101,110,116,114,97, + 108,32,100,105,114,101,99,116,111,114,121,32,115,105,122,101, + 58,32,122,30,98,97,100,32,99,101,110,116,114,97,108,32, + 100,105,114,101,99,116,111,114,121,32,111,102,102,115,101,116, + 58,32,122,38,98,97,100,32,99,101,110,116,114,97,108,32, + 100,105,114,101,99,116,111,114,121,32,115,105,122,101,32,111, + 114,32,111,102,102,115,101,116,58,32,233,46,0,0,0,250, + 27,69,79,70,32,114,101,97,100,32,119,104,101,114,101,32, + 110,111,116,32,101,120,112,101,99,116,101,100,115,4,0,0, + 0,80,75,1,2,233,8,0,0,0,233,10,0,0,0,233, + 14,0,0,0,233,24,0,0,0,233,28,0,0,0,233,30, + 0,0,0,233,32,0,0,0,233,34,0,0,0,233,42,0, + 0,0,122,25,98,97,100,32,108,111,99,97,108,32,104,101, + 97,100,101,114,32,111,102,102,115,101,116,58,32,105,0,8, + 0,0,218,5,97,115,99,105,105,90,6,108,97,116,105,110, + 49,250,1,47,114,5,0,0,0,122,33,122,105,112,105,109, + 112,111,114,116,58,32,102,111,117,110,100,32,123,125,32,110, + 97,109,101,115,32,105,110,32,123,33,114,125,41,26,218,3, + 95,105,111,218,4,111,112,101,110,114,22,0,0,0,114,3, + 0,0,0,218,4,115,101,101,107,218,20,69,78,68,95,67, + 69,78,84,82,65,76,95,68,73,82,95,83,73,90,69,90, + 4,116,101,108,108,218,4,114,101,97,100,114,51,0,0,0, + 218,18,83,84,82,73,78,71,95,69,78,68,95,65,82,67, + 72,73,86,69,218,3,109,97,120,218,15,77,65,88,95,67, + 79,77,77,69,78,84,95,76,69,78,218,5,114,102,105,110, + 100,114,2,0,0,0,218,8,69,79,70,69,114,114,111,114, + 114,1,0,0,0,114,62,0,0,0,218,18,85,110,105,99, + 111,100,101,68,101,99,111,100,101,69,114,114,111,114,218,9, + 116,114,97,110,115,108,97,116,101,218,11,99,112,52,51,55, + 95,116,97,98,108,101,114,19,0,0,0,114,20,0,0,0, + 114,21,0,0,0,114,30,0,0,0,114,76,0,0,0,114, + 77,0,0,0,41,26,114,29,0,0,0,218,2,102,112,90, + 15,104,101,97,100,101,114,95,112,111,115,105,116,105,111,110, + 218,6,98,117,102,102,101,114,218,9,102,105,108,101,95,115, + 105,122,101,90,17,109,97,120,95,99,111,109,109,101,110,116, + 95,115,116,97,114,116,218,4,100,97,116,97,90,3,112,111, + 115,218,11,104,101,97,100,101,114,95,115,105,122,101,90,13, + 104,101,97,100,101,114,95,111,102,102,115,101,116,90,10,97, + 114,99,95,111,102,102,115,101,116,114,33,0,0,0,218,5, + 99,111,117,110,116,218,5,102,108,97,103,115,218,8,99,111, + 109,112,114,101,115,115,218,4,116,105,109,101,218,4,100,97, + 116,101,218,3,99,114,99,218,9,100,97,116,97,95,115,105, + 122,101,218,9,110,97,109,101,95,115,105,122,101,218,10,101, + 120,116,114,97,95,115,105,122,101,90,12,99,111,109,109,101, + 110,116,95,115,105,122,101,218,11,102,105,108,101,95,111,102, + 102,115,101,116,114,59,0,0,0,114,13,0,0,0,218,1, + 116,114,9,0,0,0,114,9,0,0,0,114,10,0,0,0, + 114,27,0,0,0,96,1,0,0,115,212,0,0,0,0,1, + 2,1,16,1,14,1,24,2,8,1,2,1,14,1,8,1, + 14,1,14,1,24,1,12,1,18,1,18,3,2,1,12,1, + 12,1,14,1,10,1,2,255,12,2,8,1,2,255,2,1, + 2,255,4,2,2,1,10,1,12,1,16,1,10,1,2,255, + 12,2,10,1,10,1,10,1,2,255,6,2,16,1,14,1, + 10,1,2,255,6,2,16,2,16,1,16,1,10,1,18,1, + 10,1,18,1,8,1,8,1,10,1,18,2,4,2,4,1, + 2,1,14,1,16,1,24,2,10,1,14,1,8,2,18,1, + 4,1,14,1,8,1,16,1,16,1,16,1,16,1,16,1, + 16,1,16,1,16,1,16,1,16,1,16,1,12,1,10,1, + 18,1,8,2,2,1,14,1,16,1,24,1,14,1,18,4, + 2,1,28,1,22,1,16,1,24,2,10,2,10,3,2,1, + 14,1,16,1,22,2,12,1,12,1,20,1,8,1,22,1, + 14,1,114,27,0,0,0,117,190,1,0,0,0,1,2,3, + 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19, + 20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35, + 36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51, + 52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67, + 68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83, + 84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99, + 100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115, + 116,117,118,119,120,121,122,123,124,125,126,127,195,135,195,188, + 195,169,195,162,195,164,195,160,195,165,195,167,195,170,195,171, + 195,168,195,175,195,174,195,172,195,132,195,133,195,137,195,166, + 195,134,195,180,195,182,195,178,195,187,195,185,195,191,195,150, + 195,156,194,162,194,163,194,165,226,130,167,198,146,195,161,195, + 173,195,179,195,186,195,177,195,145,194,170,194,186,194,191,226, + 140,144,194,172,194,189,194,188,194,161,194,171,194,187,226,150, + 145,226,150,146,226,150,147,226,148,130,226,148,164,226,149,161, + 226,149,162,226,149,150,226,149,149,226,149,163,226,149,145,226, + 149,151,226,149,157,226,149,156,226,149,155,226,148,144,226,148, + 148,226,148,180,226,148,172,226,148,156,226,148,128,226,148,188, + 226,149,158,226,149,159,226,149,154,226,149,148,226,149,169,226, + 149,166,226,149,160,226,149,144,226,149,172,226,149,167,226,149, + 168,226,149,164,226,149,165,226,149,153,226,149,152,226,149,146, + 226,149,147,226,149,171,226,149,170,226,148,152,226,148,140,226, + 150,136,226,150,132,226,150,140,226,150,144,226,150,128,206,177, + 195,159,206,147,207,128,206,163,207,131,194,181,207,132,206,166, + 206,152,206,169,206,180,226,136,158,207,134,206,181,226,136,169, + 226,137,161,194,177,226,137,165,226,137,164,226,140,160,226,140, + 161,195,183,226,137,136,194,176,226,136,153,194,183,226,136,154, + 226,129,191,194,178,226,150,160,194,160,99,0,0,0,0,0, + 0,0,0,1,0,0,0,8,0,0,0,67,0,0,0,115, + 108,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,60, + 122,16,100,4,100,5,108,4,109,5,125,0,1,0,87,0, + 110,38,4,0,116,6,107,10,114,82,1,0,1,0,1,0, + 116,1,160,2,100,1,161,1,1,0,116,3,100,2,131,1, + 130,1,89,0,110,2,88,0,87,0,53,0,100,6,97,0, + 88,0,116,1,160,2,100,7,161,1,1,0,124,0,83,0, + 41,8,78,122,27,122,105,112,105,109,112,111,114,116,58,32, + 122,108,105,98,32,85,78,65,86,65,73,76,65,66,76,69, + 250,41,99,97,110,39,116,32,100,101,99,111,109,112,114,101, + 115,115,32,100,97,116,97,59,32,122,108,105,98,32,110,111, + 116,32,97,118,97,105,108,97,98,108,101,84,114,0,0,0, + 0,169,1,218,10,100,101,99,111,109,112,114,101,115,115,70, + 122,25,122,105,112,105,109,112,111,114,116,58,32,122,108,105, + 98,32,97,118,97,105,108,97,98,108,101,41,7,218,15,95, + 105,109,112,111,114,116,105,110,103,95,122,108,105,98,114,76, + 0,0,0,114,77,0,0,0,114,3,0,0,0,90,4,122, + 108,105,98,114,142,0,0,0,218,9,69,120,99,101,112,116, + 105,111,110,114,141,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,254,1,0, + 0,115,24,0,0,0,0,2,4,3,10,1,8,2,4,1, + 4,1,16,1,14,1,10,1,18,2,6,2,10,1,114,145, + 0,0,0,99,2,0,0,0,0,0,0,0,17,0,0,0, + 9,0,0,0,67,0,0,0,115,130,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,100,3,161,2,144,1,143,8,125, + 10,122,14,124,10,160,3,124,6,161,1,1,0,87,0,110, + 38,4,0,116,4,107,10,114,104,1,0,1,0,1,0,116, + 0,100,4,124,0,155,2,157,2,124,0,100,5,141,2,130, + 1,89,0,110,2,88,0,124,10,160,5,100,6,161,1,125, + 11,116,6,124,11,131,1,100,6,107,3,114,136,116,7,100, + 7,131,1,130,1,124,11,100,0,100,8,133,2,25,0,100, + 9,107,3,114,170,116,0,100,10,124,0,155,2,157,2,124, + 0,100,5,141,2,130,1,116,8,124,11,100,11,100,12,133, + 2,25,0,131,1,125,12,116,8,124,11,100,12,100,6,133, + 2,25,0,131,1,125,13,100,6,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,40,4,0,116,4,107, + 10,144,1,114,20,1,0,1,0,1,0,116,0,100,4,124, + 0,155,2,157,2,124,0,100,5,141,2,130,1,89,0,110, + 2,88,0,124,10,160,5,124,4,161,1,125,15,116,6,124, + 15,131,1,124,4,107,3,144,1,114,54,116,4,100,13,131, + 1,130,1,87,0,53,0,81,0,82,0,88,0,124,3,100, + 1,107,2,144,1,114,78,124,15,83,0,122,10,116,9,131, + 0,125,16,87,0,110,30,4,0,116,10,107,10,144,1,114, + 118,1,0,1,0,1,0,116,0,100,14,131,1,130,1,89, + 0,110,2,88,0,124,16,124,15,100,15,131,2,83,0,41, + 16,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,92,0,0,0, + 114,93,0,0,0,114,12,0,0,0,114,105,0,0,0,114, + 99,0,0,0,114,94,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,104,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,140,0,0,0,105,241,255,255,255,41,11,114,3,0, + 0,0,114,111,0,0,0,114,112,0,0,0,114,113,0,0, + 0,114,22,0,0,0,114,115,0,0,0,114,51,0,0,0, + 114,120,0,0,0,114,1,0,0,0,114,145,0,0,0,114, + 144,0,0,0,41,17,114,29,0,0,0,114,54,0,0,0, + 90,8,100,97,116,97,112,97,116,104,114,131,0,0,0,114, + 135,0,0,0,114,126,0,0,0,114,138,0,0,0,114,132, + 0,0,0,114,133,0,0,0,114,134,0,0,0,114,124,0, + 0,0,114,125,0,0,0,114,136,0,0,0,114,137,0,0, + 0,114,128,0,0,0,90,8,114,97,119,95,100,97,116,97, + 114,142,0,0,0,114,9,0,0,0,114,9,0,0,0,114, + 10,0,0,0,114,52,0,0,0,19,2,0,0,115,62,0, + 0,0,0,1,20,1,8,1,8,2,16,2,2,1,14,1, + 14,1,24,1,10,1,12,1,8,2,16,2,18,2,16,1, + 16,1,12,1,8,1,2,1,14,1,16,1,24,1,10,1, + 14,1,18,2,10,2,4,3,2,1,10,1,16,1,14,1, + 114,52,0,0,0,99,2,0,0,0,0,0,0,0,2,0, + 0,0,3,0,0,0,67,0,0,0,115,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,65,2,0,0,115,2,0,0,0,0,2,114,148,0, + 0,0,99,5,0,0,0,0,0,0,0,14,0,0,0,8, + 0,0,0,67,0,0,0,115,68,1,0,0,124,3,124,2, + 100,1,156,2,125,5,122,18,116,0,160,1,124,4,124,3, + 124,5,161,3,125,6,87,0,110,26,4,0,116,2,107,10, + 114,54,1,0,1,0,1,0,89,0,100,0,83,0,89,0, + 110,2,88,0,124,6,100,2,64,0,100,3,107,3,125,7, + 124,7,114,190,124,6,100,4,64,0,100,3,107,3,125,8, + 116,3,106,4,100,5,107,3,114,188,124,8,115,108,116,3, + 106,4,100,6,107,2,114,188,116,5,124,0,124,2,131,2, + 125,9,124,9,100,0,107,9,114,188,116,3,160,6,116,0, + 106,7,124,9,161,2,125,10,122,20,116,8,160,9,124,4, + 124,10,124,3,124,5,161,4,1,0,87,0,110,26,4,0, + 116,2,107,10,114,186,1,0,1,0,1,0,89,0,100,0, + 83,0,89,0,110,2,88,0,110,84,116,10,124,0,124,2, + 131,2,92,2,125,11,125,12,124,11,144,1,114,18,116,11, + 116,12,124,4,100,7,100,8,133,2,25,0,131,1,124,11, + 131,2,114,254,116,12,124,4,100,8,100,9,133,2,25,0, + 131,1,124,12,107,3,144,1,114,18,116,13,160,14,100,10, + 124,3,155,2,157,2,161,1,1,0,100,0,83,0,116,15, + 160,16,124,4,100,9,100,0,133,2,25,0,161,1,125,13, + 116,17,124,13,116,18,131,2,144,1,115,64,116,19,100,11, + 124,1,155,2,100,12,157,3,131,1,130,1,124,13,83,0, + 41,13,78,41,2,114,59,0,0,0,114,13,0,0,0,114, + 5,0,0,0,114,0,0,0,0,114,86,0,0,0,90,5, + 110,101,118,101,114,90,6,97,108,119,97,121,115,114,100,0, + 0,0,114,95,0,0,0,114,96,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,20,114, + 21,0,0,0,90,13,95,99,108,97,115,115,105,102,121,95, + 112,121,99,114,75,0,0,0,218,4,95,105,109,112,90,21, + 99,104,101,99,107,95,104,97,115,104,95,98,97,115,101,100, + 95,112,121,99,115,218,15,95,103,101,116,95,112,121,99,95, + 115,111,117,114,99,101,218,11,115,111,117,114,99,101,95,104, + 97,115,104,90,17,95,82,65,87,95,77,65,71,73,67,95, + 78,85,77,66,69,82,90,18,95,98,111,111,115,116,114,97, + 112,95,101,120,116,101,114,110,97,108,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,148,0, + 0,0,114,2,0,0,0,114,76,0,0,0,114,77,0,0, + 0,218,7,109,97,114,115,104,97,108,90,5,108,111,97,100, + 115,114,15,0,0,0,218,10,95,99,111,100,101,95,116,121, + 112,101,218,9,84,121,112,101,69,114,114,111,114,41,14,114, + 32,0,0,0,114,53,0,0,0,114,63,0,0,0,114,38, + 0,0,0,114,127,0,0,0,90,11,101,120,99,95,100,101, + 116,97,105,108,115,114,130,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,151,0,0,0,90,12,115,111,117,114,99,101,95, + 109,116,105,109,101,90,11,115,111,117,114,99,101,95,115,105, + 122,101,114,46,0,0,0,114,9,0,0,0,114,9,0,0, + 0,114,10,0,0,0,218,15,95,117,110,109,97,114,115,104, + 97,108,95,99,111,100,101,75,2,0,0,115,88,0,0,0, + 0,2,2,1,2,254,6,5,2,1,18,1,14,1,12,2, + 12,1,4,1,12,1,10,1,2,255,2,1,8,255,2,2, + 10,1,8,1,4,1,4,1,2,254,4,5,2,1,4,1, + 2,0,2,0,2,0,2,255,8,2,14,1,14,3,8,255, + 6,3,6,3,22,1,18,255,4,2,4,1,8,255,4,2, + 4,2,18,1,12,1,16,1,114,156,0,0,0,99,1,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,126,2,0,0,115,6,0,0,0,0,1,12,1,12, + 1,114,160,0,0,0,99,2,0,0,0,0,0,0,0,2, + 0,0,0,6,0,0,0,67,0,0,0,115,24,0,0,0, + 116,0,124,1,131,1,125,1,116,1,124,1,124,0,100,1, + 100,2,100,3,141,4,83,0,41,4,78,114,74,0,0,0, + 84,41,1,90,12,100,111,110,116,95,105,110,104,101,114,105, + 116,41,2,114,160,0,0,0,218,7,99,111,109,112,105,108, + 101,41,2,114,53,0,0,0,114,159,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,133,2,0, + 0,115,4,0,0,0,0,1,8,1,114,162,0,0,0,99, + 2,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,86,0,0,0,114,14,0,0,0,41,2,114, + 132,0,0,0,90,6,109,107,116,105,109,101,41,2,218,1, + 100,114,139,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,139,2,0,0,115,24,0,0,0,0,1, + 4,1,10,1,10,1,6,1,6,1,10,1,10,1,2,0, + 2,0,2,250,2,255,114,170,0,0,0,99,2,0,0,0, + 0,0,0,0,6,0,0,0,10,0,0,0,67,0,0,0, + 115,116,0,0,0,122,82,124,1,100,1,100,0,133,2,25, + 0,100,2,107,6,115,22,116,0,130,1,124,1,100,0,100, + 1,133,2,25,0,125,1,124,0,106,1,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,2,124,4,124,3,131, + 2,124,5,102,2,87,0,83,0,4,0,116,3,116,4,116, + 5,102,3,107,10,114,110,1,0,1,0,1,0,89,0,100, + 6,83,0,88,0,100,0,83,0,41,7,78,114,14,0,0, + 0,169,2,218,1,99,218,1,111,114,164,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,6,218,14,65,115,115,101,114,116,105,111, + 110,69,114,114,111,114,114,28,0,0,0,114,170,0,0,0, + 114,26,0,0,0,218,10,73,110,100,101,120,69,114,114,111, + 114,114,155,0,0,0,41,6,114,32,0,0,0,114,13,0, + 0,0,114,54,0,0,0,114,132,0,0,0,114,133,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,152,0,0,0,152,2,0,0,115,20,0,0, + 0,0,1,2,2,20,1,12,1,10,3,8,1,8,1,8, + 1,16,1,20,1,114,152,0,0,0,99,2,0,0,0,0, + 0,0,0,3,0,0,0,8,0,0,0,67,0,0,0,115, + 86,0,0,0,124,1,100,1,100,0,133,2,25,0,100,2, + 107,6,115,20,116,0,130,1,124,1,100,0,100,1,133,2, + 25,0,125,1,122,14,124,0,106,1,124,1,25,0,125,2, + 87,0,110,22,4,0,116,2,107,10,114,68,1,0,1,0, + 1,0,89,0,100,0,83,0,88,0,116,3,124,0,106,4, + 124,2,131,2,83,0,100,0,83,0,41,3,78,114,14,0, + 0,0,114,171,0,0,0,41,5,114,176,0,0,0,114,28, + 0,0,0,114,26,0,0,0,114,52,0,0,0,114,29,0, + 0,0,41,3,114,32,0,0,0,114,13,0,0,0,114,54, 0,0,0,114,9,0,0,0,114,9,0,0,0,114,10,0, - 0,0,218,8,60,109,111,100,117,108,101,62,13,0,0,0, - 115,90,0,0,0,4,4,8,1,16,1,8,1,8,1,8, - 1,8,1,8,1,8,2,8,3,6,1,14,3,16,4,4, - 2,8,2,4,1,4,1,4,2,14,127,0,127,0,1,12, - 1,12,1,2,1,2,253,2,255,2,9,8,4,8,9,8, - 31,8,126,2,254,2,29,4,5,8,21,8,46,8,10,8, - 46,10,5,8,7,8,6,8,13,8,19,8,15,8,26, + 0,0,114,150,0,0,0,171,2,0,0,115,14,0,0,0, + 0,2,20,1,12,2,2,1,14,1,14,1,8,2,114,150, + 0,0,0,99,2,0,0,0,0,0,0,0,11,0,0,0, + 9,0,0,0,67,0,0,0,115,198,0,0,0,116,0,124, + 0,124,1,131,2,125,2,116,1,68,0,93,160,92,3,125, + 3,125,4,125,5,124,2,124,3,23,0,125,6,116,2,106, + 3,100,1,124,0,106,4,116,5,124,6,100,2,100,3,141, + 5,1,0,122,14,124,0,106,6,124,6,25,0,125,7,87, + 0,110,20,4,0,116,7,107,10,114,88,1,0,1,0,1, + 0,89,0,113,14,88,0,124,7,100,4,25,0,125,8,116, + 8,124,0,106,4,124,7,131,2,125,9,124,4,114,132,116, + 9,124,0,124,8,124,6,124,1,124,9,131,5,125,10,110, + 10,116,10,124,8,124,9,131,2,125,10,124,10,100,0,107, + 8,114,152,113,14,124,7,100,4,25,0,125,8,124,10,124, + 5,124,8,102,3,2,0,1,0,83,0,113,14,116,11,100, + 5,124,1,155,2,157,2,124,1,100,6,141,2,130,1,100, + 0,83,0,41,7,78,122,13,116,114,121,105,110,103,32,123, + 125,123,125,123,125,114,86,0,0,0,41,1,90,9,118,101, + 114,98,111,115,105,116,121,114,0,0,0,0,114,57,0,0, + 0,114,58,0,0,0,41,12,114,36,0,0,0,114,89,0, + 0,0,114,76,0,0,0,114,77,0,0,0,114,29,0,0, + 0,114,20,0,0,0,114,28,0,0,0,114,26,0,0,0, + 114,52,0,0,0,114,156,0,0,0,114,162,0,0,0,114, + 3,0,0,0,41,11,114,32,0,0,0,114,38,0,0,0, + 114,13,0,0,0,114,90,0,0,0,114,91,0,0,0,114, + 47,0,0,0,114,63,0,0,0,114,54,0,0,0,114,40, + 0,0,0,114,127,0,0,0,114,46,0,0,0,114,9,0, + 0,0,114,9,0,0,0,114,10,0,0,0,114,44,0,0, + 0,186,2,0,0,115,36,0,0,0,0,1,10,1,14,1, + 8,1,22,1,2,1,14,1,14,1,6,2,8,1,12,1, + 4,1,18,2,10,1,8,3,2,1,8,1,16,2,114,44, + 0,0,0,99,0,0,0,0,0,0,0,0,0,0,0,0, + 2,0,0,0,64,0,0,0,115,60,0,0,0,101,0,90, + 1,100,0,90,2,100,1,90,3,100,2,90,4,100,3,100, + 4,132,0,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,83,0,41,14,114,80,0,0,0, + 122,165,80,114,105,118,97,116,101,32,99,108,97,115,115,32, + 117,115,101,100,32,116,111,32,115,117,112,112,111,114,116,32, + 90,105,112,73,109,112,111,114,116,46,103,101,116,95,114,101, + 115,111,117,114,99,101,95,114,101,97,100,101,114,40,41,46, + 10,10,32,32,32,32,84,104,105,115,32,99,108,97,115,115, + 32,105,115,32,97,108,108,111,119,101,100,32,116,111,32,114, + 101,102,101,114,101,110,99,101,32,97,108,108,32,116,104,101, + 32,105,110,110,97,114,100,115,32,97,110,100,32,112,114,105, + 118,97,116,101,32,112,97,114,116,115,32,111,102,10,32,32, + 32,32,116,104,101,32,122,105,112,105,109,112,111,114,116,101, + 114,46,10,32,32,32,32,70,99,3,0,0,0,0,0,0, + 0,3,0,0,0,2,0,0,0,67,0,0,0,115,16,0, + 0,0,124,1,124,0,95,0,124,2,124,0,95,1,100,0, + 83,0,114,88,0,0,0,41,2,114,4,0,0,0,114,38, + 0,0,0,41,3,114,32,0,0,0,114,4,0,0,0,114, + 38,0,0,0,114,9,0,0,0,114,9,0,0,0,114,10, + 0,0,0,114,34,0,0,0,220,2,0,0,115,4,0,0, + 0,0,1,6,1,122,33,95,90,105,112,73,109,112,111,114, + 116,82,101,115,111,117,114,99,101,82,101,97,100,101,114,46, + 95,95,105,110,105,116,95,95,99,2,0,0,0,0,0,0, + 0,5,0,0,0,8,0,0,0,67,0,0,0,115,92,0, + 0,0,124,0,106,0,160,1,100,1,100,2,161,2,125,2, + 124,2,155,0,100,2,124,1,155,0,157,3,125,3,100,3, + 100,4,108,2,109,3,125,4,1,0,122,18,124,4,124,0, + 106,4,160,5,124,3,161,1,131,1,87,0,83,0,4,0, + 116,6,107,10,114,86,1,0,1,0,1,0,116,7,124,3, + 131,1,130,1,89,0,110,2,88,0,100,0,83,0,41,5, + 78,114,85,0,0,0,114,110,0,0,0,114,0,0,0,0, + 41,1,218,7,66,121,116,101,115,73,79,41,8,114,38,0, + 0,0,114,19,0,0,0,90,2,105,111,114,178,0,0,0, + 114,4,0,0,0,114,55,0,0,0,114,22,0,0,0,218, + 17,70,105,108,101,78,111,116,70,111,117,110,100,69,114,114, + 111,114,41,5,114,32,0,0,0,218,8,114,101,115,111,117, + 114,99,101,218,16,102,117,108,108,110,97,109,101,95,97,115, + 95,112,97,116,104,114,13,0,0,0,114,178,0,0,0,114, + 9,0,0,0,114,9,0,0,0,114,10,0,0,0,218,13, + 111,112,101,110,95,114,101,115,111,117,114,99,101,224,2,0, + 0,115,14,0,0,0,0,1,14,1,14,1,12,1,2,1, + 18,1,14,1,122,38,95,90,105,112,73,109,112,111,114,116, + 82,101,115,111,117,114,99,101,82,101,97,100,101,114,46,111, + 112,101,110,95,114,101,115,111,117,114,99,101,99,2,0,0, + 0,0,0,0,0,2,0,0,0,1,0,0,0,67,0,0, + 0,115,8,0,0,0,116,0,130,1,100,0,83,0,114,88, + 0,0,0,41,1,114,179,0,0,0,41,2,114,32,0,0, + 0,114,180,0,0,0,114,9,0,0,0,114,9,0,0,0, + 114,10,0,0,0,218,13,114,101,115,111,117,114,99,101,95, + 112,97,116,104,233,2,0,0,115,2,0,0,0,0,4,122, + 38,95,90,105,112,73,109,112,111,114,116,82,101,115,111,117, + 114,99,101,82,101,97,100,101,114,46,114,101,115,111,117,114, + 99,101,95,112,97,116,104,99,2,0,0,0,0,0,0,0, + 4,0,0,0,8,0,0,0,67,0,0,0,115,72,0,0, + 0,124,0,106,0,160,1,100,1,100,2,161,2,125,2,124, + 2,155,0,100,2,124,1,155,0,157,3,125,3,122,16,124, + 0,106,2,160,3,124,3,161,1,1,0,87,0,110,22,4, + 0,116,4,107,10,114,66,1,0,1,0,1,0,89,0,100, + 3,83,0,88,0,100,4,83,0,41,5,78,114,85,0,0, + 0,114,110,0,0,0,70,84,41,5,114,38,0,0,0,114, + 19,0,0,0,114,4,0,0,0,114,55,0,0,0,114,22, + 0,0,0,41,4,114,32,0,0,0,114,59,0,0,0,114, + 181,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,105,115,95,114,101,115, + 111,117,114,99,101,239,2,0,0,115,14,0,0,0,0,3, + 14,1,14,1,2,1,16,1,14,1,8,1,122,36,95,90, + 105,112,73,109,112,111,114,116,82,101,115,111,117,114,99,101, + 82,101,97,100,101,114,46,105,115,95,114,101,115,111,117,114, + 99,101,99,1,0,0,0,0,0,0,0,9,0,0,0,9, + 0,0,0,99,0,0,0,115,186,0,0,0,100,1,100,2, + 108,0,109,1,125,1,1,0,124,1,124,0,106,2,160,3, + 124,0,106,4,161,1,131,1,125,2,124,2,160,5,124,0, + 106,2,106,6,161,1,125,3,124,3,106,7,100,3,107,2, + 115,58,116,8,130,1,124,3,106,9,125,4,116,10,131,0, + 125,5,124,0,106,2,106,11,68,0,93,102,125,6,122,18, + 124,1,124,6,131,1,160,5,124,4,161,1,125,7,87,0, + 110,24,4,0,116,12,107,10,114,124,1,0,1,0,1,0, + 89,0,113,78,89,0,110,2,88,0,124,7,106,9,106,7, + 125,8,116,13,124,8,131,1,100,1,107,2,114,156,124,7, + 106,7,86,0,1,0,113,78,124,8,124,5,107,7,114,78, + 124,5,160,14,124,8,161,1,1,0,124,8,86,0,1,0, + 113,78,100,0,83,0,41,4,78,114,0,0,0,0,41,1, + 218,4,80,97,116,104,114,60,0,0,0,41,15,90,7,112, + 97,116,104,108,105,98,114,185,0,0,0,114,4,0,0,0, + 114,56,0,0,0,114,38,0,0,0,90,11,114,101,108,97, + 116,105,118,101,95,116,111,114,29,0,0,0,114,59,0,0, + 0,114,176,0,0,0,90,6,112,97,114,101,110,116,218,3, + 115,101,116,114,28,0,0,0,114,23,0,0,0,114,51,0, + 0,0,218,3,97,100,100,41,9,114,32,0,0,0,114,185, + 0,0,0,90,13,102,117,108,108,110,97,109,101,95,112,97, + 116,104,90,13,114,101,108,97,116,105,118,101,95,112,97,116, + 104,90,12,112,97,99,107,97,103,101,95,112,97,116,104,90, + 12,115,117,98,100,105,114,115,95,115,101,101,110,218,8,102, + 105,108,101,110,97,109,101,90,8,114,101,108,97,116,105,118, + 101,90,11,112,97,114,101,110,116,95,110,97,109,101,114,9, + 0,0,0,114,9,0,0,0,114,10,0,0,0,218,8,99, + 111,110,116,101,110,116,115,250,2,0,0,115,34,0,0,0, + 0,8,12,1,18,1,14,3,14,1,6,1,6,1,12,1, + 2,1,18,1,14,1,10,5,8,1,12,1,10,1,8,1, + 10,1,122,33,95,90,105,112,73,109,112,111,114,116,82,101, + 115,111,117,114,99,101,82,101,97,100,101,114,46,99,111,110, + 116,101,110,116,115,78,41,10,114,6,0,0,0,114,7,0, + 0,0,114,8,0,0,0,114,84,0,0,0,114,81,0,0, + 0,114,34,0,0,0,114,182,0,0,0,114,183,0,0,0, + 114,184,0,0,0,114,189,0,0,0,114,9,0,0,0,114, + 9,0,0,0,114,9,0,0,0,114,10,0,0,0,114,80, + 0,0,0,212,2,0,0,115,14,0,0,0,8,5,4,1, + 4,2,8,4,8,9,8,6,8,11,114,80,0,0,0,41, + 45,114,84,0,0,0,90,26,95,102,114,111,122,101,110,95, + 105,109,112,111,114,116,108,105,98,95,101,120,116,101,114,110, + 97,108,114,21,0,0,0,114,1,0,0,0,114,2,0,0, + 0,90,17,95,102,114,111,122,101,110,95,105,109,112,111,114, + 116,108,105,98,114,76,0,0,0,114,149,0,0,0,114,111, + 0,0,0,114,153,0,0,0,114,67,0,0,0,114,132,0, + 0,0,90,7,95,95,97,108,108,95,95,114,20,0,0,0, + 90,15,112,97,116,104,95,115,101,112,97,114,97,116,111,114, + 115,114,18,0,0,0,114,75,0,0,0,114,3,0,0,0, + 114,25,0,0,0,218,4,116,121,112,101,114,70,0,0,0, + 114,114,0,0,0,114,116,0,0,0,114,118,0,0,0,114, + 4,0,0,0,114,89,0,0,0,114,36,0,0,0,114,37, + 0,0,0,114,35,0,0,0,114,27,0,0,0,114,123,0, + 0,0,114,143,0,0,0,114,145,0,0,0,114,52,0,0, + 0,114,148,0,0,0,114,156,0,0,0,218,8,95,95,99, + 111,100,101,95,95,114,154,0,0,0,114,160,0,0,0,114, + 162,0,0,0,114,170,0,0,0,114,152,0,0,0,114,150, + 0,0,0,114,44,0,0,0,114,80,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,13,0,0,0,115, + 90,0,0,0,4,4,8,1,16,1,8,1,8,1,8,1, + 8,1,8,1,8,2,8,3,6,1,14,3,16,4,4,2, + 8,2,4,1,4,1,4,2,14,127,0,127,0,1,12,1, + 12,1,2,1,2,253,2,255,2,9,8,4,8,9,8,31, + 8,126,2,254,2,29,4,5,8,21,8,46,8,10,8,46, + 10,5,8,7,8,6,8,13,8,19,8,15,8,26, }; From webhook-mailer at python.org Mon Nov 26 07:37:17 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 26 Nov 2018 12:37:17 -0000 Subject: [Python-checkins] Add assertion to _PyTuple_CAST(op) (GH-10712) Message-ID: https://github.com/python/cpython/commit/df108dc6610e41c54ed064a854e3903c143f0d77 commit: df108dc6610e41c54ed064a854e3903c143f0d77 branch: master author: Victor Stinner committer: GitHub date: 2018-11-26T13:37:13+01:00 summary: Add assertion to _PyTuple_CAST(op) (GH-10712) Add "assert(PyTuple_Check(op));" to _PyTuple_CAST() to check that the argument is a tuple object in debug mode. PyTuple_GET_SIZE() now uses _PyTuple_CAST() to get its assertion. files: M Include/tupleobject.h diff --git a/Include/tupleobject.h b/Include/tupleobject.h index eec2d98f2d95..75574bc43fb3 100644 --- a/Include/tupleobject.h +++ b/Include/tupleobject.h @@ -56,10 +56,10 @@ PyAPI_FUNC(void) _PyTuple_MaybeUntrack(PyObject *); /* Macro, trading safety for speed */ #ifndef Py_LIMITED_API /* Cast argument to PyTupleObject* type. */ -#define _PyTuple_CAST(op) ((PyTupleObject *)(op)) +#define _PyTuple_CAST(op) (assert(PyTuple_Check(op)), (PyTupleObject *)(op)) #define PyTuple_GET_ITEM(op, i) (_PyTuple_CAST(op)->ob_item[i]) -#define PyTuple_GET_SIZE(op) (assert(PyTuple_Check(op)), Py_SIZE(op)) +#define PyTuple_GET_SIZE(op) Py_SIZE(_PyTuple_CAST(op)) /* Macro, *only* to be used to fill in brand new tuples */ #define PyTuple_SET_ITEM(op, i, v) (_PyTuple_CAST(op)->ob_item[i] = v) From webhook-mailer at python.org Mon Nov 26 07:40:04 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 26 Nov 2018 12:40:04 -0000 Subject: [Python-checkins] bpo-33954: Fix _PyUnicode_InsertThousandsGrouping() (GH-10623) Message-ID: https://github.com/python/cpython/commit/59423e3ddd736387cef8f7632c71954c1859bed0 commit: 59423e3ddd736387cef8f7632c71954c1859bed0 branch: master author: Victor Stinner committer: GitHub date: 2018-11-26T13:40:01+01:00 summary: bpo-33954: Fix _PyUnicode_InsertThousandsGrouping() (GH-10623) Fix str.format(), float.__format__() and complex.__format__() methods for non-ASCII decimal point when using the "n" formatter. Changes: * Rewrite _PyUnicode_InsertThousandsGrouping(): it now requires a _PyUnicodeWriter object for the buffer and a Python str object for digits. * Rename FILL() macro to unicode_fill(), convert it to static inline function, add "assert(0 <= start);" and rework its code. files: A Misc/NEWS.d/next/Core and Builtins/2018-11-20-22-33-38.bpo-33954.RzSngM.rst M Include/unicodeobject.h M Objects/stringlib/localeutil.h M Objects/unicodeobject.c M Python/formatter_unicode.c diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h index ffabf0e83197..e7192852f045 100644 --- a/Include/unicodeobject.h +++ b/Include/unicodeobject.h @@ -2135,10 +2135,10 @@ PyAPI_FUNC(PyObject *) _PyUnicode_XStrip( see Objects/stringlib/localeutil.h */ #ifndef Py_LIMITED_API PyAPI_FUNC(Py_ssize_t) _PyUnicode_InsertThousandsGrouping( - PyObject *unicode, - Py_ssize_t index, + _PyUnicodeWriter *writer, Py_ssize_t n_buffer, - void *digits, + PyObject *digits, + Py_ssize_t d_pos, Py_ssize_t n_digits, Py_ssize_t min_width, const char *grouping, diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-11-20-22-33-38.bpo-33954.RzSngM.rst b/Misc/NEWS.d/next/Core and Builtins/2018-11-20-22-33-38.bpo-33954.RzSngM.rst new file mode 100644 index 000000000000..9bfbe1644e16 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-11-20-22-33-38.bpo-33954.RzSngM.rst @@ -0,0 +1,3 @@ +For :meth:`str.format`, :meth:`float.__format__` and +:meth:`complex.__format__` methods for non-ASCII decimal point when using +the "n" formatter. diff --git a/Objects/stringlib/localeutil.h b/Objects/stringlib/localeutil.h index df501ed05c7e..bd16e0a17280 100644 --- a/Objects/stringlib/localeutil.h +++ b/Objects/stringlib/localeutil.h @@ -1,28 +1,24 @@ -/* stringlib: locale related helpers implementation */ - -#include - -#if !STRINGLIB_IS_UNICODE -# error "localeutil.h is specific to Unicode" -#endif +/* _PyUnicode_InsertThousandsGrouping() helper functions */ typedef struct { const char *grouping; char previous; Py_ssize_t i; /* Where we're currently pointing in grouping. */ -} STRINGLIB(GroupGenerator); +} GroupGenerator; + static void -STRINGLIB(GroupGenerator_init)(STRINGLIB(GroupGenerator) *self, const char *grouping) +GroupGenerator_init(GroupGenerator *self, const char *grouping) { self->grouping = grouping; self->i = 0; self->previous = 0; } + /* Returns the next grouping, or 0 to signify end. */ static Py_ssize_t -STRINGLIB(GroupGenerator_next)(STRINGLIB(GroupGenerator) *self) +GroupGenerator_next(GroupGenerator *self) { /* Note that we don't really do much error checking here. If a grouping string contains just CHAR_MAX, for example, then just @@ -43,138 +39,44 @@ STRINGLIB(GroupGenerator_next)(STRINGLIB(GroupGenerator) *self) } } + /* Fill in some digits, leading zeros, and thousands separator. All are optional, depending on when we're called. */ static void -STRINGLIB(fill)(STRINGLIB_CHAR **digits_end, STRINGLIB_CHAR **buffer_end, - Py_ssize_t n_chars, Py_ssize_t n_zeros, STRINGLIB_CHAR* thousands_sep, - Py_ssize_t thousands_sep_len) +InsertThousandsGrouping_fill(_PyUnicodeWriter *writer, Py_ssize_t *buffer_pos, + PyObject *digits, Py_ssize_t *digits_pos, + Py_ssize_t n_chars, Py_ssize_t n_zeros, + PyObject *thousands_sep, Py_ssize_t thousands_sep_len, + Py_UCS4 *maxchar) { - Py_ssize_t i; + if (!writer) { + /* if maxchar > 127, maxchar is already set */ + if (*maxchar == 127 && thousands_sep) { + Py_UCS4 maxchar2 = PyUnicode_MAX_CHAR_VALUE(thousands_sep); + *maxchar = Py_MAX(*maxchar, maxchar2); + } + return; + } if (thousands_sep) { - *buffer_end -= thousands_sep_len; + *buffer_pos -= thousands_sep_len; /* Copy the thousands_sep chars into the buffer. */ - memcpy(*buffer_end, thousands_sep, - thousands_sep_len * STRINGLIB_SIZEOF_CHAR); - } - - *buffer_end -= n_chars; - *digits_end -= n_chars; - memcpy(*buffer_end, *digits_end, n_chars * sizeof(STRINGLIB_CHAR)); - - *buffer_end -= n_zeros; - for (i = 0; i < n_zeros; i++) - (*buffer_end)[i] = '0'; -} - -/** - * InsertThousandsGrouping: - * @buffer: A pointer to the start of a string. - * @n_buffer: Number of characters in @buffer. - * @digits: A pointer to the digits we're reading from. If count - * is non-NULL, this is unused. - * @n_digits: The number of digits in the string, in which we want - * to put the grouping chars. - * @min_width: The minimum width of the digits in the output string. - * Output will be zero-padded on the left to fill. - * @grouping: see definition in localeconv(). - * @thousands_sep: see definition in localeconv(). - * - * There are 2 modes: counting and filling. If @buffer is NULL, - * we are in counting mode, else filling mode. - * If counting, the required buffer size is returned. - * If filling, we know the buffer will be large enough, so we don't - * need to pass in the buffer size. - * Inserts thousand grouping characters (as defined by grouping and - * thousands_sep) into the string between buffer and buffer+n_digits. - * - * Return value: 0 on error, else 1. Note that no error can occur if - * count is non-NULL. - * - * This name won't be used, the includer of this file should define - * it to be the actual function name, based on unicode or string. - * - * As closely as possible, this code mimics the logic in decimal.py's - _insert_thousands_sep(). - **/ -static Py_ssize_t -STRINGLIB(InsertThousandsGrouping)( - STRINGLIB_CHAR *buffer, - Py_ssize_t n_buffer, - STRINGLIB_CHAR *digits, - Py_ssize_t n_digits, - Py_ssize_t min_width, - const char *grouping, - STRINGLIB_CHAR *thousands_sep, - Py_ssize_t thousands_sep_len) -{ - Py_ssize_t count = 0; - Py_ssize_t n_zeros; - int loop_broken = 0; - int use_separator = 0; /* First time through, don't append the - separator. They only go between - groups. */ - STRINGLIB_CHAR *buffer_end = NULL; - STRINGLIB_CHAR *digits_end = NULL; - Py_ssize_t l; - Py_ssize_t n_chars; - Py_ssize_t remaining = n_digits; /* Number of chars remaining to - be looked at */ - /* A generator that returns all of the grouping widths, until it - returns 0. */ - STRINGLIB(GroupGenerator) groupgen; - STRINGLIB(GroupGenerator_init)(&groupgen, grouping); - - if (buffer) { - buffer_end = buffer + n_buffer; - digits_end = digits + n_digits; - } - - while ((l = STRINGLIB(GroupGenerator_next)(&groupgen)) > 0) { - l = Py_MIN(l, Py_MAX(Py_MAX(remaining, min_width), 1)); - n_zeros = Py_MAX(0, l - remaining); - n_chars = Py_MAX(0, Py_MIN(remaining, l)); - - /* Use n_zero zero's and n_chars chars */ - - /* Count only, don't do anything. */ - count += (use_separator ? thousands_sep_len : 0) + n_zeros + n_chars; - - if (buffer) { - /* Copy into the output buffer. */ - STRINGLIB(fill)(&digits_end, &buffer_end, n_chars, n_zeros, - use_separator ? thousands_sep : NULL, thousands_sep_len); - } - - /* Use a separator next time. */ - use_separator = 1; - - remaining -= n_chars; - min_width -= l; - - if (remaining <= 0 && min_width <= 0) { - loop_broken = 1; - break; - } - min_width -= thousands_sep_len; + _PyUnicode_FastCopyCharacters(writer->buffer, *buffer_pos, + thousands_sep, 0, + thousands_sep_len); } - if (!loop_broken) { - /* We left the loop without using a break statement. */ - l = Py_MAX(Py_MAX(remaining, min_width), 1); - n_zeros = Py_MAX(0, l - remaining); - n_chars = Py_MAX(0, Py_MIN(remaining, l)); - - /* Use n_zero zero's and n_chars chars */ - count += (use_separator ? thousands_sep_len : 0) + n_zeros + n_chars; - if (buffer) { - /* Copy into the output buffer. */ - STRINGLIB(fill)(&digits_end, &buffer_end, n_chars, n_zeros, - use_separator ? thousands_sep : NULL, thousands_sep_len); - } + *buffer_pos -= n_chars; + *digits_pos -= n_chars; + _PyUnicode_FastCopyCharacters(writer->buffer, *buffer_pos, + digits, *digits_pos, + n_chars); + + if (n_zeros) { + *buffer_pos -= n_zeros; + enum PyUnicode_Kind kind = PyUnicode_KIND(writer->buffer); + void *data = PyUnicode_DATA(writer->buffer); + unicode_fill(kind, data, '0', *buffer_pos, n_zeros); } - return count; } - diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 01049f54e898..3da40ddc5898 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -220,6 +220,38 @@ static PyObject *unicode_empty = NULL; return unicode_empty; \ } while (0) +static inline void +unicode_fill(enum PyUnicode_Kind kind, void *data, Py_UCS4 value, + Py_ssize_t start, Py_ssize_t length) +{ + assert(0 <= start); + assert(kind != PyUnicode_WCHAR_KIND); + switch (kind) { + case PyUnicode_1BYTE_KIND: { + Py_UCS1 ch = (unsigned char)value; + Py_UCS1 *to = (Py_UCS1 *)data + start; + memset(to, ch, length); + break; + } + case PyUnicode_2BYTE_KIND: { + Py_UCS2 ch = (Py_UCS2)value; + Py_UCS2 *to = (Py_UCS2 *)data + start; + const Py_UCS2 *end = to + length; + for (; to < end; ++to) *to = ch; + break; + } + case PyUnicode_4BYTE_KIND: { + Py_UCS4 ch = value; + Py_UCS4 * to = (Py_UCS4 *)data + start; + const Py_UCS4 *end = to + length; + for (; to < end; ++to) *to = ch; + break; + } + default: Py_UNREACHABLE(); + } +} + + /* Forward declaration */ static inline int _PyUnicodeWriter_WriteCharInline(_PyUnicodeWriter *writer, Py_UCS4 ch); @@ -790,7 +822,6 @@ ensure_unicode(PyObject *obj) #include "stringlib/count.h" #include "stringlib/find.h" #include "stringlib/find_max_char.h" -#include "stringlib/localeutil.h" #include "stringlib/undef.h" #include "stringlib/ucs1lib.h" @@ -801,7 +832,6 @@ ensure_unicode(PyObject *obj) #include "stringlib/find.h" #include "stringlib/replace.h" #include "stringlib/find_max_char.h" -#include "stringlib/localeutil.h" #include "stringlib/undef.h" #include "stringlib/ucs2lib.h" @@ -812,7 +842,6 @@ ensure_unicode(PyObject *obj) #include "stringlib/find.h" #include "stringlib/replace.h" #include "stringlib/find_max_char.h" -#include "stringlib/localeutil.h" #include "stringlib/undef.h" #include "stringlib/ucs4lib.h" @@ -823,7 +852,6 @@ ensure_unicode(PyObject *obj) #include "stringlib/find.h" #include "stringlib/replace.h" #include "stringlib/find_max_char.h" -#include "stringlib/localeutil.h" #include "stringlib/undef.h" #include "stringlib/unicodedefs.h" @@ -9323,86 +9351,149 @@ any_find_slice(PyObject* s1, PyObject* s2, return result; } +/* _PyUnicode_InsertThousandsGrouping() helper functions */ +#include "stringlib/localeutil.h" + +/** + * InsertThousandsGrouping: + * @writer: Unicode writer. + * @n_buffer: Number of characters in @buffer. + * @digits: Digits we're reading from. If count is non-NULL, this is unused. + * @d_pos: Start of digits string. + * @n_digits: The number of digits in the string, in which we want + * to put the grouping chars. + * @min_width: The minimum width of the digits in the output string. + * Output will be zero-padded on the left to fill. + * @grouping: see definition in localeconv(). + * @thousands_sep: see definition in localeconv(). + * + * There are 2 modes: counting and filling. If @writer is NULL, + * we are in counting mode, else filling mode. + * If counting, the required buffer size is returned. + * If filling, we know the buffer will be large enough, so we don't + * need to pass in the buffer size. + * Inserts thousand grouping characters (as defined by grouping and + * thousands_sep) into @writer. + * + * Return value: -1 on error, number of characters otherwise. + **/ Py_ssize_t _PyUnicode_InsertThousandsGrouping( - PyObject *unicode, Py_ssize_t index, + _PyUnicodeWriter *writer, Py_ssize_t n_buffer, - void *digits, Py_ssize_t n_digits, + PyObject *digits, + Py_ssize_t d_pos, + Py_ssize_t n_digits, Py_ssize_t min_width, - const char *grouping, PyObject *thousands_sep, + const char *grouping, + PyObject *thousands_sep, Py_UCS4 *maxchar) { - unsigned int kind, thousands_sep_kind; - char *data, *thousands_sep_data; - Py_ssize_t thousands_sep_len; - Py_ssize_t len; - - if (unicode != NULL) { - kind = PyUnicode_KIND(unicode); - data = (char *) PyUnicode_DATA(unicode) + index * kind; + if (writer) { + assert(digits != NULL); + assert(maxchar == NULL); } else { - kind = PyUnicode_1BYTE_KIND; - data = NULL; - } - thousands_sep_kind = PyUnicode_KIND(thousands_sep); - thousands_sep_data = PyUnicode_DATA(thousands_sep); - thousands_sep_len = PyUnicode_GET_LENGTH(thousands_sep); - if (unicode != NULL && thousands_sep_kind != kind) { - if (thousands_sep_kind < kind) { - thousands_sep_data = _PyUnicode_AsKind(thousands_sep, kind); - if (!thousands_sep_data) - return -1; - } - else { - data = _PyUnicode_AsKind(unicode, thousands_sep_kind); - if (!data) - return -1; + assert(digits == NULL); + assert(maxchar != NULL); + } + assert(0 <= d_pos); + assert(0 <= n_digits); + assert(0 <= min_width); + assert(grouping != NULL); + + if (digits != NULL) { + if (PyUnicode_READY(digits) == -1) { + return -1; } } + if (PyUnicode_READY(thousands_sep) == -1) { + return -1; + } - switch (kind) { - case PyUnicode_1BYTE_KIND: - if (unicode != NULL && PyUnicode_IS_ASCII(unicode)) - len = asciilib_InsertThousandsGrouping( - (Py_UCS1 *) data, n_buffer, (Py_UCS1 *) digits, n_digits, - min_width, grouping, - (Py_UCS1 *) thousands_sep_data, thousands_sep_len); - else - len = ucs1lib_InsertThousandsGrouping( - (Py_UCS1*)data, n_buffer, (Py_UCS1*)digits, n_digits, - min_width, grouping, - (Py_UCS1 *) thousands_sep_data, thousands_sep_len); - break; - case PyUnicode_2BYTE_KIND: - len = ucs2lib_InsertThousandsGrouping( - (Py_UCS2 *) data, n_buffer, (Py_UCS2 *) digits, n_digits, - min_width, grouping, - (Py_UCS2 *) thousands_sep_data, thousands_sep_len); - break; - case PyUnicode_4BYTE_KIND: - len = ucs4lib_InsertThousandsGrouping( - (Py_UCS4 *) data, n_buffer, (Py_UCS4 *) digits, n_digits, - min_width, grouping, - (Py_UCS4 *) thousands_sep_data, thousands_sep_len); - break; - default: - Py_UNREACHABLE(); + Py_ssize_t count = 0; + Py_ssize_t n_zeros; + int loop_broken = 0; + int use_separator = 0; /* First time through, don't append the + separator. They only go between + groups. */ + Py_ssize_t buffer_pos; + Py_ssize_t digits_pos; + Py_ssize_t len; + Py_ssize_t n_chars; + Py_ssize_t remaining = n_digits; /* Number of chars remaining to + be looked at */ + /* A generator that returns all of the grouping widths, until it + returns 0. */ + GroupGenerator groupgen; + GroupGenerator_init(&groupgen, grouping); + const Py_ssize_t thousands_sep_len = PyUnicode_GET_LENGTH(thousands_sep); + + /* if digits are not grouped, thousands separator + should be an empty string */ + assert(!(grouping[0] == CHAR_MAX && thousands_sep_len != 0)); + + digits_pos = d_pos + n_digits; + if (writer) { + buffer_pos = writer->pos + n_buffer; + assert(buffer_pos <= PyUnicode_GET_LENGTH(writer->buffer)); + assert(digits_pos <= PyUnicode_GET_LENGTH(digits)); } - if (unicode != NULL && thousands_sep_kind != kind) { - if (thousands_sep_kind < kind) - PyMem_Free(thousands_sep_data); - else - PyMem_Free(data); + else { + buffer_pos = n_buffer; } - if (unicode == NULL) { + + if (!writer) { *maxchar = 127; - if (len != n_digits) { - *maxchar = Py_MAX(*maxchar, - PyUnicode_MAX_CHAR_VALUE(thousands_sep)); + } + + while ((len = GroupGenerator_next(&groupgen)) > 0) { + len = Py_MIN(len, Py_MAX(Py_MAX(remaining, min_width), 1)); + n_zeros = Py_MAX(0, len - remaining); + n_chars = Py_MAX(0, Py_MIN(remaining, len)); + + /* Use n_zero zero's and n_chars chars */ + + /* Count only, don't do anything. */ + count += (use_separator ? thousands_sep_len : 0) + n_zeros + n_chars; + + /* Copy into the writer. */ + InsertThousandsGrouping_fill(writer, &buffer_pos, + digits, &digits_pos, + n_chars, n_zeros, + use_separator ? thousands_sep : NULL, + thousands_sep_len, maxchar); + + /* Use a separator next time. */ + use_separator = 1; + + remaining -= n_chars; + min_width -= len; + + if (remaining <= 0 && min_width <= 0) { + loop_broken = 1; + break; } + min_width -= thousands_sep_len; + } + if (!loop_broken) { + /* We left the loop without using a break statement. */ + + len = Py_MAX(Py_MAX(remaining, min_width), 1); + n_zeros = Py_MAX(0, len - remaining); + n_chars = Py_MAX(0, Py_MIN(remaining, len)); + + /* Use n_zero zero's and n_chars chars */ + count += (use_separator ? thousands_sep_len : 0) + n_zeros + n_chars; + + /* Copy into the writer. */ + InsertThousandsGrouping_fill(writer, &buffer_pos, + digits, &digits_pos, + n_chars, n_zeros, + use_separator ? thousands_sep : NULL, + thousands_sep_len, maxchar); } - return len; + return count; } @@ -10021,30 +10112,6 @@ _PyUnicode_JoinArray(PyObject *separator, PyObject *const *items, Py_ssize_t seq return NULL; } -#define FILL(kind, data, value, start, length) \ - do { \ - Py_ssize_t i_ = 0; \ - assert(kind != PyUnicode_WCHAR_KIND); \ - switch ((kind)) { \ - case PyUnicode_1BYTE_KIND: { \ - unsigned char * to_ = (unsigned char *)((data)) + (start); \ - memset(to_, (unsigned char)value, (length)); \ - break; \ - } \ - case PyUnicode_2BYTE_KIND: { \ - Py_UCS2 * to_ = (Py_UCS2 *)((data)) + (start); \ - for (; i_ < (length); ++i_, ++to_) *to_ = (value); \ - break; \ - } \ - case PyUnicode_4BYTE_KIND: { \ - Py_UCS4 * to_ = (Py_UCS4 *)((data)) + (start); \ - for (; i_ < (length); ++i_, ++to_) *to_ = (value); \ - break; \ - } \ - default: Py_UNREACHABLE(); \ - } \ - } while (0) - void _PyUnicode_FastFill(PyObject *unicode, Py_ssize_t start, Py_ssize_t length, Py_UCS4 fill_char) @@ -10056,7 +10123,7 @@ _PyUnicode_FastFill(PyObject *unicode, Py_ssize_t start, Py_ssize_t length, assert(fill_char <= PyUnicode_MAX_CHAR_VALUE(unicode)); assert(start >= 0); assert(start + length <= PyUnicode_GET_LENGTH(unicode)); - FILL(kind, data, fill_char, start, length); + unicode_fill(kind, data, fill_char, start, length); } Py_ssize_t @@ -10127,9 +10194,9 @@ pad(PyObject *self, kind = PyUnicode_KIND(u); data = PyUnicode_DATA(u); if (left) - FILL(kind, data, fill, 0, left); + unicode_fill(kind, data, fill, 0, left); if (right) - FILL(kind, data, fill, left + _PyUnicode_LENGTH(self), right); + unicode_fill(kind, data, fill, left + _PyUnicode_LENGTH(self), right); _PyUnicode_FastCopyCharacters(u, left, self, 0, _PyUnicode_LENGTH(self)); assert(_PyUnicode_CheckConsistency(u, 1)); return u; @@ -11516,7 +11583,7 @@ unicode_expandtabs_impl(PyObject *self, int tabsize) if (tabsize > 0) { incr = tabsize - (line_pos % tabsize); line_pos += incr; - FILL(kind, dest_data, ' ', j, incr); + unicode_fill(kind, dest_data, ' ', j, incr); j += incr; } } @@ -14792,7 +14859,7 @@ unicode_format_arg_output(struct unicode_formatter_t *ctx, /* Pad left with the fill character if needed */ if (arg->width > len && !(arg->flags & F_LJUST)) { sublen = arg->width - len; - FILL(writer->kind, writer->data, fill, writer->pos, sublen); + unicode_fill(writer->kind, writer->data, fill, writer->pos, sublen); writer->pos += sublen; arg->width = len; } @@ -14824,7 +14891,7 @@ unicode_format_arg_output(struct unicode_formatter_t *ctx, /* Pad right with the fill character if needed */ if (arg->width > len) { sublen = arg->width - len; - FILL(writer->kind, writer->data, ' ', writer->pos, sublen); + unicode_fill(writer->kind, writer->data, ' ', writer->pos, sublen); writer->pos += sublen; } return 0; diff --git a/Python/formatter_unicode.c b/Python/formatter_unicode.c index e12ba49bd2c1..3e9e9ba08602 100644 --- a/Python/formatter_unicode.c +++ b/Python/formatter_unicode.c @@ -462,7 +462,8 @@ parse_number(PyObject *s, Py_ssize_t pos, Py_ssize_t end, /* not all fields of format are used. for example, precision is unused. should this take discrete params in order to be more clear about what it does? or is passing a single format parameter easier - and more efficient enough to justify a little obfuscation? */ + and more efficient enough to justify a little obfuscation? + Return -1 on error. */ static Py_ssize_t calc_number_widths(NumberFieldWidths *spec, Py_ssize_t n_prefix, Py_UCS4 sign_char, PyObject *number, Py_ssize_t n_start, @@ -541,9 +542,12 @@ calc_number_widths(NumberFieldWidths *spec, Py_ssize_t n_prefix, Py_UCS4 grouping_maxchar; spec->n_grouped_digits = _PyUnicode_InsertThousandsGrouping( NULL, 0, - 0, NULL, - spec->n_digits, spec->n_min_width, + NULL, 0, spec->n_digits, + spec->n_min_width, locale->grouping, locale->thousands_sep, &grouping_maxchar); + if (spec->n_grouped_digits == -1) { + return -1; + } *maxchar = Py_MAX(*maxchar, grouping_maxchar); } @@ -635,26 +639,14 @@ fill_number(_PyUnicodeWriter *writer, const NumberFieldWidths *spec, /* Only for type 'c' special case, it has no digits. */ if (spec->n_digits != 0) { /* Fill the digits with InsertThousandsGrouping. */ - char *pdigits; - if (PyUnicode_READY(digits)) - return -1; - pdigits = PyUnicode_DATA(digits); - if (PyUnicode_KIND(digits) < kind) { - pdigits = _PyUnicode_AsKind(digits, kind); - if (pdigits == NULL) - return -1; - } r = _PyUnicode_InsertThousandsGrouping( - writer->buffer, writer->pos, - spec->n_grouped_digits, - pdigits + kind * d_pos, - spec->n_digits, spec->n_min_width, + writer, spec->n_grouped_digits, + digits, d_pos, spec->n_digits, + spec->n_min_width, locale->grouping, locale->thousands_sep, NULL); if (r == -1) return -1; assert(r == spec->n_grouped_digits); - if (PyUnicode_KIND(digits) < kind) - PyMem_Free(pdigits); d_pos += spec->n_digits; } if (toupper) { @@ -994,6 +986,9 @@ format_long_internal(PyObject *value, const InternalFormatSpec *format, n_total = calc_number_widths(&spec, n_prefix, sign_char, tmp, inumeric_chars, inumeric_chars + n_digits, n_remainder, 0, &locale, format, &maxchar); + if (n_total == -1) { + goto done; + } /* Allocate the memory. */ if (_PyUnicodeWriter_Prepare(writer, n_total, maxchar) == -1) @@ -1139,6 +1134,9 @@ format_float_internal(PyObject *value, n_total = calc_number_widths(&spec, 0, sign_char, unicode_tmp, index, index + n_digits, n_remainder, has_decimal, &locale, format, &maxchar); + if (n_total == -1) { + goto done; + } /* Allocate the memory. */ if (_PyUnicodeWriter_Prepare(writer, n_total, maxchar) == -1) @@ -1322,6 +1320,9 @@ format_complex_internal(PyObject *value, i_re, i_re + n_re_digits, n_re_remainder, re_has_decimal, &locale, &tmp_format, &maxchar); + if (n_re_total == -1) { + goto done; + } /* Same formatting, but always include a sign, unless the real part is * going to be omitted, in which case we use whatever sign convention was @@ -1332,6 +1333,9 @@ format_complex_internal(PyObject *value, i_im, i_im + n_im_digits, n_im_remainder, im_has_decimal, &locale, &tmp_format, &maxchar); + if (n_im_total == -1) { + goto done; + } if (skip_re) n_re_total = 0; From webhook-mailer at python.org Mon Nov 26 08:17:07 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 26 Nov 2018 13:17:07 -0000 Subject: [Python-checkins] bpo-33954: Fix _PyUnicode_InsertThousandsGrouping() (GH-10623) (GH-10718) Message-ID: https://github.com/python/cpython/commit/6f5fa1b4be735159e964906ab608dc467476e47c commit: 6f5fa1b4be735159e964906ab608dc467476e47c branch: 3.7 author: Victor Stinner committer: GitHub date: 2018-11-26T14:17:01+01:00 summary: bpo-33954: Fix _PyUnicode_InsertThousandsGrouping() (GH-10623) (GH-10718) Fix str.format(), float.__format__() and complex.__format__() methods for non-ASCII decimal point when using the "n" formatter. Rewrite _PyUnicode_InsertThousandsGrouping(): it now requires a _PyUnicodeWriter object for the buffer and a Python str object for digits. (cherry picked from commit 59423e3ddd736387cef8f7632c71954c1859bed0) files: A Misc/NEWS.d/next/Core and Builtins/2018-11-20-22-33-38.bpo-33954.RzSngM.rst M Include/unicodeobject.h M Objects/stringlib/localeutil.h M Objects/unicodeobject.c M Python/formatter_unicode.c diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h index 0274de6733ab..45998a13a621 100644 --- a/Include/unicodeobject.h +++ b/Include/unicodeobject.h @@ -2135,10 +2135,10 @@ PyAPI_FUNC(PyObject *) _PyUnicode_XStrip( see Objects/stringlib/localeutil.h */ #ifndef Py_LIMITED_API PyAPI_FUNC(Py_ssize_t) _PyUnicode_InsertThousandsGrouping( - PyObject *unicode, - Py_ssize_t index, + _PyUnicodeWriter *writer, Py_ssize_t n_buffer, - void *digits, + PyObject *digits, + Py_ssize_t d_pos, Py_ssize_t n_digits, Py_ssize_t min_width, const char *grouping, diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-11-20-22-33-38.bpo-33954.RzSngM.rst b/Misc/NEWS.d/next/Core and Builtins/2018-11-20-22-33-38.bpo-33954.RzSngM.rst new file mode 100644 index 000000000000..9bfbe1644e16 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-11-20-22-33-38.bpo-33954.RzSngM.rst @@ -0,0 +1,3 @@ +For :meth:`str.format`, :meth:`float.__format__` and +:meth:`complex.__format__` methods for non-ASCII decimal point when using +the "n" formatter. diff --git a/Objects/stringlib/localeutil.h b/Objects/stringlib/localeutil.h index df501ed05c7e..31fed349caa5 100644 --- a/Objects/stringlib/localeutil.h +++ b/Objects/stringlib/localeutil.h @@ -1,28 +1,24 @@ -/* stringlib: locale related helpers implementation */ - -#include - -#if !STRINGLIB_IS_UNICODE -# error "localeutil.h is specific to Unicode" -#endif +/* _PyUnicode_InsertThousandsGrouping() helper functions */ typedef struct { const char *grouping; char previous; Py_ssize_t i; /* Where we're currently pointing in grouping. */ -} STRINGLIB(GroupGenerator); +} GroupGenerator; + static void -STRINGLIB(GroupGenerator_init)(STRINGLIB(GroupGenerator) *self, const char *grouping) +GroupGenerator_init(GroupGenerator *self, const char *grouping) { self->grouping = grouping; self->i = 0; self->previous = 0; } + /* Returns the next grouping, or 0 to signify end. */ static Py_ssize_t -STRINGLIB(GroupGenerator_next)(STRINGLIB(GroupGenerator) *self) +GroupGenerator_next(GroupGenerator *self) { /* Note that we don't really do much error checking here. If a grouping string contains just CHAR_MAX, for example, then just @@ -43,138 +39,44 @@ STRINGLIB(GroupGenerator_next)(STRINGLIB(GroupGenerator) *self) } } + /* Fill in some digits, leading zeros, and thousands separator. All are optional, depending on when we're called. */ static void -STRINGLIB(fill)(STRINGLIB_CHAR **digits_end, STRINGLIB_CHAR **buffer_end, - Py_ssize_t n_chars, Py_ssize_t n_zeros, STRINGLIB_CHAR* thousands_sep, - Py_ssize_t thousands_sep_len) +InsertThousandsGrouping_fill(_PyUnicodeWriter *writer, Py_ssize_t *buffer_pos, + PyObject *digits, Py_ssize_t *digits_pos, + Py_ssize_t n_chars, Py_ssize_t n_zeros, + PyObject *thousands_sep, Py_ssize_t thousands_sep_len, + Py_UCS4 *maxchar) { - Py_ssize_t i; + if (!writer) { + /* if maxchar > 127, maxchar is already set */ + if (*maxchar == 127 && thousands_sep) { + Py_UCS4 maxchar2 = PyUnicode_MAX_CHAR_VALUE(thousands_sep); + *maxchar = Py_MAX(*maxchar, maxchar2); + } + return; + } if (thousands_sep) { - *buffer_end -= thousands_sep_len; + *buffer_pos -= thousands_sep_len; /* Copy the thousands_sep chars into the buffer. */ - memcpy(*buffer_end, thousands_sep, - thousands_sep_len * STRINGLIB_SIZEOF_CHAR); - } - - *buffer_end -= n_chars; - *digits_end -= n_chars; - memcpy(*buffer_end, *digits_end, n_chars * sizeof(STRINGLIB_CHAR)); - - *buffer_end -= n_zeros; - for (i = 0; i < n_zeros; i++) - (*buffer_end)[i] = '0'; -} - -/** - * InsertThousandsGrouping: - * @buffer: A pointer to the start of a string. - * @n_buffer: Number of characters in @buffer. - * @digits: A pointer to the digits we're reading from. If count - * is non-NULL, this is unused. - * @n_digits: The number of digits in the string, in which we want - * to put the grouping chars. - * @min_width: The minimum width of the digits in the output string. - * Output will be zero-padded on the left to fill. - * @grouping: see definition in localeconv(). - * @thousands_sep: see definition in localeconv(). - * - * There are 2 modes: counting and filling. If @buffer is NULL, - * we are in counting mode, else filling mode. - * If counting, the required buffer size is returned. - * If filling, we know the buffer will be large enough, so we don't - * need to pass in the buffer size. - * Inserts thousand grouping characters (as defined by grouping and - * thousands_sep) into the string between buffer and buffer+n_digits. - * - * Return value: 0 on error, else 1. Note that no error can occur if - * count is non-NULL. - * - * This name won't be used, the includer of this file should define - * it to be the actual function name, based on unicode or string. - * - * As closely as possible, this code mimics the logic in decimal.py's - _insert_thousands_sep(). - **/ -static Py_ssize_t -STRINGLIB(InsertThousandsGrouping)( - STRINGLIB_CHAR *buffer, - Py_ssize_t n_buffer, - STRINGLIB_CHAR *digits, - Py_ssize_t n_digits, - Py_ssize_t min_width, - const char *grouping, - STRINGLIB_CHAR *thousands_sep, - Py_ssize_t thousands_sep_len) -{ - Py_ssize_t count = 0; - Py_ssize_t n_zeros; - int loop_broken = 0; - int use_separator = 0; /* First time through, don't append the - separator. They only go between - groups. */ - STRINGLIB_CHAR *buffer_end = NULL; - STRINGLIB_CHAR *digits_end = NULL; - Py_ssize_t l; - Py_ssize_t n_chars; - Py_ssize_t remaining = n_digits; /* Number of chars remaining to - be looked at */ - /* A generator that returns all of the grouping widths, until it - returns 0. */ - STRINGLIB(GroupGenerator) groupgen; - STRINGLIB(GroupGenerator_init)(&groupgen, grouping); - - if (buffer) { - buffer_end = buffer + n_buffer; - digits_end = digits + n_digits; - } - - while ((l = STRINGLIB(GroupGenerator_next)(&groupgen)) > 0) { - l = Py_MIN(l, Py_MAX(Py_MAX(remaining, min_width), 1)); - n_zeros = Py_MAX(0, l - remaining); - n_chars = Py_MAX(0, Py_MIN(remaining, l)); - - /* Use n_zero zero's and n_chars chars */ - - /* Count only, don't do anything. */ - count += (use_separator ? thousands_sep_len : 0) + n_zeros + n_chars; - - if (buffer) { - /* Copy into the output buffer. */ - STRINGLIB(fill)(&digits_end, &buffer_end, n_chars, n_zeros, - use_separator ? thousands_sep : NULL, thousands_sep_len); - } - - /* Use a separator next time. */ - use_separator = 1; - - remaining -= n_chars; - min_width -= l; - - if (remaining <= 0 && min_width <= 0) { - loop_broken = 1; - break; - } - min_width -= thousands_sep_len; + _PyUnicode_FastCopyCharacters(writer->buffer, *buffer_pos, + thousands_sep, 0, + thousands_sep_len); } - if (!loop_broken) { - /* We left the loop without using a break statement. */ - l = Py_MAX(Py_MAX(remaining, min_width), 1); - n_zeros = Py_MAX(0, l - remaining); - n_chars = Py_MAX(0, Py_MIN(remaining, l)); - - /* Use n_zero zero's and n_chars chars */ - count += (use_separator ? thousands_sep_len : 0) + n_zeros + n_chars; - if (buffer) { - /* Copy into the output buffer. */ - STRINGLIB(fill)(&digits_end, &buffer_end, n_chars, n_zeros, - use_separator ? thousands_sep : NULL, thousands_sep_len); - } + *buffer_pos -= n_chars; + *digits_pos -= n_chars; + _PyUnicode_FastCopyCharacters(writer->buffer, *buffer_pos, + digits, *digits_pos, + n_chars); + + if (n_zeros) { + *buffer_pos -= n_zeros; + enum PyUnicode_Kind kind = PyUnicode_KIND(writer->buffer); + void *data = PyUnicode_DATA(writer->buffer); + FILL(kind, data, '0', *buffer_pos, n_zeros); } - return count; } - diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 71eb654095a6..8dd7c3b8258c 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -218,6 +218,31 @@ static PyObject *unicode_empty = NULL; return unicode_empty; \ } while (0) +#define FILL(kind, data, value, start, length) \ + do { \ + Py_ssize_t i_ = 0; \ + assert(kind != PyUnicode_WCHAR_KIND); \ + switch ((kind)) { \ + case PyUnicode_1BYTE_KIND: { \ + unsigned char * to_ = (unsigned char *)((data)) + (start); \ + memset(to_, (unsigned char)value, (length)); \ + break; \ + } \ + case PyUnicode_2BYTE_KIND: { \ + Py_UCS2 * to_ = (Py_UCS2 *)((data)) + (start); \ + for (; i_ < (length); ++i_, ++to_) *to_ = (value); \ + break; \ + } \ + case PyUnicode_4BYTE_KIND: { \ + Py_UCS4 * to_ = (Py_UCS4 *)((data)) + (start); \ + for (; i_ < (length); ++i_, ++to_) *to_ = (value); \ + break; \ + } \ + default: Py_UNREACHABLE(); \ + } \ + } while (0) + + /* Forward declaration */ static inline int _PyUnicodeWriter_WriteCharInline(_PyUnicodeWriter *writer, Py_UCS4 ch); @@ -796,7 +821,6 @@ ensure_unicode(PyObject *obj) #include "stringlib/count.h" #include "stringlib/find.h" #include "stringlib/find_max_char.h" -#include "stringlib/localeutil.h" #include "stringlib/undef.h" #include "stringlib/ucs1lib.h" @@ -807,7 +831,6 @@ ensure_unicode(PyObject *obj) #include "stringlib/find.h" #include "stringlib/replace.h" #include "stringlib/find_max_char.h" -#include "stringlib/localeutil.h" #include "stringlib/undef.h" #include "stringlib/ucs2lib.h" @@ -818,7 +841,6 @@ ensure_unicode(PyObject *obj) #include "stringlib/find.h" #include "stringlib/replace.h" #include "stringlib/find_max_char.h" -#include "stringlib/localeutil.h" #include "stringlib/undef.h" #include "stringlib/ucs4lib.h" @@ -829,7 +851,6 @@ ensure_unicode(PyObject *obj) #include "stringlib/find.h" #include "stringlib/replace.h" #include "stringlib/find_max_char.h" -#include "stringlib/localeutil.h" #include "stringlib/undef.h" #include "stringlib/unicodedefs.h" @@ -9292,86 +9313,149 @@ any_find_slice(PyObject* s1, PyObject* s2, return result; } +/* _PyUnicode_InsertThousandsGrouping() helper functions */ +#include "stringlib/localeutil.h" + +/** + * InsertThousandsGrouping: + * @writer: Unicode writer. + * @n_buffer: Number of characters in @buffer. + * @digits: Digits we're reading from. If count is non-NULL, this is unused. + * @d_pos: Start of digits string. + * @n_digits: The number of digits in the string, in which we want + * to put the grouping chars. + * @min_width: The minimum width of the digits in the output string. + * Output will be zero-padded on the left to fill. + * @grouping: see definition in localeconv(). + * @thousands_sep: see definition in localeconv(). + * + * There are 2 modes: counting and filling. If @writer is NULL, + * we are in counting mode, else filling mode. + * If counting, the required buffer size is returned. + * If filling, we know the buffer will be large enough, so we don't + * need to pass in the buffer size. + * Inserts thousand grouping characters (as defined by grouping and + * thousands_sep) into @writer. + * + * Return value: -1 on error, number of characters otherwise. + **/ Py_ssize_t _PyUnicode_InsertThousandsGrouping( - PyObject *unicode, Py_ssize_t index, + _PyUnicodeWriter *writer, Py_ssize_t n_buffer, - void *digits, Py_ssize_t n_digits, + PyObject *digits, + Py_ssize_t d_pos, + Py_ssize_t n_digits, Py_ssize_t min_width, - const char *grouping, PyObject *thousands_sep, + const char *grouping, + PyObject *thousands_sep, Py_UCS4 *maxchar) { - unsigned int kind, thousands_sep_kind; - char *data, *thousands_sep_data; - Py_ssize_t thousands_sep_len; - Py_ssize_t len; - - if (unicode != NULL) { - kind = PyUnicode_KIND(unicode); - data = (char *) PyUnicode_DATA(unicode) + index * kind; + if (writer) { + assert(digits != NULL); + assert(maxchar == NULL); } else { - kind = PyUnicode_1BYTE_KIND; - data = NULL; - } - thousands_sep_kind = PyUnicode_KIND(thousands_sep); - thousands_sep_data = PyUnicode_DATA(thousands_sep); - thousands_sep_len = PyUnicode_GET_LENGTH(thousands_sep); - if (unicode != NULL && thousands_sep_kind != kind) { - if (thousands_sep_kind < kind) { - thousands_sep_data = _PyUnicode_AsKind(thousands_sep, kind); - if (!thousands_sep_data) - return -1; - } - else { - data = _PyUnicode_AsKind(unicode, thousands_sep_kind); - if (!data) - return -1; + assert(digits == NULL); + assert(maxchar != NULL); + } + assert(0 <= d_pos); + assert(0 <= n_digits); + assert(0 <= min_width); + assert(grouping != NULL); + + if (digits != NULL) { + if (PyUnicode_READY(digits) == -1) { + return -1; } } + if (PyUnicode_READY(thousands_sep) == -1) { + return -1; + } - switch (kind) { - case PyUnicode_1BYTE_KIND: - if (unicode != NULL && PyUnicode_IS_ASCII(unicode)) - len = asciilib_InsertThousandsGrouping( - (Py_UCS1 *) data, n_buffer, (Py_UCS1 *) digits, n_digits, - min_width, grouping, - (Py_UCS1 *) thousands_sep_data, thousands_sep_len); - else - len = ucs1lib_InsertThousandsGrouping( - (Py_UCS1*)data, n_buffer, (Py_UCS1*)digits, n_digits, - min_width, grouping, - (Py_UCS1 *) thousands_sep_data, thousands_sep_len); - break; - case PyUnicode_2BYTE_KIND: - len = ucs2lib_InsertThousandsGrouping( - (Py_UCS2 *) data, n_buffer, (Py_UCS2 *) digits, n_digits, - min_width, grouping, - (Py_UCS2 *) thousands_sep_data, thousands_sep_len); - break; - case PyUnicode_4BYTE_KIND: - len = ucs4lib_InsertThousandsGrouping( - (Py_UCS4 *) data, n_buffer, (Py_UCS4 *) digits, n_digits, - min_width, grouping, - (Py_UCS4 *) thousands_sep_data, thousands_sep_len); - break; - default: - Py_UNREACHABLE(); + Py_ssize_t count = 0; + Py_ssize_t n_zeros; + int loop_broken = 0; + int use_separator = 0; /* First time through, don't append the + separator. They only go between + groups. */ + Py_ssize_t buffer_pos; + Py_ssize_t digits_pos; + Py_ssize_t len; + Py_ssize_t n_chars; + Py_ssize_t remaining = n_digits; /* Number of chars remaining to + be looked at */ + /* A generator that returns all of the grouping widths, until it + returns 0. */ + GroupGenerator groupgen; + GroupGenerator_init(&groupgen, grouping); + const Py_ssize_t thousands_sep_len = PyUnicode_GET_LENGTH(thousands_sep); + + /* if digits are not grouped, thousands separator + should be an empty string */ + assert(!(grouping[0] == CHAR_MAX && thousands_sep_len != 0)); + + digits_pos = d_pos + n_digits; + if (writer) { + buffer_pos = writer->pos + n_buffer; + assert(buffer_pos <= PyUnicode_GET_LENGTH(writer->buffer)); + assert(digits_pos <= PyUnicode_GET_LENGTH(digits)); } - if (unicode != NULL && thousands_sep_kind != kind) { - if (thousands_sep_kind < kind) - PyMem_Free(thousands_sep_data); - else - PyMem_Free(data); + else { + buffer_pos = n_buffer; } - if (unicode == NULL) { + + if (!writer) { *maxchar = 127; - if (len != n_digits) { - *maxchar = Py_MAX(*maxchar, - PyUnicode_MAX_CHAR_VALUE(thousands_sep)); + } + + while ((len = GroupGenerator_next(&groupgen)) > 0) { + len = Py_MIN(len, Py_MAX(Py_MAX(remaining, min_width), 1)); + n_zeros = Py_MAX(0, len - remaining); + n_chars = Py_MAX(0, Py_MIN(remaining, len)); + + /* Use n_zero zero's and n_chars chars */ + + /* Count only, don't do anything. */ + count += (use_separator ? thousands_sep_len : 0) + n_zeros + n_chars; + + /* Copy into the writer. */ + InsertThousandsGrouping_fill(writer, &buffer_pos, + digits, &digits_pos, + n_chars, n_zeros, + use_separator ? thousands_sep : NULL, + thousands_sep_len, maxchar); + + /* Use a separator next time. */ + use_separator = 1; + + remaining -= n_chars; + min_width -= len; + + if (remaining <= 0 && min_width <= 0) { + loop_broken = 1; + break; } + min_width -= thousands_sep_len; + } + if (!loop_broken) { + /* We left the loop without using a break statement. */ + + len = Py_MAX(Py_MAX(remaining, min_width), 1); + n_zeros = Py_MAX(0, len - remaining); + n_chars = Py_MAX(0, Py_MIN(remaining, len)); + + /* Use n_zero zero's and n_chars chars */ + count += (use_separator ? thousands_sep_len : 0) + n_zeros + n_chars; + + /* Copy into the writer. */ + InsertThousandsGrouping_fill(writer, &buffer_pos, + digits, &digits_pos, + n_chars, n_zeros, + use_separator ? thousands_sep : NULL, + thousands_sep_len, maxchar); } - return len; + return count; } @@ -9990,30 +10074,6 @@ _PyUnicode_JoinArray(PyObject *separator, PyObject *const *items, Py_ssize_t seq return NULL; } -#define FILL(kind, data, value, start, length) \ - do { \ - Py_ssize_t i_ = 0; \ - assert(kind != PyUnicode_WCHAR_KIND); \ - switch ((kind)) { \ - case PyUnicode_1BYTE_KIND: { \ - unsigned char * to_ = (unsigned char *)((data)) + (start); \ - memset(to_, (unsigned char)value, (length)); \ - break; \ - } \ - case PyUnicode_2BYTE_KIND: { \ - Py_UCS2 * to_ = (Py_UCS2 *)((data)) + (start); \ - for (; i_ < (length); ++i_, ++to_) *to_ = (value); \ - break; \ - } \ - case PyUnicode_4BYTE_KIND: { \ - Py_UCS4 * to_ = (Py_UCS4 *)((data)) + (start); \ - for (; i_ < (length); ++i_, ++to_) *to_ = (value); \ - break; \ - } \ - default: Py_UNREACHABLE(); \ - } \ - } while (0) - void _PyUnicode_FastFill(PyObject *unicode, Py_ssize_t start, Py_ssize_t length, Py_UCS4 fill_char) diff --git a/Python/formatter_unicode.c b/Python/formatter_unicode.c index 2cd3eb8eb750..ef81d15bc568 100644 --- a/Python/formatter_unicode.c +++ b/Python/formatter_unicode.c @@ -461,7 +461,8 @@ parse_number(PyObject *s, Py_ssize_t pos, Py_ssize_t end, /* not all fields of format are used. for example, precision is unused. should this take discrete params in order to be more clear about what it does? or is passing a single format parameter easier - and more efficient enough to justify a little obfuscation? */ + and more efficient enough to justify a little obfuscation? + Return -1 on error. */ static Py_ssize_t calc_number_widths(NumberFieldWidths *spec, Py_ssize_t n_prefix, Py_UCS4 sign_char, PyObject *number, Py_ssize_t n_start, @@ -540,9 +541,12 @@ calc_number_widths(NumberFieldWidths *spec, Py_ssize_t n_prefix, Py_UCS4 grouping_maxchar; spec->n_grouped_digits = _PyUnicode_InsertThousandsGrouping( NULL, 0, - 0, NULL, - spec->n_digits, spec->n_min_width, + NULL, 0, spec->n_digits, + spec->n_min_width, locale->grouping, locale->thousands_sep, &grouping_maxchar); + if (spec->n_grouped_digits == -1) { + return -1; + } *maxchar = Py_MAX(*maxchar, grouping_maxchar); } @@ -634,26 +638,14 @@ fill_number(_PyUnicodeWriter *writer, const NumberFieldWidths *spec, /* Only for type 'c' special case, it has no digits. */ if (spec->n_digits != 0) { /* Fill the digits with InsertThousandsGrouping. */ - char *pdigits; - if (PyUnicode_READY(digits)) - return -1; - pdigits = PyUnicode_DATA(digits); - if (PyUnicode_KIND(digits) < kind) { - pdigits = _PyUnicode_AsKind(digits, kind); - if (pdigits == NULL) - return -1; - } r = _PyUnicode_InsertThousandsGrouping( - writer->buffer, writer->pos, - spec->n_grouped_digits, - pdigits + kind * d_pos, - spec->n_digits, spec->n_min_width, + writer, spec->n_grouped_digits, + digits, d_pos, spec->n_digits, + spec->n_min_width, locale->grouping, locale->thousands_sep, NULL); if (r == -1) return -1; assert(r == spec->n_grouped_digits); - if (PyUnicode_KIND(digits) < kind) - PyMem_Free(pdigits); d_pos += spec->n_digits; } if (toupper) { @@ -993,6 +985,9 @@ format_long_internal(PyObject *value, const InternalFormatSpec *format, n_total = calc_number_widths(&spec, n_prefix, sign_char, tmp, inumeric_chars, inumeric_chars + n_digits, n_remainder, 0, &locale, format, &maxchar); + if (n_total == -1) { + goto done; + } /* Allocate the memory. */ if (_PyUnicodeWriter_Prepare(writer, n_total, maxchar) == -1) @@ -1138,6 +1133,9 @@ format_float_internal(PyObject *value, n_total = calc_number_widths(&spec, 0, sign_char, unicode_tmp, index, index + n_digits, n_remainder, has_decimal, &locale, format, &maxchar); + if (n_total == -1) { + goto done; + } /* Allocate the memory. */ if (_PyUnicodeWriter_Prepare(writer, n_total, maxchar) == -1) @@ -1321,6 +1319,9 @@ format_complex_internal(PyObject *value, i_re, i_re + n_re_digits, n_re_remainder, re_has_decimal, &locale, &tmp_format, &maxchar); + if (n_re_total == -1) { + goto done; + } /* Same formatting, but always include a sign, unless the real part is * going to be omitted, in which case we use whatever sign convention was @@ -1331,6 +1332,9 @@ format_complex_internal(PyObject *value, i_im, i_im + n_im_digits, n_im_remainder, im_has_decimal, &locale, &tmp_format, &maxchar); + if (n_im_total == -1) { + goto done; + } if (skip_re) n_re_total = 0; From webhook-mailer at python.org Mon Nov 26 11:03:24 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 26 Nov 2018 16:03:24 -0000 Subject: [Python-checkins] pythoninfo: log more environment variable (GH-10719) Message-ID: https://github.com/python/cpython/commit/282c03d45d2d766c55904a4eb766923a2c459124 commit: 282c03d45d2d766c55904a4eb766923a2c459124 branch: master author: Victor Stinner committer: GitHub date: 2018-11-26T17:03:16+01:00 summary: pythoninfo: log more environment variable (GH-10719) Log TZ to debug a timezone issue... and a few more :-) files: M Lib/test/pythoninfo.py diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py index 9257fdf332a6..30e6f21c2b48 100644 --- a/Lib/test/pythoninfo.py +++ b/Lib/test/pythoninfo.py @@ -199,32 +199,73 @@ def format_groups(groups): call_func(info_add, 'os.cpu_count', os, 'cpu_count') call_func(info_add, 'os.loadavg', os, 'getloadavg') - # Get environment variables: filter to list - # to not leak sensitive information - ENV_VARS = ( + # Environment variables used by the stdlib and tests. Don't log the full + # environment: filter to list to not leak sensitive information. + # + # HTTP_PROXY is not logged because it can contain a password. + ENV_VARS = frozenset(( + "APPDATA", + "AR", + "ARCHFLAGS", + "ARFLAGS", + "AUDIODEV", "CC", + "CFLAGS", + "COLUMNS", + "COMPUTERNAME", "COMSPEC", + "CPP", + "CPPFLAGS", "DISPLAY", + "DISTUTILS_DEBUG", "DISTUTILS_USE_SDK", "DYLD_LIBRARY_PATH", + "ENSUREPIP_OPTIONS", + "HISTORY_FILE", "HOME", "HOMEDRIVE", "HOMEPATH", + "IDLESTARTUP", "LANG", + "LDFLAGS", + "LDSHARED", "LD_LIBRARY_PATH", + "LINES", "MACOSX_DEPLOYMENT_TARGET", + "MAILCAPS", "MAKEFLAGS", + "MIXERDEV", "MSSDK", "PATH", + "PATHEXT", + "PIP_CONFIG_FILE", + "PLAT", + "POSIXLY_CORRECT", + "PY_SAX_PARSER", + "ProgramFiles", + "ProgramFiles(x86)", + "RUNNING_ON_VALGRIND", "SDK_TOOLS_BIN", + "SERVER_SOFTWARE", "SHELL", + "SOURCE_DATE_EPOCH", + "SYSTEMROOT", "TEMP", "TERM", + "TILE_LIBRARY", + "TIX_LIBRARY", "TMP", "TMPDIR", + "TZ", "USERPROFILE", + "VIRTUAL_ENV", "WAYLAND_DISPLAY", - ) + "WINDIR", + "_PYTHON_HOST_PLATFORM", + "_PYTHON_PROJECT_BASE", + "_PYTHON_SYSCONFIGDATA_NAME", + "__PYVENV_LAUNCHER__", + )) for name, value in os.environ.items(): uname = name.upper() if (uname in ENV_VARS From webhook-mailer at python.org Mon Nov 26 11:03:40 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 26 Nov 2018 16:03:40 -0000 Subject: [Python-checkins] bpo-33954: Fix _PyUnicode_InsertThousandsGrouping() (GH-10623) (GH-10718) (GH-10720) Message-ID: https://github.com/python/cpython/commit/fc4a44b0c3a69390eca4680d89c2ae5fe967f882 commit: fc4a44b0c3a69390eca4680d89c2ae5fe967f882 branch: 3.6 author: Victor Stinner committer: GitHub date: 2018-11-26T17:03:31+01:00 summary: bpo-33954: Fix _PyUnicode_InsertThousandsGrouping() (GH-10623) (GH-10718) (GH-10720) Fix str.format(), float.__format__() and complex.__format__() methods for non-ASCII decimal point when using the "n" formatter. Rewrite _PyUnicode_InsertThousandsGrouping(): it now requires a _PyUnicodeWriter object for the buffer and a Python str object for digits. (cherry picked from commit 59423e3ddd736387cef8f7632c71954c1859bed0) (cherry picked from commit 6f5fa1b4be735159e964906ab608dc467476e47c) files: A Misc/NEWS.d/next/Core and Builtins/2018-11-20-22-33-38.bpo-33954.RzSngM.rst M Include/unicodeobject.h M Objects/stringlib/localeutil.h M Objects/unicodeobject.c M Python/formatter_unicode.c diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h index f49887387008..c81a38181e49 100644 --- a/Include/unicodeobject.h +++ b/Include/unicodeobject.h @@ -2143,10 +2143,10 @@ PyAPI_FUNC(PyObject *) _PyUnicode_XStrip( see Objects/stringlib/localeutil.h */ #ifndef Py_LIMITED_API PyAPI_FUNC(Py_ssize_t) _PyUnicode_InsertThousandsGrouping( - PyObject *unicode, - Py_ssize_t index, + _PyUnicodeWriter *writer, Py_ssize_t n_buffer, - void *digits, + PyObject *digits, + Py_ssize_t d_pos, Py_ssize_t n_digits, Py_ssize_t min_width, const char *grouping, diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-11-20-22-33-38.bpo-33954.RzSngM.rst b/Misc/NEWS.d/next/Core and Builtins/2018-11-20-22-33-38.bpo-33954.RzSngM.rst new file mode 100644 index 000000000000..9bfbe1644e16 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-11-20-22-33-38.bpo-33954.RzSngM.rst @@ -0,0 +1,3 @@ +For :meth:`str.format`, :meth:`float.__format__` and +:meth:`complex.__format__` methods for non-ASCII decimal point when using +the "n" formatter. diff --git a/Objects/stringlib/localeutil.h b/Objects/stringlib/localeutil.h index df501ed05c7e..31fed349caa5 100644 --- a/Objects/stringlib/localeutil.h +++ b/Objects/stringlib/localeutil.h @@ -1,28 +1,24 @@ -/* stringlib: locale related helpers implementation */ - -#include - -#if !STRINGLIB_IS_UNICODE -# error "localeutil.h is specific to Unicode" -#endif +/* _PyUnicode_InsertThousandsGrouping() helper functions */ typedef struct { const char *grouping; char previous; Py_ssize_t i; /* Where we're currently pointing in grouping. */ -} STRINGLIB(GroupGenerator); +} GroupGenerator; + static void -STRINGLIB(GroupGenerator_init)(STRINGLIB(GroupGenerator) *self, const char *grouping) +GroupGenerator_init(GroupGenerator *self, const char *grouping) { self->grouping = grouping; self->i = 0; self->previous = 0; } + /* Returns the next grouping, or 0 to signify end. */ static Py_ssize_t -STRINGLIB(GroupGenerator_next)(STRINGLIB(GroupGenerator) *self) +GroupGenerator_next(GroupGenerator *self) { /* Note that we don't really do much error checking here. If a grouping string contains just CHAR_MAX, for example, then just @@ -43,138 +39,44 @@ STRINGLIB(GroupGenerator_next)(STRINGLIB(GroupGenerator) *self) } } + /* Fill in some digits, leading zeros, and thousands separator. All are optional, depending on when we're called. */ static void -STRINGLIB(fill)(STRINGLIB_CHAR **digits_end, STRINGLIB_CHAR **buffer_end, - Py_ssize_t n_chars, Py_ssize_t n_zeros, STRINGLIB_CHAR* thousands_sep, - Py_ssize_t thousands_sep_len) +InsertThousandsGrouping_fill(_PyUnicodeWriter *writer, Py_ssize_t *buffer_pos, + PyObject *digits, Py_ssize_t *digits_pos, + Py_ssize_t n_chars, Py_ssize_t n_zeros, + PyObject *thousands_sep, Py_ssize_t thousands_sep_len, + Py_UCS4 *maxchar) { - Py_ssize_t i; + if (!writer) { + /* if maxchar > 127, maxchar is already set */ + if (*maxchar == 127 && thousands_sep) { + Py_UCS4 maxchar2 = PyUnicode_MAX_CHAR_VALUE(thousands_sep); + *maxchar = Py_MAX(*maxchar, maxchar2); + } + return; + } if (thousands_sep) { - *buffer_end -= thousands_sep_len; + *buffer_pos -= thousands_sep_len; /* Copy the thousands_sep chars into the buffer. */ - memcpy(*buffer_end, thousands_sep, - thousands_sep_len * STRINGLIB_SIZEOF_CHAR); - } - - *buffer_end -= n_chars; - *digits_end -= n_chars; - memcpy(*buffer_end, *digits_end, n_chars * sizeof(STRINGLIB_CHAR)); - - *buffer_end -= n_zeros; - for (i = 0; i < n_zeros; i++) - (*buffer_end)[i] = '0'; -} - -/** - * InsertThousandsGrouping: - * @buffer: A pointer to the start of a string. - * @n_buffer: Number of characters in @buffer. - * @digits: A pointer to the digits we're reading from. If count - * is non-NULL, this is unused. - * @n_digits: The number of digits in the string, in which we want - * to put the grouping chars. - * @min_width: The minimum width of the digits in the output string. - * Output will be zero-padded on the left to fill. - * @grouping: see definition in localeconv(). - * @thousands_sep: see definition in localeconv(). - * - * There are 2 modes: counting and filling. If @buffer is NULL, - * we are in counting mode, else filling mode. - * If counting, the required buffer size is returned. - * If filling, we know the buffer will be large enough, so we don't - * need to pass in the buffer size. - * Inserts thousand grouping characters (as defined by grouping and - * thousands_sep) into the string between buffer and buffer+n_digits. - * - * Return value: 0 on error, else 1. Note that no error can occur if - * count is non-NULL. - * - * This name won't be used, the includer of this file should define - * it to be the actual function name, based on unicode or string. - * - * As closely as possible, this code mimics the logic in decimal.py's - _insert_thousands_sep(). - **/ -static Py_ssize_t -STRINGLIB(InsertThousandsGrouping)( - STRINGLIB_CHAR *buffer, - Py_ssize_t n_buffer, - STRINGLIB_CHAR *digits, - Py_ssize_t n_digits, - Py_ssize_t min_width, - const char *grouping, - STRINGLIB_CHAR *thousands_sep, - Py_ssize_t thousands_sep_len) -{ - Py_ssize_t count = 0; - Py_ssize_t n_zeros; - int loop_broken = 0; - int use_separator = 0; /* First time through, don't append the - separator. They only go between - groups. */ - STRINGLIB_CHAR *buffer_end = NULL; - STRINGLIB_CHAR *digits_end = NULL; - Py_ssize_t l; - Py_ssize_t n_chars; - Py_ssize_t remaining = n_digits; /* Number of chars remaining to - be looked at */ - /* A generator that returns all of the grouping widths, until it - returns 0. */ - STRINGLIB(GroupGenerator) groupgen; - STRINGLIB(GroupGenerator_init)(&groupgen, grouping); - - if (buffer) { - buffer_end = buffer + n_buffer; - digits_end = digits + n_digits; - } - - while ((l = STRINGLIB(GroupGenerator_next)(&groupgen)) > 0) { - l = Py_MIN(l, Py_MAX(Py_MAX(remaining, min_width), 1)); - n_zeros = Py_MAX(0, l - remaining); - n_chars = Py_MAX(0, Py_MIN(remaining, l)); - - /* Use n_zero zero's and n_chars chars */ - - /* Count only, don't do anything. */ - count += (use_separator ? thousands_sep_len : 0) + n_zeros + n_chars; - - if (buffer) { - /* Copy into the output buffer. */ - STRINGLIB(fill)(&digits_end, &buffer_end, n_chars, n_zeros, - use_separator ? thousands_sep : NULL, thousands_sep_len); - } - - /* Use a separator next time. */ - use_separator = 1; - - remaining -= n_chars; - min_width -= l; - - if (remaining <= 0 && min_width <= 0) { - loop_broken = 1; - break; - } - min_width -= thousands_sep_len; + _PyUnicode_FastCopyCharacters(writer->buffer, *buffer_pos, + thousands_sep, 0, + thousands_sep_len); } - if (!loop_broken) { - /* We left the loop without using a break statement. */ - l = Py_MAX(Py_MAX(remaining, min_width), 1); - n_zeros = Py_MAX(0, l - remaining); - n_chars = Py_MAX(0, Py_MIN(remaining, l)); - - /* Use n_zero zero's and n_chars chars */ - count += (use_separator ? thousands_sep_len : 0) + n_zeros + n_chars; - if (buffer) { - /* Copy into the output buffer. */ - STRINGLIB(fill)(&digits_end, &buffer_end, n_chars, n_zeros, - use_separator ? thousands_sep : NULL, thousands_sep_len); - } + *buffer_pos -= n_chars; + *digits_pos -= n_chars; + _PyUnicode_FastCopyCharacters(writer->buffer, *buffer_pos, + digits, *digits_pos, + n_chars); + + if (n_zeros) { + *buffer_pos -= n_zeros; + enum PyUnicode_Kind kind = PyUnicode_KIND(writer->buffer); + void *data = PyUnicode_DATA(writer->buffer); + FILL(kind, data, '0', *buffer_pos, n_zeros); } - return count; } - diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 1f342bd199c7..6bfcddaa64e4 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -203,6 +203,31 @@ static PyObject *unicode_empty = NULL; return unicode_empty; \ } while (0) +#define FILL(kind, data, value, start, length) \ + do { \ + Py_ssize_t i_ = 0; \ + assert(kind != PyUnicode_WCHAR_KIND); \ + switch ((kind)) { \ + case PyUnicode_1BYTE_KIND: { \ + unsigned char * to_ = (unsigned char *)((data)) + (start); \ + memset(to_, (unsigned char)value, (length)); \ + break; \ + } \ + case PyUnicode_2BYTE_KIND: { \ + Py_UCS2 * to_ = (Py_UCS2 *)((data)) + (start); \ + for (; i_ < (length); ++i_, ++to_) *to_ = (value); \ + break; \ + } \ + case PyUnicode_4BYTE_KIND: { \ + Py_UCS4 * to_ = (Py_UCS4 *)((data)) + (start); \ + for (; i_ < (length); ++i_, ++to_) *to_ = (value); \ + break; \ + } \ + default: assert(0); \ + } \ + } while (0) + + /* Forward declaration */ static inline int _PyUnicodeWriter_WriteCharInline(_PyUnicodeWriter *writer, Py_UCS4 ch); @@ -779,7 +804,6 @@ ensure_unicode(PyObject *obj) #include "stringlib/count.h" #include "stringlib/find.h" #include "stringlib/find_max_char.h" -#include "stringlib/localeutil.h" #include "stringlib/undef.h" #include "stringlib/ucs1lib.h" @@ -790,7 +814,6 @@ ensure_unicode(PyObject *obj) #include "stringlib/find.h" #include "stringlib/replace.h" #include "stringlib/find_max_char.h" -#include "stringlib/localeutil.h" #include "stringlib/undef.h" #include "stringlib/ucs2lib.h" @@ -801,7 +824,6 @@ ensure_unicode(PyObject *obj) #include "stringlib/find.h" #include "stringlib/replace.h" #include "stringlib/find_max_char.h" -#include "stringlib/localeutil.h" #include "stringlib/undef.h" #include "stringlib/ucs4lib.h" @@ -812,7 +834,6 @@ ensure_unicode(PyObject *obj) #include "stringlib/find.h" #include "stringlib/replace.h" #include "stringlib/find_max_char.h" -#include "stringlib/localeutil.h" #include "stringlib/undef.h" #include "stringlib/unicodedefs.h" @@ -9407,87 +9428,149 @@ any_find_slice(PyObject* s1, PyObject* s2, return result; } +/* _PyUnicode_InsertThousandsGrouping() helper functions */ +#include "stringlib/localeutil.h" + +/** + * InsertThousandsGrouping: + * @writer: Unicode writer. + * @n_buffer: Number of characters in @buffer. + * @digits: Digits we're reading from. If count is non-NULL, this is unused. + * @d_pos: Start of digits string. + * @n_digits: The number of digits in the string, in which we want + * to put the grouping chars. + * @min_width: The minimum width of the digits in the output string. + * Output will be zero-padded on the left to fill. + * @grouping: see definition in localeconv(). + * @thousands_sep: see definition in localeconv(). + * + * There are 2 modes: counting and filling. If @writer is NULL, + * we are in counting mode, else filling mode. + * If counting, the required buffer size is returned. + * If filling, we know the buffer will be large enough, so we don't + * need to pass in the buffer size. + * Inserts thousand grouping characters (as defined by grouping and + * thousands_sep) into @writer. + * + * Return value: -1 on error, number of characters otherwise. + **/ Py_ssize_t _PyUnicode_InsertThousandsGrouping( - PyObject *unicode, Py_ssize_t index, + _PyUnicodeWriter *writer, Py_ssize_t n_buffer, - void *digits, Py_ssize_t n_digits, + PyObject *digits, + Py_ssize_t d_pos, + Py_ssize_t n_digits, Py_ssize_t min_width, - const char *grouping, PyObject *thousands_sep, + const char *grouping, + PyObject *thousands_sep, Py_UCS4 *maxchar) { - unsigned int kind, thousands_sep_kind; - char *data, *thousands_sep_data; - Py_ssize_t thousands_sep_len; - Py_ssize_t len; - - if (unicode != NULL) { - kind = PyUnicode_KIND(unicode); - data = (char *) PyUnicode_DATA(unicode) + index * kind; + if (writer) { + assert(digits != NULL); + assert(maxchar == NULL); } else { - kind = PyUnicode_1BYTE_KIND; - data = NULL; - } - thousands_sep_kind = PyUnicode_KIND(thousands_sep); - thousands_sep_data = PyUnicode_DATA(thousands_sep); - thousands_sep_len = PyUnicode_GET_LENGTH(thousands_sep); - if (unicode != NULL && thousands_sep_kind != kind) { - if (thousands_sep_kind < kind) { - thousands_sep_data = _PyUnicode_AsKind(thousands_sep, kind); - if (!thousands_sep_data) - return -1; - } - else { - data = _PyUnicode_AsKind(unicode, thousands_sep_kind); - if (!data) - return -1; - } + assert(digits == NULL); + assert(maxchar != NULL); } + assert(0 <= d_pos); + assert(0 <= n_digits); + assert(0 <= min_width); + assert(grouping != NULL); - switch (kind) { - case PyUnicode_1BYTE_KIND: - if (unicode != NULL && PyUnicode_IS_ASCII(unicode)) - len = asciilib_InsertThousandsGrouping( - (Py_UCS1 *) data, n_buffer, (Py_UCS1 *) digits, n_digits, - min_width, grouping, - (Py_UCS1 *) thousands_sep_data, thousands_sep_len); - else - len = ucs1lib_InsertThousandsGrouping( - (Py_UCS1*)data, n_buffer, (Py_UCS1*)digits, n_digits, - min_width, grouping, - (Py_UCS1 *) thousands_sep_data, thousands_sep_len); - break; - case PyUnicode_2BYTE_KIND: - len = ucs2lib_InsertThousandsGrouping( - (Py_UCS2 *) data, n_buffer, (Py_UCS2 *) digits, n_digits, - min_width, grouping, - (Py_UCS2 *) thousands_sep_data, thousands_sep_len); - break; - case PyUnicode_4BYTE_KIND: - len = ucs4lib_InsertThousandsGrouping( - (Py_UCS4 *) data, n_buffer, (Py_UCS4 *) digits, n_digits, - min_width, grouping, - (Py_UCS4 *) thousands_sep_data, thousands_sep_len); - break; - default: - assert(0); + if (digits != NULL) { + if (PyUnicode_READY(digits) == -1) { + return -1; + } + } + if (PyUnicode_READY(thousands_sep) == -1) { return -1; } - if (unicode != NULL && thousands_sep_kind != kind) { - if (thousands_sep_kind < kind) - PyMem_Free(thousands_sep_data); - else - PyMem_Free(data); + + Py_ssize_t count = 0; + Py_ssize_t n_zeros; + int loop_broken = 0; + int use_separator = 0; /* First time through, don't append the + separator. They only go between + groups. */ + Py_ssize_t buffer_pos; + Py_ssize_t digits_pos; + Py_ssize_t len; + Py_ssize_t n_chars; + Py_ssize_t remaining = n_digits; /* Number of chars remaining to + be looked at */ + /* A generator that returns all of the grouping widths, until it + returns 0. */ + GroupGenerator groupgen; + GroupGenerator_init(&groupgen, grouping); + const Py_ssize_t thousands_sep_len = PyUnicode_GET_LENGTH(thousands_sep); + + /* if digits are not grouped, thousands separator + should be an empty string */ + assert(!(grouping[0] == CHAR_MAX && thousands_sep_len != 0)); + + digits_pos = d_pos + n_digits; + if (writer) { + buffer_pos = writer->pos + n_buffer; + assert(buffer_pos <= PyUnicode_GET_LENGTH(writer->buffer)); + assert(digits_pos <= PyUnicode_GET_LENGTH(digits)); } - if (unicode == NULL) { + else { + buffer_pos = n_buffer; + } + + if (!writer) { *maxchar = 127; - if (len != n_digits) { - *maxchar = Py_MAX(*maxchar, - PyUnicode_MAX_CHAR_VALUE(thousands_sep)); + } + + while ((len = GroupGenerator_next(&groupgen)) > 0) { + len = Py_MIN(len, Py_MAX(Py_MAX(remaining, min_width), 1)); + n_zeros = Py_MAX(0, len - remaining); + n_chars = Py_MAX(0, Py_MIN(remaining, len)); + + /* Use n_zero zero's and n_chars chars */ + + /* Count only, don't do anything. */ + count += (use_separator ? thousands_sep_len : 0) + n_zeros + n_chars; + + /* Copy into the writer. */ + InsertThousandsGrouping_fill(writer, &buffer_pos, + digits, &digits_pos, + n_chars, n_zeros, + use_separator ? thousands_sep : NULL, + thousands_sep_len, maxchar); + + /* Use a separator next time. */ + use_separator = 1; + + remaining -= n_chars; + min_width -= len; + + if (remaining <= 0 && min_width <= 0) { + loop_broken = 1; + break; } + min_width -= thousands_sep_len; + } + if (!loop_broken) { + /* We left the loop without using a break statement. */ + + len = Py_MAX(Py_MAX(remaining, min_width), 1); + n_zeros = Py_MAX(0, len - remaining); + n_chars = Py_MAX(0, Py_MIN(remaining, len)); + + /* Use n_zero zero's and n_chars chars */ + count += (use_separator ? thousands_sep_len : 0) + n_zeros + n_chars; + + /* Copy into the writer. */ + InsertThousandsGrouping_fill(writer, &buffer_pos, + digits, &digits_pos, + n_chars, n_zeros, + use_separator ? thousands_sep : NULL, + thousands_sep_len, maxchar); } - return len; + return count; } @@ -10174,30 +10257,6 @@ _PyUnicode_JoinArray(PyObject *separator, PyObject **items, Py_ssize_t seqlen) return NULL; } -#define FILL(kind, data, value, start, length) \ - do { \ - Py_ssize_t i_ = 0; \ - assert(kind != PyUnicode_WCHAR_KIND); \ - switch ((kind)) { \ - case PyUnicode_1BYTE_KIND: { \ - unsigned char * to_ = (unsigned char *)((data)) + (start); \ - memset(to_, (unsigned char)value, (length)); \ - break; \ - } \ - case PyUnicode_2BYTE_KIND: { \ - Py_UCS2 * to_ = (Py_UCS2 *)((data)) + (start); \ - for (; i_ < (length); ++i_, ++to_) *to_ = (value); \ - break; \ - } \ - case PyUnicode_4BYTE_KIND: { \ - Py_UCS4 * to_ = (Py_UCS4 *)((data)) + (start); \ - for (; i_ < (length); ++i_, ++to_) *to_ = (value); \ - break; \ - } \ - default: assert(0); \ - } \ - } while (0) - void _PyUnicode_FastFill(PyObject *unicode, Py_ssize_t start, Py_ssize_t length, Py_UCS4 fill_char) diff --git a/Python/formatter_unicode.c b/Python/formatter_unicode.c index c9a2c99dd257..4a38f7a30509 100644 --- a/Python/formatter_unicode.c +++ b/Python/formatter_unicode.c @@ -462,7 +462,8 @@ parse_number(PyObject *s, Py_ssize_t pos, Py_ssize_t end, /* not all fields of format are used. for example, precision is unused. should this take discrete params in order to be more clear about what it does? or is passing a single format parameter easier - and more efficient enough to justify a little obfuscation? */ + and more efficient enough to justify a little obfuscation? + Return -1 on error. */ static Py_ssize_t calc_number_widths(NumberFieldWidths *spec, Py_ssize_t n_prefix, Py_UCS4 sign_char, PyObject *number, Py_ssize_t n_start, @@ -541,9 +542,12 @@ calc_number_widths(NumberFieldWidths *spec, Py_ssize_t n_prefix, Py_UCS4 grouping_maxchar; spec->n_grouped_digits = _PyUnicode_InsertThousandsGrouping( NULL, 0, - 0, NULL, - spec->n_digits, spec->n_min_width, + NULL, 0, spec->n_digits, + spec->n_min_width, locale->grouping, locale->thousands_sep, &grouping_maxchar); + if (spec->n_grouped_digits == -1) { + return -1; + } *maxchar = Py_MAX(*maxchar, grouping_maxchar); } @@ -637,26 +641,14 @@ fill_number(_PyUnicodeWriter *writer, const NumberFieldWidths *spec, /* Only for type 'c' special case, it has no digits. */ if (spec->n_digits != 0) { /* Fill the digits with InsertThousandsGrouping. */ - char *pdigits; - if (PyUnicode_READY(digits)) - return -1; - pdigits = PyUnicode_DATA(digits); - if (PyUnicode_KIND(digits) < kind) { - pdigits = _PyUnicode_AsKind(digits, kind); - if (pdigits == NULL) - return -1; - } r = _PyUnicode_InsertThousandsGrouping( - writer->buffer, writer->pos, - spec->n_grouped_digits, - pdigits + kind * d_pos, - spec->n_digits, spec->n_min_width, + writer, spec->n_grouped_digits, + digits, d_pos, spec->n_digits, + spec->n_min_width, locale->grouping, locale->thousands_sep, NULL); if (r == -1) return -1; assert(r == spec->n_grouped_digits); - if (PyUnicode_KIND(digits) < kind) - PyMem_Free(pdigits); d_pos += spec->n_digits; } if (toupper) { @@ -996,6 +988,9 @@ format_long_internal(PyObject *value, const InternalFormatSpec *format, n_total = calc_number_widths(&spec, n_prefix, sign_char, tmp, inumeric_chars, inumeric_chars + n_digits, n_remainder, 0, &locale, format, &maxchar); + if (n_total == -1) { + goto done; + } /* Allocate the memory. */ if (_PyUnicodeWriter_Prepare(writer, n_total, maxchar) == -1) @@ -1141,6 +1136,9 @@ format_float_internal(PyObject *value, n_total = calc_number_widths(&spec, 0, sign_char, unicode_tmp, index, index + n_digits, n_remainder, has_decimal, &locale, format, &maxchar); + if (n_total == -1) { + goto done; + } /* Allocate the memory. */ if (_PyUnicodeWriter_Prepare(writer, n_total, maxchar) == -1) @@ -1324,6 +1322,9 @@ format_complex_internal(PyObject *value, i_re, i_re + n_re_digits, n_re_remainder, re_has_decimal, &locale, &tmp_format, &maxchar); + if (n_re_total == -1) { + goto done; + } /* Same formatting, but always include a sign, unless the real part is * going to be omitted, in which case we use whatever sign convention was @@ -1334,6 +1335,9 @@ format_complex_internal(PyObject *value, i_im, i_im + n_im_digits, n_im_remainder, im_has_decimal, &locale, &tmp_format, &maxchar); + if (n_im_total == -1) { + goto done; + } if (skip_re) n_re_total = 0; From webhook-mailer at python.org Mon Nov 26 11:09:20 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 26 Nov 2018 16:09:20 -0000 Subject: [Python-checkins] bpo-35134: Create Include/cpython/object.h (GH-10679) Message-ID: https://github.com/python/cpython/commit/6eb996685e25c09499858bee4be258776e603c6f commit: 6eb996685e25c09499858bee4be258776e603c6f branch: master author: Victor Stinner committer: GitHub date: 2018-11-26T17:09:16+01:00 summary: bpo-35134: Create Include/cpython/object.h (GH-10679) * Move object.h code surrounded by "#ifndef Py_LIMITED_API" to a new Include/cpython/object.h header file. * "typedef struct _typeobject PyTypeObject;" is now always defined in object.h, but if Py_LIMITED_API is not defined, Include/cpython/object.h also defines the structure. * Complete the printfunc comment to mention Py_LIMITED_API define. files: A Include/cpython/object.h M Include/object.h diff --git a/Include/cpython/object.h b/Include/cpython/object.h new file mode 100644 index 000000000000..77184c95151a --- /dev/null +++ b/Include/cpython/object.h @@ -0,0 +1,454 @@ +#ifndef Py_CPYTHON_OBJECT_H +# error "this header file must not be included directly" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* String Literals ****************************************/ +/* This structure helps managing static strings. The basic usage goes like this: + Instead of doing + + r = PyObject_CallMethod(o, "foo", "args", ...); + + do + + _Py_IDENTIFIER(foo); + ... + r = _PyObject_CallMethodId(o, &PyId_foo, "args", ...); + + PyId_foo is a static variable, either on block level or file level. On first + usage, the string "foo" is interned, and the structures are linked. On interpreter + shutdown, all strings are released (through _PyUnicode_ClearStaticStrings). + + Alternatively, _Py_static_string allows choosing the variable name. + _PyUnicode_FromId returns a borrowed reference to the interned string. + _PyObject_{Get,Set,Has}AttrId are __getattr__ versions using _Py_Identifier*. +*/ +typedef struct _Py_Identifier { + struct _Py_Identifier *next; + const char* string; + PyObject *object; +} _Py_Identifier; + +#define _Py_static_string_init(value) { .next = NULL, .string = value, .object = NULL } +#define _Py_static_string(varname, value) static _Py_Identifier varname = _Py_static_string_init(value) +#define _Py_IDENTIFIER(varname) _Py_static_string(PyId_##varname, #varname) + +/* buffer interface */ +typedef struct bufferinfo { + void *buf; + PyObject *obj; /* owned reference */ + Py_ssize_t len; + Py_ssize_t itemsize; /* This is Py_ssize_t so it can be + pointed to by strides in simple case.*/ + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; +} Py_buffer; + +typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); +typedef void (*releasebufferproc)(PyObject *, Py_buffer *); + +/* Maximum number of dimensions */ +#define PyBUF_MAX_NDIM 64 + +/* Flags for getting buffers */ +#define PyBUF_SIMPLE 0 +#define PyBUF_WRITABLE 0x0001 +/* we used to include an E, backwards compatible alias */ +#define PyBUF_WRITEABLE PyBUF_WRITABLE +#define PyBUF_FORMAT 0x0004 +#define PyBUF_ND 0x0008 +#define PyBUF_STRIDES (0x0010 | PyBUF_ND) +#define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) +#define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) +#define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) +#define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + +#define PyBUF_CONTIG (PyBUF_ND | PyBUF_WRITABLE) +#define PyBUF_CONTIG_RO (PyBUF_ND) + +#define PyBUF_STRIDED (PyBUF_STRIDES | PyBUF_WRITABLE) +#define PyBUF_STRIDED_RO (PyBUF_STRIDES) + +#define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_WRITABLE | PyBUF_FORMAT) +#define PyBUF_RECORDS_RO (PyBUF_STRIDES | PyBUF_FORMAT) + +#define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_WRITABLE | PyBUF_FORMAT) +#define PyBUF_FULL_RO (PyBUF_INDIRECT | PyBUF_FORMAT) + + +#define PyBUF_READ 0x100 +#define PyBUF_WRITE 0x200 +/* End buffer interface */ + + +typedef struct { + /* Number implementations must check *both* + arguments for proper type and implement the necessary conversions + in the slot functions themselves. */ + + binaryfunc nb_add; + binaryfunc nb_subtract; + binaryfunc nb_multiply; + binaryfunc nb_remainder; + binaryfunc nb_divmod; + ternaryfunc nb_power; + unaryfunc nb_negative; + unaryfunc nb_positive; + unaryfunc nb_absolute; + inquiry nb_bool; + unaryfunc nb_invert; + binaryfunc nb_lshift; + binaryfunc nb_rshift; + binaryfunc nb_and; + binaryfunc nb_xor; + binaryfunc nb_or; + unaryfunc nb_int; + void *nb_reserved; /* the slot formerly known as nb_long */ + unaryfunc nb_float; + + binaryfunc nb_inplace_add; + binaryfunc nb_inplace_subtract; + binaryfunc nb_inplace_multiply; + binaryfunc nb_inplace_remainder; + ternaryfunc nb_inplace_power; + binaryfunc nb_inplace_lshift; + binaryfunc nb_inplace_rshift; + binaryfunc nb_inplace_and; + binaryfunc nb_inplace_xor; + binaryfunc nb_inplace_or; + + binaryfunc nb_floor_divide; + binaryfunc nb_true_divide; + binaryfunc nb_inplace_floor_divide; + binaryfunc nb_inplace_true_divide; + + unaryfunc nb_index; + + binaryfunc nb_matrix_multiply; + binaryfunc nb_inplace_matrix_multiply; +} PyNumberMethods; + +typedef struct { + lenfunc sq_length; + binaryfunc sq_concat; + ssizeargfunc sq_repeat; + ssizeargfunc sq_item; + void *was_sq_slice; + ssizeobjargproc sq_ass_item; + void *was_sq_ass_slice; + objobjproc sq_contains; + + binaryfunc sq_inplace_concat; + ssizeargfunc sq_inplace_repeat; +} PySequenceMethods; + +typedef struct { + lenfunc mp_length; + binaryfunc mp_subscript; + objobjargproc mp_ass_subscript; +} PyMappingMethods; + +typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; +} PyAsyncMethods; + +typedef struct { + getbufferproc bf_getbuffer; + releasebufferproc bf_releasebuffer; +} PyBufferProcs; + +/* We can't provide a full compile-time check that limited-API + users won't implement tp_print. However, not defining printfunc + and making tp_print of a different function pointer type + if Py_LIMITED_API is set should at least cause a warning + in most cases. */ +typedef int (*printfunc)(PyObject *, FILE *, int); + +typedef struct _typeobject { + PyObject_VAR_HEAD + const char *tp_name; /* For printing, in format "." */ + Py_ssize_t tp_basicsize, tp_itemsize; /* For allocation */ + + /* Methods to implement standard operations */ + + destructor tp_dealloc; + printfunc tp_print; + getattrfunc tp_getattr; + setattrfunc tp_setattr; + PyAsyncMethods *tp_as_async; /* formerly known as tp_compare (Python 2) + or tp_reserved (Python 3) */ + reprfunc tp_repr; + + /* Method suites for standard classes */ + + PyNumberMethods *tp_as_number; + PySequenceMethods *tp_as_sequence; + PyMappingMethods *tp_as_mapping; + + /* More standard operations (here for binary compatibility) */ + + hashfunc tp_hash; + ternaryfunc tp_call; + reprfunc tp_str; + getattrofunc tp_getattro; + setattrofunc tp_setattro; + + /* Functions to access object as input/output buffer */ + PyBufferProcs *tp_as_buffer; + + /* Flags to define presence of optional/expanded features */ + unsigned long tp_flags; + + const char *tp_doc; /* Documentation string */ + + /* Assigned meaning in release 2.0 */ + /* call function for all accessible objects */ + traverseproc tp_traverse; + + /* delete references to contained objects */ + inquiry tp_clear; + + /* Assigned meaning in release 2.1 */ + /* rich comparisons */ + richcmpfunc tp_richcompare; + + /* weak reference enabler */ + Py_ssize_t tp_weaklistoffset; + + /* Iterators */ + getiterfunc tp_iter; + iternextfunc tp_iternext; + + /* Attribute descriptor and subclassing stuff */ + struct PyMethodDef *tp_methods; + struct PyMemberDef *tp_members; + struct PyGetSetDef *tp_getset; + struct _typeobject *tp_base; + PyObject *tp_dict; + descrgetfunc tp_descr_get; + descrsetfunc tp_descr_set; + Py_ssize_t tp_dictoffset; + initproc tp_init; + allocfunc tp_alloc; + newfunc tp_new; + freefunc tp_free; /* Low-level free-memory routine */ + inquiry tp_is_gc; /* For PyObject_IS_GC */ + PyObject *tp_bases; + PyObject *tp_mro; /* method resolution order */ + PyObject *tp_cache; + PyObject *tp_subclasses; + PyObject *tp_weaklist; + destructor tp_del; + + /* Type attribute cache version tag. Added in version 2.6 */ + unsigned int tp_version_tag; + + destructor tp_finalize; + +#ifdef COUNT_ALLOCS + /* these must be last and never explicitly initialized */ + Py_ssize_t tp_allocs; + Py_ssize_t tp_frees; + Py_ssize_t tp_maxalloc; + struct _typeobject *tp_prev; + struct _typeobject *tp_next; +#endif +} PyTypeObject; + +/* The *real* layout of a type object when allocated on the heap */ +typedef struct _heaptypeobject { + /* Note: there's a dependency on the order of these members + in slotptr() in typeobject.c . */ + PyTypeObject ht_type; + PyAsyncMethods as_async; + PyNumberMethods as_number; + PyMappingMethods as_mapping; + PySequenceMethods as_sequence; /* as_sequence comes after as_mapping, + so that the mapping wins when both + the mapping and the sequence define + a given operator (e.g. __getitem__). + see add_operators() in typeobject.c . */ + PyBufferProcs as_buffer; + PyObject *ht_name, *ht_slots, *ht_qualname; + struct _dictkeysobject *ht_cached_keys; + /* here are optional user slots, followed by the members. */ +} PyHeapTypeObject; + +/* access macro to the members which are floating "behind" the object */ +#define PyHeapType_GET_MEMBERS(etype) \ + ((PyMemberDef *)(((char *)etype) + Py_TYPE(etype)->tp_basicsize)) + +PyAPI_FUNC(const char *) _PyType_Name(PyTypeObject *); +PyAPI_FUNC(PyObject *) _PyType_Lookup(PyTypeObject *, PyObject *); +PyAPI_FUNC(PyObject *) _PyType_LookupId(PyTypeObject *, _Py_Identifier *); +PyAPI_FUNC(PyObject *) _PyObject_LookupSpecial(PyObject *, _Py_Identifier *); +PyAPI_FUNC(PyTypeObject *) _PyType_CalculateMetaclass(PyTypeObject *, PyObject *); +PyAPI_FUNC(PyObject *) _PyType_GetDocFromInternalDoc(const char *, const char *); +PyAPI_FUNC(PyObject *) _PyType_GetTextSignatureFromInternalDoc(const char *, const char *); + +struct _Py_Identifier; +PyAPI_FUNC(int) PyObject_Print(PyObject *, FILE *, int); +PyAPI_FUNC(void) _Py_BreakPoint(void); +PyAPI_FUNC(void) _PyObject_Dump(PyObject *); +PyAPI_FUNC(int) _PyObject_IsFreed(PyObject *); + +PyAPI_FUNC(int) _PyObject_IsAbstract(PyObject *); +PyAPI_FUNC(PyObject *) _PyObject_GetAttrId(PyObject *, struct _Py_Identifier *); +PyAPI_FUNC(int) _PyObject_SetAttrId(PyObject *, struct _Py_Identifier *, PyObject *); +PyAPI_FUNC(int) _PyObject_HasAttrId(PyObject *, struct _Py_Identifier *); +/* Replacements of PyObject_GetAttr() and _PyObject_GetAttrId() which + don't raise AttributeError. + + Return 1 and set *result != NULL if an attribute is found. + Return 0 and set *result == NULL if an attribute is not found; + an AttributeError is silenced. + Return -1 and set *result == NULL if an error other than AttributeError + is raised. +*/ +PyAPI_FUNC(int) _PyObject_LookupAttr(PyObject *, PyObject *, PyObject **); +PyAPI_FUNC(int) _PyObject_LookupAttrId(PyObject *, struct _Py_Identifier *, PyObject **); +PyAPI_FUNC(PyObject **) _PyObject_GetDictPtr(PyObject *); +PyAPI_FUNC(PyObject *) _PyObject_NextNotImplemented(PyObject *); +PyAPI_FUNC(void) PyObject_CallFinalizer(PyObject *); +PyAPI_FUNC(int) PyObject_CallFinalizerFromDealloc(PyObject *); + +/* Same as PyObject_Generic{Get,Set}Attr, but passing the attributes + dict as the last parameter. */ +PyAPI_FUNC(PyObject *) +_PyObject_GenericGetAttrWithDict(PyObject *, PyObject *, PyObject *, int); +PyAPI_FUNC(int) +_PyObject_GenericSetAttrWithDict(PyObject *, PyObject *, + PyObject *, PyObject *); + +/* Helper to look up a builtin object */ +PyAPI_FUNC(PyObject *) _PyObject_GetBuiltin(const char *name); + +#define PyType_HasFeature(t,f) (((t)->tp_flags & (f)) != 0) + +static inline void _Py_Dealloc_inline(PyObject *op) +{ + destructor dealloc = Py_TYPE(op)->tp_dealloc; +#ifdef Py_TRACE_REFS + _Py_ForgetReference(op); +#else + _Py_INC_TPFREES(op); +#endif + (*dealloc)(op); +} +#define _Py_Dealloc(op) _Py_Dealloc_inline(op) + + +/* Safely decref `op` and set `op` to `op2`. + * + * As in case of Py_CLEAR "the obvious" code can be deadly: + * + * Py_DECREF(op); + * op = op2; + * + * The safe way is: + * + * Py_SETREF(op, op2); + * + * That arranges to set `op` to `op2` _before_ decref'ing, so that any code + * triggered as a side-effect of `op` getting torn down no longer believes + * `op` points to a valid object. + * + * Py_XSETREF is a variant of Py_SETREF that uses Py_XDECREF instead of + * Py_DECREF. + */ + +#define Py_SETREF(op, op2) \ + do { \ + PyObject *_py_tmp = _PyObject_CAST(op); \ + (op) = (op2); \ + Py_DECREF(_py_tmp); \ + } while (0) + +#define Py_XSETREF(op, op2) \ + do { \ + PyObject *_py_tmp = _PyObject_CAST(op); \ + (op) = (op2); \ + Py_XDECREF(_py_tmp); \ + } while (0) + + +PyAPI_DATA(PyTypeObject) _PyNone_Type; +PyAPI_DATA(PyTypeObject) _PyNotImplemented_Type; + +/* Maps Py_LT to Py_GT, ..., Py_GE to Py_LE. + * Defined in object.c. + */ +PyAPI_DATA(int) _Py_SwappedOp[]; + +/* This is the old private API, invoked by the macros before 3.2.4. + Kept for binary compatibility of extensions using the stable ABI. */ +PyAPI_FUNC(void) _PyTrash_deposit_object(PyObject*); +PyAPI_FUNC(void) _PyTrash_destroy_chain(void); + +PyAPI_FUNC(void) +_PyDebugAllocatorStats(FILE *out, const char *block_name, int num_blocks, + size_t sizeof_block); +PyAPI_FUNC(void) +_PyObject_DebugTypeStats(FILE *out); + +/* Define a pair of assertion macros: + _PyObject_ASSERT_FROM(), _PyObject_ASSERT_WITH_MSG() and _PyObject_ASSERT(). + + These work like the regular C assert(), in that they will abort the + process with a message on stderr if the given condition fails to hold, + but compile away to nothing if NDEBUG is defined. + + However, before aborting, Python will also try to call _PyObject_Dump() on + the given object. This may be of use when investigating bugs in which a + particular object is corrupt (e.g. buggy a tp_visit method in an extension + module breaking the garbage collector), to help locate the broken objects. + + The WITH_MSG variant allows you to supply an additional message that Python + will attempt to print to stderr, after the object dump. */ +#ifdef NDEBUG + /* No debugging: compile away the assertions: */ +# define _PyObject_ASSERT_FROM(obj, expr, msg, filename, lineno, func) \ + ((void)0) +#else + /* With debugging: generate checks: */ +# define _PyObject_ASSERT_FROM(obj, expr, msg, filename, lineno, func) \ + ((expr) \ + ? (void)(0) \ + : _PyObject_AssertFailed((obj), Py_STRINGIFY(expr), \ + (msg), (filename), (lineno), (func))) +#endif + +#define _PyObject_ASSERT_WITH_MSG(obj, expr, msg) \ + _PyObject_ASSERT_FROM(obj, expr, msg, __FILE__, __LINE__, __func__) +#define _PyObject_ASSERT(obj, expr) \ + _PyObject_ASSERT_WITH_MSG(obj, expr, NULL) + +#define _PyObject_ASSERT_FAILED_MSG(obj, msg) \ + _PyObject_AssertFailed((obj), NULL, (msg), __FILE__, __LINE__, __func__) + +/* Declare and define _PyObject_AssertFailed() even when NDEBUG is defined, + to avoid causing compiler/linker errors when building extensions without + NDEBUG against a Python built with NDEBUG defined. + + msg, expr and function can be NULL. */ +PyAPI_FUNC(void) _PyObject_AssertFailed( + PyObject *obj, + const char *expr, + const char *msg, + const char *file, + int line, + const char *function); + +#ifdef __cplusplus +} +#endif diff --git a/Include/object.h b/Include/object.h index cdcdca85c633..21c29e7bdb00 100644 --- a/Include/object.h +++ b/Include/object.h @@ -127,39 +127,6 @@ typedef struct { #define Py_TYPE(ob) (_PyObject_CAST(ob)->ob_type) #define Py_SIZE(ob) (_PyVarObject_CAST(ob)->ob_size) -#ifndef Py_LIMITED_API -/********************* String Literals ****************************************/ -/* This structure helps managing static strings. The basic usage goes like this: - Instead of doing - - r = PyObject_CallMethod(o, "foo", "args", ...); - - do - - _Py_IDENTIFIER(foo); - ... - r = _PyObject_CallMethodId(o, &PyId_foo, "args", ...); - - PyId_foo is a static variable, either on block level or file level. On first - usage, the string "foo" is interned, and the structures are linked. On interpreter - shutdown, all strings are released (through _PyUnicode_ClearStaticStrings). - - Alternatively, _Py_static_string allows choosing the variable name. - _PyUnicode_FromId returns a borrowed reference to the interned string. - _PyObject_{Get,Set,Has}AttrId are __getattr__ versions using _Py_Identifier*. -*/ -typedef struct _Py_Identifier { - struct _Py_Identifier *next; - const char* string; - PyObject *object; -} _Py_Identifier; - -#define _Py_static_string_init(value) { .next = NULL, .string = value, .object = NULL } -#define _Py_static_string(varname, value) static _Py_Identifier varname = _Py_static_string_init(value) -#define _Py_IDENTIFIER(varname) _Py_static_string(PyId_##varname, #varname) - -#endif /* !Py_LIMITED_API */ - /* Type objects contain a string containing the type name (to help somewhat in debugging), the allocation parameters (see PyObject_New() and @@ -186,154 +153,13 @@ typedef int(*ssizeobjargproc)(PyObject *, Py_ssize_t, PyObject *); typedef int(*ssizessizeobjargproc)(PyObject *, Py_ssize_t, Py_ssize_t, PyObject *); typedef int(*objobjargproc)(PyObject *, PyObject *, PyObject *); -#ifndef Py_LIMITED_API -/* buffer interface */ -typedef struct bufferinfo { - void *buf; - PyObject *obj; /* owned reference */ - Py_ssize_t len; - Py_ssize_t itemsize; /* This is Py_ssize_t so it can be - pointed to by strides in simple case.*/ - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; -} Py_buffer; - -typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); -typedef void (*releasebufferproc)(PyObject *, Py_buffer *); - -/* Maximum number of dimensions */ -#define PyBUF_MAX_NDIM 64 - -/* Flags for getting buffers */ -#define PyBUF_SIMPLE 0 -#define PyBUF_WRITABLE 0x0001 -/* we used to include an E, backwards compatible alias */ -#define PyBUF_WRITEABLE PyBUF_WRITABLE -#define PyBUF_FORMAT 0x0004 -#define PyBUF_ND 0x0008 -#define PyBUF_STRIDES (0x0010 | PyBUF_ND) -#define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) -#define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) -#define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) -#define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) - -#define PyBUF_CONTIG (PyBUF_ND | PyBUF_WRITABLE) -#define PyBUF_CONTIG_RO (PyBUF_ND) - -#define PyBUF_STRIDED (PyBUF_STRIDES | PyBUF_WRITABLE) -#define PyBUF_STRIDED_RO (PyBUF_STRIDES) - -#define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_WRITABLE | PyBUF_FORMAT) -#define PyBUF_RECORDS_RO (PyBUF_STRIDES | PyBUF_FORMAT) - -#define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_WRITABLE | PyBUF_FORMAT) -#define PyBUF_FULL_RO (PyBUF_INDIRECT | PyBUF_FORMAT) - - -#define PyBUF_READ 0x100 -#define PyBUF_WRITE 0x200 - -/* End buffer interface */ -#endif /* Py_LIMITED_API */ - typedef int (*objobjproc)(PyObject *, PyObject *); typedef int (*visitproc)(PyObject *, void *); typedef int (*traverseproc)(PyObject *, visitproc, void *); -#ifndef Py_LIMITED_API -typedef struct { - /* Number implementations must check *both* - arguments for proper type and implement the necessary conversions - in the slot functions themselves. */ - - binaryfunc nb_add; - binaryfunc nb_subtract; - binaryfunc nb_multiply; - binaryfunc nb_remainder; - binaryfunc nb_divmod; - ternaryfunc nb_power; - unaryfunc nb_negative; - unaryfunc nb_positive; - unaryfunc nb_absolute; - inquiry nb_bool; - unaryfunc nb_invert; - binaryfunc nb_lshift; - binaryfunc nb_rshift; - binaryfunc nb_and; - binaryfunc nb_xor; - binaryfunc nb_or; - unaryfunc nb_int; - void *nb_reserved; /* the slot formerly known as nb_long */ - unaryfunc nb_float; - - binaryfunc nb_inplace_add; - binaryfunc nb_inplace_subtract; - binaryfunc nb_inplace_multiply; - binaryfunc nb_inplace_remainder; - ternaryfunc nb_inplace_power; - binaryfunc nb_inplace_lshift; - binaryfunc nb_inplace_rshift; - binaryfunc nb_inplace_and; - binaryfunc nb_inplace_xor; - binaryfunc nb_inplace_or; - - binaryfunc nb_floor_divide; - binaryfunc nb_true_divide; - binaryfunc nb_inplace_floor_divide; - binaryfunc nb_inplace_true_divide; - - unaryfunc nb_index; - - binaryfunc nb_matrix_multiply; - binaryfunc nb_inplace_matrix_multiply; -} PyNumberMethods; - -typedef struct { - lenfunc sq_length; - binaryfunc sq_concat; - ssizeargfunc sq_repeat; - ssizeargfunc sq_item; - void *was_sq_slice; - ssizeobjargproc sq_ass_item; - void *was_sq_ass_slice; - objobjproc sq_contains; - - binaryfunc sq_inplace_concat; - ssizeargfunc sq_inplace_repeat; -} PySequenceMethods; - -typedef struct { - lenfunc mp_length; - binaryfunc mp_subscript; - objobjargproc mp_ass_subscript; -} PyMappingMethods; - -typedef struct { - unaryfunc am_await; - unaryfunc am_aiter; - unaryfunc am_anext; -} PyAsyncMethods; - -typedef struct { - getbufferproc bf_getbuffer; - releasebufferproc bf_releasebuffer; -} PyBufferProcs; -#endif /* Py_LIMITED_API */ typedef void (*freefunc)(void *); typedef void (*destructor)(PyObject *); -#ifndef Py_LIMITED_API -/* We can't provide a full compile-time check that limited-API - users won't implement tp_print. However, not defining printfunc - and making tp_print of a different function pointer type - should at least cause a warning in most cases. */ -typedef int (*printfunc)(PyObject *, FILE *, int); -#endif typedef PyObject *(*getattrfunc)(PyObject *, char *); typedef PyObject *(*getattrofunc)(PyObject *, PyObject *); typedef int (*setattrfunc)(PyObject *, char *, PyObject *); @@ -349,100 +175,8 @@ typedef int (*initproc)(PyObject *, PyObject *, PyObject *); typedef PyObject *(*newfunc)(struct _typeobject *, PyObject *, PyObject *); typedef PyObject *(*allocfunc)(struct _typeobject *, Py_ssize_t); -#ifdef Py_LIMITED_API -typedef struct _typeobject PyTypeObject; /* opaque */ -#else -typedef struct _typeobject { - PyObject_VAR_HEAD - const char *tp_name; /* For printing, in format "." */ - Py_ssize_t tp_basicsize, tp_itemsize; /* For allocation */ - - /* Methods to implement standard operations */ - - destructor tp_dealloc; - printfunc tp_print; - getattrfunc tp_getattr; - setattrfunc tp_setattr; - PyAsyncMethods *tp_as_async; /* formerly known as tp_compare (Python 2) - or tp_reserved (Python 3) */ - reprfunc tp_repr; - - /* Method suites for standard classes */ - - PyNumberMethods *tp_as_number; - PySequenceMethods *tp_as_sequence; - PyMappingMethods *tp_as_mapping; - - /* More standard operations (here for binary compatibility) */ - - hashfunc tp_hash; - ternaryfunc tp_call; - reprfunc tp_str; - getattrofunc tp_getattro; - setattrofunc tp_setattro; - - /* Functions to access object as input/output buffer */ - PyBufferProcs *tp_as_buffer; - - /* Flags to define presence of optional/expanded features */ - unsigned long tp_flags; - - const char *tp_doc; /* Documentation string */ - - /* Assigned meaning in release 2.0 */ - /* call function for all accessible objects */ - traverseproc tp_traverse; - - /* delete references to contained objects */ - inquiry tp_clear; - - /* Assigned meaning in release 2.1 */ - /* rich comparisons */ - richcmpfunc tp_richcompare; - - /* weak reference enabler */ - Py_ssize_t tp_weaklistoffset; - - /* Iterators */ - getiterfunc tp_iter; - iternextfunc tp_iternext; - - /* Attribute descriptor and subclassing stuff */ - struct PyMethodDef *tp_methods; - struct PyMemberDef *tp_members; - struct PyGetSetDef *tp_getset; - struct _typeobject *tp_base; - PyObject *tp_dict; - descrgetfunc tp_descr_get; - descrsetfunc tp_descr_set; - Py_ssize_t tp_dictoffset; - initproc tp_init; - allocfunc tp_alloc; - newfunc tp_new; - freefunc tp_free; /* Low-level free-memory routine */ - inquiry tp_is_gc; /* For PyObject_IS_GC */ - PyObject *tp_bases; - PyObject *tp_mro; /* method resolution order */ - PyObject *tp_cache; - PyObject *tp_subclasses; - PyObject *tp_weaklist; - destructor tp_del; - - /* Type attribute cache version tag. Added in version 2.6 */ - unsigned int tp_version_tag; - - destructor tp_finalize; - -#ifdef COUNT_ALLOCS - /* these must be last and never explicitly initialized */ - Py_ssize_t tp_allocs; - Py_ssize_t tp_frees; - Py_ssize_t tp_maxalloc; - struct _typeobject *tp_prev; - struct _typeobject *tp_next; -#endif -} PyTypeObject; -#endif +/* In Py_LIMITED_API, PyTypeObject is an opaque structure. */ +typedef struct _typeobject PyTypeObject; typedef struct{ int slot; /* slot id, see below */ @@ -465,31 +199,6 @@ PyAPI_FUNC(PyObject*) PyType_FromSpecWithBases(PyType_Spec*, PyObject*); PyAPI_FUNC(void*) PyType_GetSlot(PyTypeObject*, int); #endif -#ifndef Py_LIMITED_API -/* The *real* layout of a type object when allocated on the heap */ -typedef struct _heaptypeobject { - /* Note: there's a dependency on the order of these members - in slotptr() in typeobject.c . */ - PyTypeObject ht_type; - PyAsyncMethods as_async; - PyNumberMethods as_number; - PyMappingMethods as_mapping; - PySequenceMethods as_sequence; /* as_sequence comes after as_mapping, - so that the mapping wins when both - the mapping and the sequence define - a given operator (e.g. __getitem__). - see add_operators() in typeobject.c . */ - PyBufferProcs as_buffer; - PyObject *ht_name, *ht_slots, *ht_qualname; - struct _dictkeysobject *ht_cached_keys; - /* here are optional user slots, followed by the members. */ -} PyHeapTypeObject; - -/* access macro to the members which are floating "behind" the object */ -#define PyHeapType_GET_MEMBERS(etype) \ - ((PyMemberDef *)(((char *)etype) + Py_TYPE(etype)->tp_basicsize)) -#endif - /* Generic type check */ PyAPI_FUNC(int) PyType_IsSubtype(PyTypeObject *, PyTypeObject *); #define PyObject_TypeCheck(ob, tp) \ @@ -509,29 +218,10 @@ PyAPI_FUNC(int) PyType_Ready(PyTypeObject *); PyAPI_FUNC(PyObject *) PyType_GenericAlloc(PyTypeObject *, Py_ssize_t); PyAPI_FUNC(PyObject *) PyType_GenericNew(PyTypeObject *, PyObject *, PyObject *); -#ifndef Py_LIMITED_API -PyAPI_FUNC(const char *) _PyType_Name(PyTypeObject *); -PyAPI_FUNC(PyObject *) _PyType_Lookup(PyTypeObject *, PyObject *); -PyAPI_FUNC(PyObject *) _PyType_LookupId(PyTypeObject *, _Py_Identifier *); -PyAPI_FUNC(PyObject *) _PyObject_LookupSpecial(PyObject *, _Py_Identifier *); -PyAPI_FUNC(PyTypeObject *) _PyType_CalculateMetaclass(PyTypeObject *, PyObject *); -#endif PyAPI_FUNC(unsigned int) PyType_ClearCache(void); PyAPI_FUNC(void) PyType_Modified(PyTypeObject *); -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject *) _PyType_GetDocFromInternalDoc(const char *, const char *); -PyAPI_FUNC(PyObject *) _PyType_GetTextSignatureFromInternalDoc(const char *, const char *); -#endif - /* Generic operations on objects */ -#ifndef Py_LIMITED_API -struct _Py_Identifier; -PyAPI_FUNC(int) PyObject_Print(PyObject *, FILE *, int); -PyAPI_FUNC(void) _Py_BreakPoint(void); -PyAPI_FUNC(void) _PyObject_Dump(PyObject *); -PyAPI_FUNC(int) _PyObject_IsFreed(PyObject *); -#endif PyAPI_FUNC(PyObject *) PyObject_Repr(PyObject *); PyAPI_FUNC(PyObject *) PyObject_Str(PyObject *); PyAPI_FUNC(PyObject *) PyObject_ASCII(PyObject *); @@ -544,28 +234,7 @@ PyAPI_FUNC(int) PyObject_HasAttrString(PyObject *, const char *); PyAPI_FUNC(PyObject *) PyObject_GetAttr(PyObject *, PyObject *); PyAPI_FUNC(int) PyObject_SetAttr(PyObject *, PyObject *, PyObject *); PyAPI_FUNC(int) PyObject_HasAttr(PyObject *, PyObject *); -#ifndef Py_LIMITED_API -PyAPI_FUNC(int) _PyObject_IsAbstract(PyObject *); -PyAPI_FUNC(PyObject *) _PyObject_GetAttrId(PyObject *, struct _Py_Identifier *); -PyAPI_FUNC(int) _PyObject_SetAttrId(PyObject *, struct _Py_Identifier *, PyObject *); -PyAPI_FUNC(int) _PyObject_HasAttrId(PyObject *, struct _Py_Identifier *); -/* Replacements of PyObject_GetAttr() and _PyObject_GetAttrId() which - don't raise AttributeError. - - Return 1 and set *result != NULL if an attribute is found. - Return 0 and set *result == NULL if an attribute is not found; - an AttributeError is silenced. - Return -1 and set *result == NULL if an error other than AttributeError - is raised. -*/ -PyAPI_FUNC(int) _PyObject_LookupAttr(PyObject *, PyObject *, PyObject **); -PyAPI_FUNC(int) _PyObject_LookupAttrId(PyObject *, struct _Py_Identifier *, PyObject **); -PyAPI_FUNC(PyObject **) _PyObject_GetDictPtr(PyObject *); -#endif PyAPI_FUNC(PyObject *) PyObject_SelfIter(PyObject *); -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject *) _PyObject_NextNotImplemented(PyObject *); -#endif PyAPI_FUNC(PyObject *) PyObject_GenericGetAttr(PyObject *, PyObject *); PyAPI_FUNC(int) PyObject_GenericSetAttr(PyObject *, PyObject *, PyObject *); @@ -577,28 +246,7 @@ PyAPI_FUNC(Py_hash_t) PyObject_HashNotImplemented(PyObject *); PyAPI_FUNC(int) PyObject_IsTrue(PyObject *); PyAPI_FUNC(int) PyObject_Not(PyObject *); PyAPI_FUNC(int) PyCallable_Check(PyObject *); - PyAPI_FUNC(void) PyObject_ClearWeakRefs(PyObject *); -#ifndef Py_LIMITED_API -PyAPI_FUNC(void) PyObject_CallFinalizer(PyObject *); -PyAPI_FUNC(int) PyObject_CallFinalizerFromDealloc(PyObject *); -#endif - -#ifndef Py_LIMITED_API -/* Same as PyObject_Generic{Get,Set}Attr, but passing the attributes - dict as the last parameter. */ -PyAPI_FUNC(PyObject *) -_PyObject_GenericGetAttrWithDict(PyObject *, PyObject *, PyObject *, int); -PyAPI_FUNC(int) -_PyObject_GenericSetAttrWithDict(PyObject *, PyObject *, - PyObject *, PyObject *); -#endif /* !Py_LIMITED_API */ - -/* Helper to look up a builtin object */ -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject *) -_PyObject_GetBuiltin(const char *name); -#endif /* PyObject_Dir(obj) acts like Python builtins.dir(obj), returning a list of strings. PyObject_Dir(NULL) is like builtins.dir(), @@ -689,9 +337,7 @@ given type object has a specified feature. #define Py_TPFLAGS_HAVE_FINALIZE (1UL << 0) #ifdef Py_LIMITED_API -#define PyType_HasFeature(t,f) ((PyType_GetFlags(t) & (f)) != 0) -#else -#define PyType_HasFeature(t,f) (((t)->tp_flags & (f)) != 0) +# define PyType_HasFeature(t,f) ((PyType_GetFlags(t) & (f)) != 0) #endif #define PyType_FastSubclass(t,f) PyType_HasFeature(t,f) @@ -775,7 +421,6 @@ PyAPI_FUNC(void) _Py_ForgetReference(PyObject *); PyAPI_FUNC(void) _Py_PrintReferences(FILE *); PyAPI_FUNC(void) _Py_PrintReferenceAddresses(FILE *); PyAPI_FUNC(void) _Py_AddToAllObjects(PyObject *, int force); - #else /* Without Py_TRACE_REFS, there's little enough to do that we expand code inline. */ @@ -798,22 +443,6 @@ static inline void _Py_ForgetReference(PyObject *op) PyAPI_FUNC(void) _Py_Dealloc(PyObject *); -#ifndef Py_LIMITED_API -static inline void _Py_Dealloc_inline(PyObject *op) -{ - destructor dealloc = Py_TYPE(op)->tp_dealloc; -#ifdef Py_TRACE_REFS - _Py_ForgetReference(op); -#else - _Py_INC_TPFREES(op); -#endif - (*dealloc)(op); -} - -# define _Py_Dealloc(op) _Py_Dealloc_inline(op) -#endif /* !defined(Py_LIMITED_API) */ - - static inline void _Py_INCREF(PyObject *op) { _Py_INC_REFTOTAL; @@ -903,42 +532,6 @@ static inline void _Py_XDECREF(PyObject *op) #define Py_XDECREF(op) _Py_XDECREF(_PyObject_CAST(op)) -#ifndef Py_LIMITED_API -/* Safely decref `op` and set `op` to `op2`. - * - * As in case of Py_CLEAR "the obvious" code can be deadly: - * - * Py_DECREF(op); - * op = op2; - * - * The safe way is: - * - * Py_SETREF(op, op2); - * - * That arranges to set `op` to `op2` _before_ decref'ing, so that any code - * triggered as a side-effect of `op` getting torn down no longer believes - * `op` points to a valid object. - * - * Py_XSETREF is a variant of Py_SETREF that uses Py_XDECREF instead of - * Py_DECREF. - */ - -#define Py_SETREF(op, op2) \ - do { \ - PyObject *_py_tmp = _PyObject_CAST(op); \ - (op) = (op2); \ - Py_DECREF(_py_tmp); \ - } while (0) - -#define Py_XSETREF(op, op2) \ - do { \ - PyObject *_py_tmp = _PyObject_CAST(op); \ - (op) = (op2); \ - Py_XDECREF(_py_tmp); \ - } while (0) - -#endif /* ifndef Py_LIMITED_API */ - /* These are provided as conveniences to Python runtime embedders, so that they can have object code that is not dependent on Python compilation flags. @@ -946,11 +539,6 @@ they can have object code that is not dependent on Python compilation flags. PyAPI_FUNC(void) Py_IncRef(PyObject *); PyAPI_FUNC(void) Py_DecRef(PyObject *); -#ifndef Py_LIMITED_API -PyAPI_DATA(PyTypeObject) _PyNone_Type; -PyAPI_DATA(PyTypeObject) _PyNotImplemented_Type; -#endif /* !Py_LIMITED_API */ - /* _Py_NoneStruct is an object of undefined type which can be used in contexts where NULL (nil) is not suitable (since NULL often means 'error'). @@ -1001,13 +589,6 @@ PyAPI_DATA(PyObject) _Py_NotImplementedStruct; /* Don't use this directly */ } \ } while (0) -#ifndef Py_LIMITED_API -/* Maps Py_LT to Py_GT, ..., Py_GE to Py_LE. - * Defined in object.c. - */ -PyAPI_DATA(int) _Py_SwappedOp[]; -#endif /* !Py_LIMITED_API */ - /* More conventions @@ -1103,13 +684,6 @@ chain of N deallocations is broken into (N-1)/(PyTrash_UNWIND_LEVEL-1) pieces, with the call stack never exceeding a depth of PyTrash_UNWIND_LEVEL. */ -#ifndef Py_LIMITED_API -/* This is the old private API, invoked by the macros before 3.2.4. - Kept for binary compatibility of extensions using the stable ABI. */ -PyAPI_FUNC(void) _PyTrash_deposit_object(PyObject*); -PyAPI_FUNC(void) _PyTrash_destroy_chain(void); -#endif /* !Py_LIMITED_API */ - /* The new thread-safe private API, invoked by the macros below. */ PyAPI_FUNC(void) _PyTrash_thread_deposit_object(PyObject*); PyAPI_FUNC(void) _PyTrash_thread_destroy_chain(void); @@ -1131,66 +705,13 @@ PyAPI_FUNC(void) _PyTrash_thread_destroy_chain(void); _PyTrash_thread_deposit_object(_PyObject_CAST(op)); \ } while (0); -#ifndef Py_LIMITED_API -PyAPI_FUNC(void) -_PyDebugAllocatorStats(FILE *out, const char *block_name, int num_blocks, - size_t sizeof_block); -PyAPI_FUNC(void) -_PyObject_DebugTypeStats(FILE *out); -#endif /* ifndef Py_LIMITED_API */ - #ifndef Py_LIMITED_API -/* Define a pair of assertion macros: - _PyObject_ASSERT_FROM(), _PyObject_ASSERT_WITH_MSG() and _PyObject_ASSERT(). - - These work like the regular C assert(), in that they will abort the - process with a message on stderr if the given condition fails to hold, - but compile away to nothing if NDEBUG is defined. - - However, before aborting, Python will also try to call _PyObject_Dump() on - the given object. This may be of use when investigating bugs in which a - particular object is corrupt (e.g. buggy a tp_visit method in an extension - module breaking the garbage collector), to help locate the broken objects. - - The WITH_MSG variant allows you to supply an additional message that Python - will attempt to print to stderr, after the object dump. */ -#ifdef NDEBUG - /* No debugging: compile away the assertions: */ -# define _PyObject_ASSERT_FROM(obj, expr, msg, filename, lineno, func) \ - ((void)0) -#else - /* With debugging: generate checks: */ -# define _PyObject_ASSERT_FROM(obj, expr, msg, filename, lineno, func) \ - ((expr) \ - ? (void)(0) \ - : _PyObject_AssertFailed((obj), Py_STRINGIFY(expr), \ - (msg), (filename), (lineno), (func))) +# define Py_CPYTHON_OBJECT_H +# include "cpython/object.h" +# undef Py_CPYTHON_OBJECT_H #endif -#define _PyObject_ASSERT_WITH_MSG(obj, expr, msg) \ - _PyObject_ASSERT_FROM(obj, expr, msg, __FILE__, __LINE__, __func__) -#define _PyObject_ASSERT(obj, expr) \ - _PyObject_ASSERT_WITH_MSG(obj, expr, NULL) - -#define _PyObject_ASSERT_FAILED_MSG(obj, msg) \ - _PyObject_AssertFailed((obj), NULL, (msg), __FILE__, __LINE__, __func__) - -/* Declare and define _PyObject_AssertFailed() even when NDEBUG is defined, - to avoid causing compiler/linker errors when building extensions without - NDEBUG against a Python built with NDEBUG defined. - - msg, expr and function can be NULL. */ -PyAPI_FUNC(void) _PyObject_AssertFailed( - PyObject *obj, - const char *expr, - const char *msg, - const char *file, - int line, - const char *function); -#endif /* ifndef Py_LIMITED_API */ - - #ifdef __cplusplus } #endif From webhook-mailer at python.org Mon Nov 26 11:13:44 2018 From: webhook-mailer at python.org (Julien Palard) Date: Mon, 26 Nov 2018 16:13:44 -0000 Subject: [Python-checkins] Doc: Delete now useless Windows FAQ section (GH-10557) Message-ID: https://github.com/python/cpython/commit/5719f275b7153a00a800f5481271a6fc26659c65 commit: 5719f275b7153a00a800f5481271a6fc26659c65 branch: master author: Mathieu Dupuy committer: Julien Palard date: 2018-11-26T17:13:41+01:00 summary: Doc: Delete now useless Windows FAQ section (GH-10557) files: M Doc/faq/windows.rst diff --git a/Doc/faq/windows.rst b/Doc/faq/windows.rst index 74aa52ab1a49..75ebe603cb5b 100644 --- a/Doc/faq/windows.rst +++ b/Doc/faq/windows.rst @@ -281,14 +281,3 @@ Use the msvcrt module. This is a standard Windows-specific extension module. It defines a function ``kbhit()`` which checks whether a keyboard hit is present, and ``getch()`` which gets one character without echoing it. - -How do I extract the downloaded documentation on Windows? ---------------------------------------------------------- - -Sometimes, when you download the documentation package to a Windows machine -using a web browser, the file extension of the saved file ends up being .EXE. -This is a mistake; the extension should be .TGZ. - -Simply rename the downloaded file to have the .TGZ extension, and WinZip will be -able to handle it. (If your copy of WinZip doesn't, get a newer one from -https://www.winzip.com.) From webhook-mailer at python.org Mon Nov 26 11:29:41 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 26 Nov 2018 16:29:41 -0000 Subject: [Python-checkins] bpo-35134: Create Include/cpython/unicodeobject.h (GH-10680) Message-ID: https://github.com/python/cpython/commit/75e4699b31d1d88abad097ad13466c5c07711324 commit: 75e4699b31d1d88abad097ad13466c5c07711324 branch: master author: Victor Stinner committer: GitHub date: 2018-11-26T17:29:38+01:00 summary: bpo-35134: Create Include/cpython/unicodeobject.h (GH-10680) Move unicodeobject.h code surrounded by "#ifndef Py_LIMITED_API" to a new Include/cpython/unicodeobject.h header file. files: A Include/cpython/unicodeobject.h M Include/unicodeobject.h diff --git a/Include/cpython/unicodeobject.h b/Include/cpython/unicodeobject.h new file mode 100644 index 000000000000..c76349022485 --- /dev/null +++ b/Include/cpython/unicodeobject.h @@ -0,0 +1,1245 @@ +#ifndef Py_CPYTHON_UNICODEOBJECT_H +# error "this header file must not be included directly" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* Py_UNICODE was the native Unicode storage format (code unit) used by + Python and represents a single Unicode element in the Unicode type. + With PEP 393, Py_UNICODE is deprecated and replaced with a + typedef to wchar_t. */ +#define PY_UNICODE_TYPE wchar_t +typedef wchar_t Py_UNICODE /* Py_DEPRECATED(3.3) */; + +/* --- Internal Unicode Operations ---------------------------------------- */ + +/* Since splitting on whitespace is an important use case, and + whitespace in most situations is solely ASCII whitespace, we + optimize for the common case by using a quick look-up table + _Py_ascii_whitespace (see below) with an inlined check. + + */ +#define Py_UNICODE_ISSPACE(ch) \ + ((ch) < 128U ? _Py_ascii_whitespace[(ch)] : _PyUnicode_IsWhitespace(ch)) + +#define Py_UNICODE_ISLOWER(ch) _PyUnicode_IsLowercase(ch) +#define Py_UNICODE_ISUPPER(ch) _PyUnicode_IsUppercase(ch) +#define Py_UNICODE_ISTITLE(ch) _PyUnicode_IsTitlecase(ch) +#define Py_UNICODE_ISLINEBREAK(ch) _PyUnicode_IsLinebreak(ch) + +#define Py_UNICODE_TOLOWER(ch) _PyUnicode_ToLowercase(ch) +#define Py_UNICODE_TOUPPER(ch) _PyUnicode_ToUppercase(ch) +#define Py_UNICODE_TOTITLE(ch) _PyUnicode_ToTitlecase(ch) + +#define Py_UNICODE_ISDECIMAL(ch) _PyUnicode_IsDecimalDigit(ch) +#define Py_UNICODE_ISDIGIT(ch) _PyUnicode_IsDigit(ch) +#define Py_UNICODE_ISNUMERIC(ch) _PyUnicode_IsNumeric(ch) +#define Py_UNICODE_ISPRINTABLE(ch) _PyUnicode_IsPrintable(ch) + +#define Py_UNICODE_TODECIMAL(ch) _PyUnicode_ToDecimalDigit(ch) +#define Py_UNICODE_TODIGIT(ch) _PyUnicode_ToDigit(ch) +#define Py_UNICODE_TONUMERIC(ch) _PyUnicode_ToNumeric(ch) + +#define Py_UNICODE_ISALPHA(ch) _PyUnicode_IsAlpha(ch) + +#define Py_UNICODE_ISALNUM(ch) \ + (Py_UNICODE_ISALPHA(ch) || \ + Py_UNICODE_ISDECIMAL(ch) || \ + Py_UNICODE_ISDIGIT(ch) || \ + Py_UNICODE_ISNUMERIC(ch)) + +#define Py_UNICODE_COPY(target, source, length) \ + memcpy((target), (source), (length)*sizeof(Py_UNICODE)) + +#define Py_UNICODE_FILL(target, value, length) \ + do {Py_ssize_t i_; Py_UNICODE *t_ = (target); Py_UNICODE v_ = (value);\ + for (i_ = 0; i_ < (length); i_++) t_[i_] = v_;\ + } while (0) + +/* macros to work with surrogates */ +#define Py_UNICODE_IS_SURROGATE(ch) (0xD800 <= (ch) && (ch) <= 0xDFFF) +#define Py_UNICODE_IS_HIGH_SURROGATE(ch) (0xD800 <= (ch) && (ch) <= 0xDBFF) +#define Py_UNICODE_IS_LOW_SURROGATE(ch) (0xDC00 <= (ch) && (ch) <= 0xDFFF) +/* Join two surrogate characters and return a single Py_UCS4 value. */ +#define Py_UNICODE_JOIN_SURROGATES(high, low) \ + (((((Py_UCS4)(high) & 0x03FF) << 10) | \ + ((Py_UCS4)(low) & 0x03FF)) + 0x10000) +/* high surrogate = top 10 bits added to D800 */ +#define Py_UNICODE_HIGH_SURROGATE(ch) (0xD800 - (0x10000 >> 10) + ((ch) >> 10)) +/* low surrogate = bottom 10 bits added to DC00 */ +#define Py_UNICODE_LOW_SURROGATE(ch) (0xDC00 + ((ch) & 0x3FF)) + +/* Check if substring matches at given offset. The offset must be + valid, and the substring must not be empty. */ + +#define Py_UNICODE_MATCH(string, offset, substring) \ + ((*((string)->wstr + (offset)) == *((substring)->wstr)) && \ + ((*((string)->wstr + (offset) + (substring)->wstr_length-1) == *((substring)->wstr + (substring)->wstr_length-1))) && \ + !memcmp((string)->wstr + (offset), (substring)->wstr, (substring)->wstr_length*sizeof(Py_UNICODE))) + +/* --- Unicode Type ------------------------------------------------------- */ + +/* ASCII-only strings created through PyUnicode_New use the PyASCIIObject + structure. state.ascii and state.compact are set, and the data + immediately follow the structure. utf8_length and wstr_length can be found + in the length field; the utf8 pointer is equal to the data pointer. */ +typedef struct { + /* There are 4 forms of Unicode strings: + + - compact ascii: + + * structure = PyASCIIObject + * test: PyUnicode_IS_COMPACT_ASCII(op) + * kind = PyUnicode_1BYTE_KIND + * compact = 1 + * ascii = 1 + * ready = 1 + * (length is the length of the utf8 and wstr strings) + * (data starts just after the structure) + * (since ASCII is decoded from UTF-8, the utf8 string are the data) + + - compact: + + * structure = PyCompactUnicodeObject + * test: PyUnicode_IS_COMPACT(op) && !PyUnicode_IS_ASCII(op) + * kind = PyUnicode_1BYTE_KIND, PyUnicode_2BYTE_KIND or + PyUnicode_4BYTE_KIND + * compact = 1 + * ready = 1 + * ascii = 0 + * utf8 is not shared with data + * utf8_length = 0 if utf8 is NULL + * wstr is shared with data and wstr_length=length + if kind=PyUnicode_2BYTE_KIND and sizeof(wchar_t)=2 + or if kind=PyUnicode_4BYTE_KIND and sizeof(wchar_t)=4 + * wstr_length = 0 if wstr is NULL + * (data starts just after the structure) + + - legacy string, not ready: + + * structure = PyUnicodeObject + * test: kind == PyUnicode_WCHAR_KIND + * length = 0 (use wstr_length) + * hash = -1 + * kind = PyUnicode_WCHAR_KIND + * compact = 0 + * ascii = 0 + * ready = 0 + * interned = SSTATE_NOT_INTERNED + * wstr is not NULL + * data.any is NULL + * utf8 is NULL + * utf8_length = 0 + + - legacy string, ready: + + * structure = PyUnicodeObject structure + * test: !PyUnicode_IS_COMPACT(op) && kind != PyUnicode_WCHAR_KIND + * kind = PyUnicode_1BYTE_KIND, PyUnicode_2BYTE_KIND or + PyUnicode_4BYTE_KIND + * compact = 0 + * ready = 1 + * data.any is not NULL + * utf8 is shared and utf8_length = length with data.any if ascii = 1 + * utf8_length = 0 if utf8 is NULL + * wstr is shared with data.any and wstr_length = length + if kind=PyUnicode_2BYTE_KIND and sizeof(wchar_t)=2 + or if kind=PyUnicode_4BYTE_KIND and sizeof(wchar_4)=4 + * wstr_length = 0 if wstr is NULL + + Compact strings use only one memory block (structure + characters), + whereas legacy strings use one block for the structure and one block + for characters. + + Legacy strings are created by PyUnicode_FromUnicode() and + PyUnicode_FromStringAndSize(NULL, size) functions. They become ready + when PyUnicode_READY() is called. + + See also _PyUnicode_CheckConsistency(). + */ + PyObject_HEAD + Py_ssize_t length; /* Number of code points in the string */ + Py_hash_t hash; /* Hash value; -1 if not set */ + struct { + /* + SSTATE_NOT_INTERNED (0) + SSTATE_INTERNED_MORTAL (1) + SSTATE_INTERNED_IMMORTAL (2) + + If interned != SSTATE_NOT_INTERNED, the two references from the + dictionary to this object are *not* counted in ob_refcnt. + */ + unsigned int interned:2; + /* Character size: + + - PyUnicode_WCHAR_KIND (0): + + * character type = wchar_t (16 or 32 bits, depending on the + platform) + + - PyUnicode_1BYTE_KIND (1): + + * character type = Py_UCS1 (8 bits, unsigned) + * all characters are in the range U+0000-U+00FF (latin1) + * if ascii is set, all characters are in the range U+0000-U+007F + (ASCII), otherwise at least one character is in the range + U+0080-U+00FF + + - PyUnicode_2BYTE_KIND (2): + + * character type = Py_UCS2 (16 bits, unsigned) + * all characters are in the range U+0000-U+FFFF (BMP) + * at least one character is in the range U+0100-U+FFFF + + - PyUnicode_4BYTE_KIND (4): + + * character type = Py_UCS4 (32 bits, unsigned) + * all characters are in the range U+0000-U+10FFFF + * at least one character is in the range U+10000-U+10FFFF + */ + unsigned int kind:3; + /* Compact is with respect to the allocation scheme. Compact unicode + objects only require one memory block while non-compact objects use + one block for the PyUnicodeObject struct and another for its data + buffer. */ + unsigned int compact:1; + /* The string only contains characters in the range U+0000-U+007F (ASCII) + and the kind is PyUnicode_1BYTE_KIND. If ascii is set and compact is + set, use the PyASCIIObject structure. */ + unsigned int ascii:1; + /* The ready flag indicates whether the object layout is initialized + completely. This means that this is either a compact object, or + the data pointer is filled out. The bit is redundant, and helps + to minimize the test in PyUnicode_IS_READY(). */ + unsigned int ready:1; + /* Padding to ensure that PyUnicode_DATA() is always aligned to + 4 bytes (see issue #19537 on m68k). */ + unsigned int :24; + } state; + wchar_t *wstr; /* wchar_t representation (null-terminated) */ +} PyASCIIObject; + +/* Non-ASCII strings allocated through PyUnicode_New use the + PyCompactUnicodeObject structure. state.compact is set, and the data + immediately follow the structure. */ +typedef struct { + PyASCIIObject _base; + Py_ssize_t utf8_length; /* Number of bytes in utf8, excluding the + * terminating \0. */ + char *utf8; /* UTF-8 representation (null-terminated) */ + Py_ssize_t wstr_length; /* Number of code points in wstr, possible + * surrogates count as two code points. */ +} PyCompactUnicodeObject; + +/* Strings allocated through PyUnicode_FromUnicode(NULL, len) use the + PyUnicodeObject structure. The actual string data is initially in the wstr + block, and copied into the data block using _PyUnicode_Ready. */ +typedef struct { + PyCompactUnicodeObject _base; + union { + void *any; + Py_UCS1 *latin1; + Py_UCS2 *ucs2; + Py_UCS4 *ucs4; + } data; /* Canonical, smallest-form Unicode buffer */ +} PyUnicodeObject; + +/* Fast access macros */ +#define PyUnicode_WSTR_LENGTH(op) \ + (PyUnicode_IS_COMPACT_ASCII(op) ? \ + ((PyASCIIObject*)op)->length : \ + ((PyCompactUnicodeObject*)op)->wstr_length) + +/* Returns the deprecated Py_UNICODE representation's size in code units + (this includes surrogate pairs as 2 units). + If the Py_UNICODE representation is not available, it will be computed + on request. Use PyUnicode_GET_LENGTH() for the length in code points. */ + +#define PyUnicode_GET_SIZE(op) \ + (assert(PyUnicode_Check(op)), \ + (((PyASCIIObject *)(op))->wstr) ? \ + PyUnicode_WSTR_LENGTH(op) : \ + ((void)PyUnicode_AsUnicode(_PyObject_CAST(op)),\ + assert(((PyASCIIObject *)(op))->wstr), \ + PyUnicode_WSTR_LENGTH(op))) + /* Py_DEPRECATED(3.3) */ + +#define PyUnicode_GET_DATA_SIZE(op) \ + (PyUnicode_GET_SIZE(op) * Py_UNICODE_SIZE) + /* Py_DEPRECATED(3.3) */ + +/* Alias for PyUnicode_AsUnicode(). This will create a wchar_t/Py_UNICODE + representation on demand. Using this macro is very inefficient now, + try to port your code to use the new PyUnicode_*BYTE_DATA() macros or + use PyUnicode_WRITE() and PyUnicode_READ(). */ + +#define PyUnicode_AS_UNICODE(op) \ + (assert(PyUnicode_Check(op)), \ + (((PyASCIIObject *)(op))->wstr) ? (((PyASCIIObject *)(op))->wstr) : \ + PyUnicode_AsUnicode(_PyObject_CAST(op))) + /* Py_DEPRECATED(3.3) */ + +#define PyUnicode_AS_DATA(op) \ + ((const char *)(PyUnicode_AS_UNICODE(op))) + /* Py_DEPRECATED(3.3) */ + + +/* --- Flexible String Representation Helper Macros (PEP 393) -------------- */ + +/* Values for PyASCIIObject.state: */ + +/* Interning state. */ +#define SSTATE_NOT_INTERNED 0 +#define SSTATE_INTERNED_MORTAL 1 +#define SSTATE_INTERNED_IMMORTAL 2 + +/* Return true if the string contains only ASCII characters, or 0 if not. The + string may be compact (PyUnicode_IS_COMPACT_ASCII) or not, but must be + ready. */ +#define PyUnicode_IS_ASCII(op) \ + (assert(PyUnicode_Check(op)), \ + assert(PyUnicode_IS_READY(op)), \ + ((PyASCIIObject*)op)->state.ascii) + +/* Return true if the string is compact or 0 if not. + No type checks or Ready calls are performed. */ +#define PyUnicode_IS_COMPACT(op) \ + (((PyASCIIObject*)(op))->state.compact) + +/* Return true if the string is a compact ASCII string (use PyASCIIObject + structure), or 0 if not. No type checks or Ready calls are performed. */ +#define PyUnicode_IS_COMPACT_ASCII(op) \ + (((PyASCIIObject*)op)->state.ascii && PyUnicode_IS_COMPACT(op)) + +enum PyUnicode_Kind { +/* String contains only wstr byte characters. This is only possible + when the string was created with a legacy API and _PyUnicode_Ready() + has not been called yet. */ + PyUnicode_WCHAR_KIND = 0, +/* Return values of the PyUnicode_KIND() macro: */ + PyUnicode_1BYTE_KIND = 1, + PyUnicode_2BYTE_KIND = 2, + PyUnicode_4BYTE_KIND = 4 +}; + +/* Return pointers to the canonical representation cast to unsigned char, + Py_UCS2, or Py_UCS4 for direct character access. + No checks are performed, use PyUnicode_KIND() before to ensure + these will work correctly. */ + +#define PyUnicode_1BYTE_DATA(op) ((Py_UCS1*)PyUnicode_DATA(op)) +#define PyUnicode_2BYTE_DATA(op) ((Py_UCS2*)PyUnicode_DATA(op)) +#define PyUnicode_4BYTE_DATA(op) ((Py_UCS4*)PyUnicode_DATA(op)) + +/* Return one of the PyUnicode_*_KIND values defined above. */ +#define PyUnicode_KIND(op) \ + (assert(PyUnicode_Check(op)), \ + assert(PyUnicode_IS_READY(op)), \ + ((PyASCIIObject *)(op))->state.kind) + +/* Return a void pointer to the raw unicode buffer. */ +#define _PyUnicode_COMPACT_DATA(op) \ + (PyUnicode_IS_ASCII(op) ? \ + ((void*)((PyASCIIObject*)(op) + 1)) : \ + ((void*)((PyCompactUnicodeObject*)(op) + 1))) + +#define _PyUnicode_NONCOMPACT_DATA(op) \ + (assert(((PyUnicodeObject*)(op))->data.any), \ + ((((PyUnicodeObject *)(op))->data.any))) + +#define PyUnicode_DATA(op) \ + (assert(PyUnicode_Check(op)), \ + PyUnicode_IS_COMPACT(op) ? _PyUnicode_COMPACT_DATA(op) : \ + _PyUnicode_NONCOMPACT_DATA(op)) + +/* In the access macros below, "kind" may be evaluated more than once. + All other macro parameters are evaluated exactly once, so it is safe + to put side effects into them (such as increasing the index). */ + +/* Write into the canonical representation, this macro does not do any sanity + checks and is intended for usage in loops. The caller should cache the + kind and data pointers obtained from other macro calls. + index is the index in the string (starts at 0) and value is the new + code point value which should be written to that location. */ +#define PyUnicode_WRITE(kind, data, index, value) \ + do { \ + switch ((kind)) { \ + case PyUnicode_1BYTE_KIND: { \ + ((Py_UCS1 *)(data))[(index)] = (Py_UCS1)(value); \ + break; \ + } \ + case PyUnicode_2BYTE_KIND: { \ + ((Py_UCS2 *)(data))[(index)] = (Py_UCS2)(value); \ + break; \ + } \ + default: { \ + assert((kind) == PyUnicode_4BYTE_KIND); \ + ((Py_UCS4 *)(data))[(index)] = (Py_UCS4)(value); \ + } \ + } \ + } while (0) + +/* Read a code point from the string's canonical representation. No checks + or ready calls are performed. */ +#define PyUnicode_READ(kind, data, index) \ + ((Py_UCS4) \ + ((kind) == PyUnicode_1BYTE_KIND ? \ + ((const Py_UCS1 *)(data))[(index)] : \ + ((kind) == PyUnicode_2BYTE_KIND ? \ + ((const Py_UCS2 *)(data))[(index)] : \ + ((const Py_UCS4 *)(data))[(index)] \ + ) \ + )) + +/* PyUnicode_READ_CHAR() is less efficient than PyUnicode_READ() because it + calls PyUnicode_KIND() and might call it twice. For single reads, use + PyUnicode_READ_CHAR, for multiple consecutive reads callers should + cache kind and use PyUnicode_READ instead. */ +#define PyUnicode_READ_CHAR(unicode, index) \ + (assert(PyUnicode_Check(unicode)), \ + assert(PyUnicode_IS_READY(unicode)), \ + (Py_UCS4) \ + (PyUnicode_KIND((unicode)) == PyUnicode_1BYTE_KIND ? \ + ((const Py_UCS1 *)(PyUnicode_DATA((unicode))))[(index)] : \ + (PyUnicode_KIND((unicode)) == PyUnicode_2BYTE_KIND ? \ + ((const Py_UCS2 *)(PyUnicode_DATA((unicode))))[(index)] : \ + ((const Py_UCS4 *)(PyUnicode_DATA((unicode))))[(index)] \ + ) \ + )) + +/* Returns the length of the unicode string. The caller has to make sure that + the string has it's canonical representation set before calling + this macro. Call PyUnicode_(FAST_)Ready to ensure that. */ +#define PyUnicode_GET_LENGTH(op) \ + (assert(PyUnicode_Check(op)), \ + assert(PyUnicode_IS_READY(op)), \ + ((PyASCIIObject *)(op))->length) + + +/* Fast check to determine whether an object is ready. Equivalent to + PyUnicode_IS_COMPACT(op) || ((PyUnicodeObject*)(op))->data.any) */ + +#define PyUnicode_IS_READY(op) (((PyASCIIObject*)op)->state.ready) + +/* PyUnicode_READY() does less work than _PyUnicode_Ready() in the best + case. If the canonical representation is not yet set, it will still call + _PyUnicode_Ready(). + Returns 0 on success and -1 on errors. */ +#define PyUnicode_READY(op) \ + (assert(PyUnicode_Check(op)), \ + (PyUnicode_IS_READY(op) ? \ + 0 : _PyUnicode_Ready(_PyObject_CAST(op)))) + +/* Return a maximum character value which is suitable for creating another + string based on op. This is always an approximation but more efficient + than iterating over the string. */ +#define PyUnicode_MAX_CHAR_VALUE(op) \ + (assert(PyUnicode_IS_READY(op)), \ + (PyUnicode_IS_ASCII(op) ? \ + (0x7f) : \ + (PyUnicode_KIND(op) == PyUnicode_1BYTE_KIND ? \ + (0xffU) : \ + (PyUnicode_KIND(op) == PyUnicode_2BYTE_KIND ? \ + (0xffffU) : \ + (0x10ffffU))))) + +/* === Public API ========================================================= */ + +/* --- Plain Py_UNICODE --------------------------------------------------- */ + +/* With PEP 393, this is the recommended way to allocate a new unicode object. + This function will allocate the object and its buffer in a single memory + block. Objects created using this function are not resizable. */ +PyAPI_FUNC(PyObject*) PyUnicode_New( + Py_ssize_t size, /* Number of code points in the new string */ + Py_UCS4 maxchar /* maximum code point value in the string */ + ); + +/* Initializes the canonical string representation from the deprecated + wstr/Py_UNICODE representation. This function is used to convert Unicode + objects which were created using the old API to the new flexible format + introduced with PEP 393. + + Don't call this function directly, use the public PyUnicode_READY() macro + instead. */ +PyAPI_FUNC(int) _PyUnicode_Ready( + PyObject *unicode /* Unicode object */ + ); + +/* Get a copy of a Unicode string. */ +PyAPI_FUNC(PyObject*) _PyUnicode_Copy( + PyObject *unicode + ); + +/* Copy character from one unicode object into another, this function performs + character conversion when necessary and falls back to memcpy() if possible. + + Fail if to is too small (smaller than *how_many* or smaller than + len(from)-from_start), or if kind(from[from_start:from_start+how_many]) > + kind(to), or if *to* has more than 1 reference. + + Return the number of written character, or return -1 and raise an exception + on error. + + Pseudo-code: + + how_many = min(how_many, len(from) - from_start) + to[to_start:to_start+how_many] = from[from_start:from_start+how_many] + return how_many + + Note: The function doesn't write a terminating null character. + */ +PyAPI_FUNC(Py_ssize_t) PyUnicode_CopyCharacters( + PyObject *to, + Py_ssize_t to_start, + PyObject *from, + Py_ssize_t from_start, + Py_ssize_t how_many + ); + +/* Unsafe version of PyUnicode_CopyCharacters(): don't check arguments and so + may crash if parameters are invalid (e.g. if the output string + is too short). */ +PyAPI_FUNC(void) _PyUnicode_FastCopyCharacters( + PyObject *to, + Py_ssize_t to_start, + PyObject *from, + Py_ssize_t from_start, + Py_ssize_t how_many + ); + +/* Fill a string with a character: write fill_char into + unicode[start:start+length]. + + Fail if fill_char is bigger than the string maximum character, or if the + string has more than 1 reference. + + Return the number of written character, or return -1 and raise an exception + on error. */ +PyAPI_FUNC(Py_ssize_t) PyUnicode_Fill( + PyObject *unicode, + Py_ssize_t start, + Py_ssize_t length, + Py_UCS4 fill_char + ); + +/* Unsafe version of PyUnicode_Fill(): don't check arguments and so may crash + if parameters are invalid (e.g. if length is longer than the string). */ +PyAPI_FUNC(void) _PyUnicode_FastFill( + PyObject *unicode, + Py_ssize_t start, + Py_ssize_t length, + Py_UCS4 fill_char + ); + +/* Create a Unicode Object from the Py_UNICODE buffer u of the given + size. + + u may be NULL which causes the contents to be undefined. It is the + user's responsibility to fill in the needed data afterwards. Note + that modifying the Unicode object contents after construction is + only allowed if u was set to NULL. + + The buffer is copied into the new object. */ +PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode( + const Py_UNICODE *u, /* Unicode buffer */ + Py_ssize_t size /* size of buffer */ + ) /* Py_DEPRECATED(3.3) */; + +/* Create a new string from a buffer of Py_UCS1, Py_UCS2 or Py_UCS4 characters. + Scan the string to find the maximum character. */ +PyAPI_FUNC(PyObject*) PyUnicode_FromKindAndData( + int kind, + const void *buffer, + Py_ssize_t size); + +/* Create a new string from a buffer of ASCII characters. + WARNING: Don't check if the string contains any non-ASCII character. */ +PyAPI_FUNC(PyObject*) _PyUnicode_FromASCII( + const char *buffer, + Py_ssize_t size); + +/* Compute the maximum character of the substring unicode[start:end]. + Return 127 for an empty string. */ +PyAPI_FUNC(Py_UCS4) _PyUnicode_FindMaxChar ( + PyObject *unicode, + Py_ssize_t start, + Py_ssize_t end); + +/* Return a read-only pointer to the Unicode object's internal + Py_UNICODE buffer. + If the wchar_t/Py_UNICODE representation is not yet available, this + function will calculate it. */ +PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode( + PyObject *unicode /* Unicode object */ + ) /* Py_DEPRECATED(3.3) */; + +/* Similar to PyUnicode_AsUnicode(), but raises a ValueError if the string + contains null characters. */ +PyAPI_FUNC(const Py_UNICODE *) _PyUnicode_AsUnicode( + PyObject *unicode /* Unicode object */ + ); + +/* Return a read-only pointer to the Unicode object's internal + Py_UNICODE buffer and save the length at size. + If the wchar_t/Py_UNICODE representation is not yet available, this + function will calculate it. */ + +PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicodeAndSize( + PyObject *unicode, /* Unicode object */ + Py_ssize_t *size /* location where to save the length */ + ) /* Py_DEPRECATED(3.3) */; + +/* Get the maximum ordinal for a Unicode character. */ +PyAPI_FUNC(Py_UNICODE) PyUnicode_GetMax(void) Py_DEPRECATED(3.3); + + +/* --- _PyUnicodeWriter API ----------------------------------------------- */ + +typedef struct { + PyObject *buffer; + void *data; + enum PyUnicode_Kind kind; + Py_UCS4 maxchar; + Py_ssize_t size; + Py_ssize_t pos; + + /* minimum number of allocated characters (default: 0) */ + Py_ssize_t min_length; + + /* minimum character (default: 127, ASCII) */ + Py_UCS4 min_char; + + /* If non-zero, overallocate the buffer (default: 0). */ + unsigned char overallocate; + + /* If readonly is 1, buffer is a shared string (cannot be modified) + and size is set to 0. */ + unsigned char readonly; +} _PyUnicodeWriter ; + +/* Initialize a Unicode writer. + * + * By default, the minimum buffer size is 0 character and overallocation is + * disabled. Set min_length, min_char and overallocate attributes to control + * the allocation of the buffer. */ +PyAPI_FUNC(void) +_PyUnicodeWriter_Init(_PyUnicodeWriter *writer); + +/* Prepare the buffer to write 'length' characters + with the specified maximum character. + + Return 0 on success, raise an exception and return -1 on error. */ +#define _PyUnicodeWriter_Prepare(WRITER, LENGTH, MAXCHAR) \ + (((MAXCHAR) <= (WRITER)->maxchar \ + && (LENGTH) <= (WRITER)->size - (WRITER)->pos) \ + ? 0 \ + : (((LENGTH) == 0) \ + ? 0 \ + : _PyUnicodeWriter_PrepareInternal((WRITER), (LENGTH), (MAXCHAR)))) + +/* Don't call this function directly, use the _PyUnicodeWriter_Prepare() macro + instead. */ +PyAPI_FUNC(int) +_PyUnicodeWriter_PrepareInternal(_PyUnicodeWriter *writer, + Py_ssize_t length, Py_UCS4 maxchar); + +/* Prepare the buffer to have at least the kind KIND. + For example, kind=PyUnicode_2BYTE_KIND ensures that the writer will + support characters in range U+000-U+FFFF. + + Return 0 on success, raise an exception and return -1 on error. */ +#define _PyUnicodeWriter_PrepareKind(WRITER, KIND) \ + (assert((KIND) != PyUnicode_WCHAR_KIND), \ + (KIND) <= (WRITER)->kind \ + ? 0 \ + : _PyUnicodeWriter_PrepareKindInternal((WRITER), (KIND))) + +/* Don't call this function directly, use the _PyUnicodeWriter_PrepareKind() + macro instead. */ +PyAPI_FUNC(int) +_PyUnicodeWriter_PrepareKindInternal(_PyUnicodeWriter *writer, + enum PyUnicode_Kind kind); + +/* Append a Unicode character. + Return 0 on success, raise an exception and return -1 on error. */ +PyAPI_FUNC(int) +_PyUnicodeWriter_WriteChar(_PyUnicodeWriter *writer, + Py_UCS4 ch + ); + +/* Append a Unicode string. + Return 0 on success, raise an exception and return -1 on error. */ +PyAPI_FUNC(int) +_PyUnicodeWriter_WriteStr(_PyUnicodeWriter *writer, + PyObject *str /* Unicode string */ + ); + +/* Append a substring of a Unicode string. + Return 0 on success, raise an exception and return -1 on error. */ +PyAPI_FUNC(int) +_PyUnicodeWriter_WriteSubstring(_PyUnicodeWriter *writer, + PyObject *str, /* Unicode string */ + Py_ssize_t start, + Py_ssize_t end + ); + +/* Append an ASCII-encoded byte string. + Return 0 on success, raise an exception and return -1 on error. */ +PyAPI_FUNC(int) +_PyUnicodeWriter_WriteASCIIString(_PyUnicodeWriter *writer, + const char *str, /* ASCII-encoded byte string */ + Py_ssize_t len /* number of bytes, or -1 if unknown */ + ); + +/* Append a latin1-encoded byte string. + Return 0 on success, raise an exception and return -1 on error. */ +PyAPI_FUNC(int) +_PyUnicodeWriter_WriteLatin1String(_PyUnicodeWriter *writer, + const char *str, /* latin1-encoded byte string */ + Py_ssize_t len /* length in bytes */ + ); + +/* Get the value of the writer as a Unicode string. Clear the + buffer of the writer. Raise an exception and return NULL + on error. */ +PyAPI_FUNC(PyObject *) +_PyUnicodeWriter_Finish(_PyUnicodeWriter *writer); + +/* Deallocate memory of a writer (clear its internal buffer). */ +PyAPI_FUNC(void) +_PyUnicodeWriter_Dealloc(_PyUnicodeWriter *writer); + + +/* Format the object based on the format_spec, as defined in PEP 3101 + (Advanced String Formatting). */ +PyAPI_FUNC(int) _PyUnicode_FormatAdvancedWriter( + _PyUnicodeWriter *writer, + PyObject *obj, + PyObject *format_spec, + Py_ssize_t start, + Py_ssize_t end); + +PyAPI_FUNC(void) _Py_ReleaseInternedUnicodeStrings(void); + +/* --- wchar_t support for platforms which support it --------------------- */ + +#ifdef HAVE_WCHAR_H +PyAPI_FUNC(void*) _PyUnicode_AsKind(PyObject *s, unsigned int kind); +#endif + +/* --- Manage the default encoding ---------------------------------------- */ + +/* Returns a pointer to the default encoding (UTF-8) of the + Unicode object unicode and the size of the encoded representation + in bytes stored in *size. + + In case of an error, no *size is set. + + This function caches the UTF-8 encoded string in the unicodeobject + and subsequent calls will return the same string. The memory is released + when the unicodeobject is deallocated. + + _PyUnicode_AsStringAndSize is a #define for PyUnicode_AsUTF8AndSize to + support the previous internal function with the same behaviour. + + *** This API is for interpreter INTERNAL USE ONLY and will likely + *** be removed or changed in the future. + + *** If you need to access the Unicode object as UTF-8 bytes string, + *** please use PyUnicode_AsUTF8String() instead. +*/ + +PyAPI_FUNC(const char *) PyUnicode_AsUTF8AndSize( + PyObject *unicode, + Py_ssize_t *size); + +#define _PyUnicode_AsStringAndSize PyUnicode_AsUTF8AndSize + +/* Returns a pointer to the default encoding (UTF-8) of the + Unicode object unicode. + + Like PyUnicode_AsUTF8AndSize(), this also caches the UTF-8 representation + in the unicodeobject. + + _PyUnicode_AsString is a #define for PyUnicode_AsUTF8 to + support the previous internal function with the same behaviour. + + Use of this API is DEPRECATED since no size information can be + extracted from the returned data. + + *** This API is for interpreter INTERNAL USE ONLY and will likely + *** be removed or changed for Python 3.1. + + *** If you need to access the Unicode object as UTF-8 bytes string, + *** please use PyUnicode_AsUTF8String() instead. + +*/ + +PyAPI_FUNC(const char *) PyUnicode_AsUTF8(PyObject *unicode); + +#define _PyUnicode_AsString PyUnicode_AsUTF8 + +/* --- Generic Codecs ----------------------------------------------------- */ + +/* Encodes a Py_UNICODE buffer of the given size and returns a + Python string object. */ +PyAPI_FUNC(PyObject*) PyUnicode_Encode( + const Py_UNICODE *s, /* Unicode char buffer */ + Py_ssize_t size, /* number of Py_UNICODE chars to encode */ + const char *encoding, /* encoding */ + const char *errors /* error handling */ + ) Py_DEPRECATED(3.3); + +/* --- UTF-7 Codecs ------------------------------------------------------- */ + +PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF7( + const Py_UNICODE *data, /* Unicode char buffer */ + Py_ssize_t length, /* number of Py_UNICODE chars to encode */ + int base64SetO, /* Encode RFC2152 Set O characters in base64 */ + int base64WhiteSpace, /* Encode whitespace (sp, ht, nl, cr) in base64 */ + const char *errors /* error handling */ + ) Py_DEPRECATED(3.3); + +PyAPI_FUNC(PyObject*) _PyUnicode_EncodeUTF7( + PyObject *unicode, /* Unicode object */ + int base64SetO, /* Encode RFC2152 Set O characters in base64 */ + int base64WhiteSpace, /* Encode whitespace (sp, ht, nl, cr) in base64 */ + const char *errors /* error handling */ + ); + +/* --- UTF-8 Codecs ------------------------------------------------------- */ + +PyAPI_FUNC(PyObject*) _PyUnicode_AsUTF8String( + PyObject *unicode, + const char *errors); + +PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF8( + const Py_UNICODE *data, /* Unicode char buffer */ + Py_ssize_t length, /* number of Py_UNICODE chars to encode */ + const char *errors /* error handling */ + ) Py_DEPRECATED(3.3); + +/* --- UTF-32 Codecs ------------------------------------------------------ */ + +PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF32( + const Py_UNICODE *data, /* Unicode char buffer */ + Py_ssize_t length, /* number of Py_UNICODE chars to encode */ + const char *errors, /* error handling */ + int byteorder /* byteorder to use 0=BOM+native;-1=LE,1=BE */ + ) Py_DEPRECATED(3.3); + +PyAPI_FUNC(PyObject*) _PyUnicode_EncodeUTF32( + PyObject *object, /* Unicode object */ + const char *errors, /* error handling */ + int byteorder /* byteorder to use 0=BOM+native;-1=LE,1=BE */ + ); + +/* --- UTF-16 Codecs ------------------------------------------------------ */ + +/* Returns a Python string object holding the UTF-16 encoded value of + the Unicode data. + + If byteorder is not 0, output is written according to the following + byte order: + + byteorder == -1: little endian + byteorder == 0: native byte order (writes a BOM mark) + byteorder == 1: big endian + + If byteorder is 0, the output string will always start with the + Unicode BOM mark (U+FEFF). In the other two modes, no BOM mark is + prepended. + + Note that Py_UNICODE data is being interpreted as UTF-16 reduced to + UCS-2. This trick makes it possible to add full UTF-16 capabilities + at a later point without compromising the APIs. + +*/ +PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF16( + const Py_UNICODE *data, /* Unicode char buffer */ + Py_ssize_t length, /* number of Py_UNICODE chars to encode */ + const char *errors, /* error handling */ + int byteorder /* byteorder to use 0=BOM+native;-1=LE,1=BE */ + ) Py_DEPRECATED(3.3); + +PyAPI_FUNC(PyObject*) _PyUnicode_EncodeUTF16( + PyObject* unicode, /* Unicode object */ + const char *errors, /* error handling */ + int byteorder /* byteorder to use 0=BOM+native;-1=LE,1=BE */ + ); + +/* --- Unicode-Escape Codecs ---------------------------------------------- */ + +/* Helper for PyUnicode_DecodeUnicodeEscape that detects invalid escape + chars. */ +PyAPI_FUNC(PyObject*) _PyUnicode_DecodeUnicodeEscape( + const char *string, /* Unicode-Escape encoded string */ + Py_ssize_t length, /* size of string */ + const char *errors, /* error handling */ + const char **first_invalid_escape /* on return, points to first + invalid escaped char in + string. */ +); + +PyAPI_FUNC(PyObject*) PyUnicode_EncodeUnicodeEscape( + const Py_UNICODE *data, /* Unicode char buffer */ + Py_ssize_t length /* Number of Py_UNICODE chars to encode */ + ) Py_DEPRECATED(3.3); + +/* --- Raw-Unicode-Escape Codecs ------------------------------------------ */ + +PyAPI_FUNC(PyObject*) PyUnicode_EncodeRawUnicodeEscape( + const Py_UNICODE *data, /* Unicode char buffer */ + Py_ssize_t length /* Number of Py_UNICODE chars to encode */ + ) Py_DEPRECATED(3.3); + +/* --- Unicode Internal Codec --------------------------------------------- */ + +/* Only for internal use in _codecsmodule.c */ +PyObject *_PyUnicode_DecodeUnicodeInternal( + const char *string, + Py_ssize_t length, + const char *errors + ); + +/* --- Latin-1 Codecs ----------------------------------------------------- */ + +PyAPI_FUNC(PyObject*) _PyUnicode_AsLatin1String( + PyObject* unicode, + const char* errors); + +PyAPI_FUNC(PyObject*) PyUnicode_EncodeLatin1( + const Py_UNICODE *data, /* Unicode char buffer */ + Py_ssize_t length, /* Number of Py_UNICODE chars to encode */ + const char *errors /* error handling */ + ) Py_DEPRECATED(3.3); + +/* --- ASCII Codecs ------------------------------------------------------- */ + +PyAPI_FUNC(PyObject*) _PyUnicode_AsASCIIString( + PyObject* unicode, + const char* errors); + +PyAPI_FUNC(PyObject*) PyUnicode_EncodeASCII( + const Py_UNICODE *data, /* Unicode char buffer */ + Py_ssize_t length, /* Number of Py_UNICODE chars to encode */ + const char *errors /* error handling */ + ) Py_DEPRECATED(3.3); + +/* --- Character Map Codecs ----------------------------------------------- */ + +PyAPI_FUNC(PyObject*) PyUnicode_EncodeCharmap( + const Py_UNICODE *data, /* Unicode char buffer */ + Py_ssize_t length, /* Number of Py_UNICODE chars to encode */ + PyObject *mapping, /* encoding mapping */ + const char *errors /* error handling */ + ) Py_DEPRECATED(3.3); + +PyAPI_FUNC(PyObject*) _PyUnicode_EncodeCharmap( + PyObject *unicode, /* Unicode object */ + PyObject *mapping, /* encoding mapping */ + const char *errors /* error handling */ + ); + +/* Translate a Py_UNICODE buffer of the given length by applying a + character mapping table to it and return the resulting Unicode + object. + + The mapping table must map Unicode ordinal integers to Unicode strings, + Unicode ordinal integers or None (causing deletion of the character). + + Mapping tables may be dictionaries or sequences. Unmapped character + ordinals (ones which cause a LookupError) are left untouched and + are copied as-is. + +*/ +PyAPI_FUNC(PyObject *) PyUnicode_TranslateCharmap( + const Py_UNICODE *data, /* Unicode char buffer */ + Py_ssize_t length, /* Number of Py_UNICODE chars to encode */ + PyObject *table, /* Translate table */ + const char *errors /* error handling */ + ) Py_DEPRECATED(3.3); + +/* --- MBCS codecs for Windows -------------------------------------------- */ + +#ifdef MS_WINDOWS +PyAPI_FUNC(PyObject*) PyUnicode_EncodeMBCS( + const Py_UNICODE *data, /* Unicode char buffer */ + Py_ssize_t length, /* number of Py_UNICODE chars to encode */ + const char *errors /* error handling */ + ) Py_DEPRECATED(3.3); +#endif + +/* --- Decimal Encoder ---------------------------------------------------- */ + +/* Takes a Unicode string holding a decimal value and writes it into + an output buffer using standard ASCII digit codes. + + The output buffer has to provide at least length+1 bytes of storage + area. The output string is 0-terminated. + + The encoder converts whitespace to ' ', decimal characters to their + corresponding ASCII digit and all other Latin-1 characters except + \0 as-is. Characters outside this range (Unicode ordinals 1-256) + are treated as errors. This includes embedded NULL bytes. + + Error handling is defined by the errors argument: + + NULL or "strict": raise a ValueError + "ignore": ignore the wrong characters (these are not copied to the + output buffer) + "replace": replaces illegal characters with '?' + + Returns 0 on success, -1 on failure. + +*/ + +PyAPI_FUNC(int) PyUnicode_EncodeDecimal( + Py_UNICODE *s, /* Unicode buffer */ + Py_ssize_t length, /* Number of Py_UNICODE chars to encode */ + char *output, /* Output buffer; must have size >= length */ + const char *errors /* error handling */ + ) /* Py_DEPRECATED(3.3) */; + +/* Transforms code points that have decimal digit property to the + corresponding ASCII digit code points. + + Returns a new Unicode string on success, NULL on failure. +*/ + +PyAPI_FUNC(PyObject*) PyUnicode_TransformDecimalToASCII( + Py_UNICODE *s, /* Unicode buffer */ + Py_ssize_t length /* Number of Py_UNICODE chars to transform */ + ) /* Py_DEPRECATED(3.3) */; + +/* Coverts a Unicode object holding a decimal value to an ASCII string + for using in int, float and complex parsers. + Transforms code points that have decimal digit property to the + corresponding ASCII digit code points. Transforms spaces to ASCII. + Transforms code points starting from the first non-ASCII code point that + is neither a decimal digit nor a space to the end into '?'. */ + +PyAPI_FUNC(PyObject*) _PyUnicode_TransformDecimalAndSpaceToASCII( + PyObject *unicode /* Unicode object */ + ); + +/* --- Methods & Slots ---------------------------------------------------- */ + +PyAPI_FUNC(PyObject *) _PyUnicode_JoinArray( + PyObject *separator, + PyObject *const *items, + Py_ssize_t seqlen + ); + +/* Test whether a unicode is equal to ASCII identifier. Return 1 if true, + 0 otherwise. The right argument must be ASCII identifier. + Any error occurs inside will be cleared before return. */ +PyAPI_FUNC(int) _PyUnicode_EqualToASCIIId( + PyObject *left, /* Left string */ + _Py_Identifier *right /* Right identifier */ + ); + +/* Test whether a unicode is equal to ASCII string. Return 1 if true, + 0 otherwise. The right argument must be ASCII-encoded string. + Any error occurs inside will be cleared before return. */ +PyAPI_FUNC(int) _PyUnicode_EqualToASCIIString( + PyObject *left, + const char *right /* ASCII-encoded string */ + ); + +/* Externally visible for str.strip(unicode) */ +PyAPI_FUNC(PyObject *) _PyUnicode_XStrip( + PyObject *self, + int striptype, + PyObject *sepobj + ); + +/* Using explicit passed-in values, insert the thousands grouping + into the string pointed to by buffer. For the argument descriptions, + see Objects/stringlib/localeutil.h */ +PyAPI_FUNC(Py_ssize_t) _PyUnicode_InsertThousandsGrouping( + _PyUnicodeWriter *writer, + Py_ssize_t n_buffer, + PyObject *digits, + Py_ssize_t d_pos, + Py_ssize_t n_digits, + Py_ssize_t min_width, + const char *grouping, + PyObject *thousands_sep, + Py_UCS4 *maxchar); + +/* === Characters Type APIs =============================================== */ + +/* Helper array used by Py_UNICODE_ISSPACE(). */ + +PyAPI_DATA(const unsigned char) _Py_ascii_whitespace[]; + +/* These should not be used directly. Use the Py_UNICODE_IS* and + Py_UNICODE_TO* macros instead. + + These APIs are implemented in Objects/unicodectype.c. + +*/ + +PyAPI_FUNC(int) _PyUnicode_IsLowercase( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsUppercase( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsTitlecase( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsXidStart( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsXidContinue( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsWhitespace( + const Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsLinebreak( + const Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(Py_UCS4) _PyUnicode_ToLowercase( + Py_UCS4 ch /* Unicode character */ + ) /* Py_DEPRECATED(3.3) */; + +PyAPI_FUNC(Py_UCS4) _PyUnicode_ToUppercase( + Py_UCS4 ch /* Unicode character */ + ) /* Py_DEPRECATED(3.3) */; + +PyAPI_FUNC(Py_UCS4) _PyUnicode_ToTitlecase( + Py_UCS4 ch /* Unicode character */ + ) Py_DEPRECATED(3.3); + +PyAPI_FUNC(int) _PyUnicode_ToLowerFull( + Py_UCS4 ch, /* Unicode character */ + Py_UCS4 *res + ); + +PyAPI_FUNC(int) _PyUnicode_ToTitleFull( + Py_UCS4 ch, /* Unicode character */ + Py_UCS4 *res + ); + +PyAPI_FUNC(int) _PyUnicode_ToUpperFull( + Py_UCS4 ch, /* Unicode character */ + Py_UCS4 *res + ); + +PyAPI_FUNC(int) _PyUnicode_ToFoldedFull( + Py_UCS4 ch, /* Unicode character */ + Py_UCS4 *res + ); + +PyAPI_FUNC(int) _PyUnicode_IsCaseIgnorable( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsCased( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_ToDecimalDigit( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_ToDigit( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(double) _PyUnicode_ToNumeric( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsDecimalDigit( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsDigit( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsNumeric( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsPrintable( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsAlpha( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(size_t) Py_UNICODE_strlen( + const Py_UNICODE *u + ) Py_DEPRECATED(3.3); + +PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strcpy( + Py_UNICODE *s1, + const Py_UNICODE *s2) Py_DEPRECATED(3.3); + +PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strcat( + Py_UNICODE *s1, const Py_UNICODE *s2) Py_DEPRECATED(3.3); + +PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strncpy( + Py_UNICODE *s1, + const Py_UNICODE *s2, + size_t n) Py_DEPRECATED(3.3); + +PyAPI_FUNC(int) Py_UNICODE_strcmp( + const Py_UNICODE *s1, + const Py_UNICODE *s2 + ) Py_DEPRECATED(3.3); + +PyAPI_FUNC(int) Py_UNICODE_strncmp( + const Py_UNICODE *s1, + const Py_UNICODE *s2, + size_t n + ) Py_DEPRECATED(3.3); + +PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strchr( + const Py_UNICODE *s, + Py_UNICODE c + ) Py_DEPRECATED(3.3); + +PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strrchr( + const Py_UNICODE *s, + Py_UNICODE c + ) Py_DEPRECATED(3.3); + +PyAPI_FUNC(PyObject*) _PyUnicode_FormatLong(PyObject *, int, int, int); + +/* Create a copy of a unicode string ending with a nul character. Return NULL + and raise a MemoryError exception on memory allocation failure, otherwise + return a new allocated buffer (use PyMem_Free() to free the buffer). */ + +PyAPI_FUNC(Py_UNICODE*) PyUnicode_AsUnicodeCopy( + PyObject *unicode + ) Py_DEPRECATED(3.3); + +/* Return an interned Unicode object for an Identifier; may fail if there is no memory.*/ +PyAPI_FUNC(PyObject*) _PyUnicode_FromId(_Py_Identifier*); +/* Clear all static strings. */ +PyAPI_FUNC(void) _PyUnicode_ClearStaticStrings(void); + +/* Fast equality check when the inputs are known to be exact unicode types + and where the hash values are equal (i.e. a very probable match) */ +PyAPI_FUNC(int) _PyUnicode_EQ(PyObject *, PyObject *); + +#ifdef __cplusplus +} +#endif diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h index e7192852f045..503aeb5d19a6 100644 --- a/Include/unicodeobject.h +++ b/Include/unicodeobject.h @@ -83,16 +83,6 @@ Copyright (c) Corporation for National Research Initiatives. /* #define HAVE_WCHAR_H */ /* #define HAVE_USABLE_WCHAR_T */ -/* Py_UNICODE was the native Unicode storage format (code unit) used by - Python and represents a single Unicode element in the Unicode type. - With PEP 393, Py_UNICODE is deprecated and replaced with a - typedef to wchar_t. */ - -#ifndef Py_LIMITED_API -#define PY_UNICODE_TYPE wchar_t -typedef wchar_t Py_UNICODE /* Py_DEPRECATED(3.3) */; -#endif - /* If the compiler provides a wchar_t type we try to support it through the interface functions PyUnicode_FromWideChar(), PyUnicode_AsWideChar() and PyUnicode_AsWideCharString(). */ @@ -113,248 +103,10 @@ typedef uint32_t Py_UCS4; typedef uint16_t Py_UCS2; typedef uint8_t Py_UCS1; -/* --- Internal Unicode Operations ---------------------------------------- */ - -/* Since splitting on whitespace is an important use case, and - whitespace in most situations is solely ASCII whitespace, we - optimize for the common case by using a quick look-up table - _Py_ascii_whitespace (see below) with an inlined check. - - */ -#ifndef Py_LIMITED_API -#define Py_UNICODE_ISSPACE(ch) \ - ((ch) < 128U ? _Py_ascii_whitespace[(ch)] : _PyUnicode_IsWhitespace(ch)) - -#define Py_UNICODE_ISLOWER(ch) _PyUnicode_IsLowercase(ch) -#define Py_UNICODE_ISUPPER(ch) _PyUnicode_IsUppercase(ch) -#define Py_UNICODE_ISTITLE(ch) _PyUnicode_IsTitlecase(ch) -#define Py_UNICODE_ISLINEBREAK(ch) _PyUnicode_IsLinebreak(ch) - -#define Py_UNICODE_TOLOWER(ch) _PyUnicode_ToLowercase(ch) -#define Py_UNICODE_TOUPPER(ch) _PyUnicode_ToUppercase(ch) -#define Py_UNICODE_TOTITLE(ch) _PyUnicode_ToTitlecase(ch) - -#define Py_UNICODE_ISDECIMAL(ch) _PyUnicode_IsDecimalDigit(ch) -#define Py_UNICODE_ISDIGIT(ch) _PyUnicode_IsDigit(ch) -#define Py_UNICODE_ISNUMERIC(ch) _PyUnicode_IsNumeric(ch) -#define Py_UNICODE_ISPRINTABLE(ch) _PyUnicode_IsPrintable(ch) - -#define Py_UNICODE_TODECIMAL(ch) _PyUnicode_ToDecimalDigit(ch) -#define Py_UNICODE_TODIGIT(ch) _PyUnicode_ToDigit(ch) -#define Py_UNICODE_TONUMERIC(ch) _PyUnicode_ToNumeric(ch) - -#define Py_UNICODE_ISALPHA(ch) _PyUnicode_IsAlpha(ch) - -#define Py_UNICODE_ISALNUM(ch) \ - (Py_UNICODE_ISALPHA(ch) || \ - Py_UNICODE_ISDECIMAL(ch) || \ - Py_UNICODE_ISDIGIT(ch) || \ - Py_UNICODE_ISNUMERIC(ch)) - -#define Py_UNICODE_COPY(target, source, length) \ - memcpy((target), (source), (length)*sizeof(Py_UNICODE)) - -#define Py_UNICODE_FILL(target, value, length) \ - do {Py_ssize_t i_; Py_UNICODE *t_ = (target); Py_UNICODE v_ = (value);\ - for (i_ = 0; i_ < (length); i_++) t_[i_] = v_;\ - } while (0) - -/* macros to work with surrogates */ -#define Py_UNICODE_IS_SURROGATE(ch) (0xD800 <= (ch) && (ch) <= 0xDFFF) -#define Py_UNICODE_IS_HIGH_SURROGATE(ch) (0xD800 <= (ch) && (ch) <= 0xDBFF) -#define Py_UNICODE_IS_LOW_SURROGATE(ch) (0xDC00 <= (ch) && (ch) <= 0xDFFF) -/* Join two surrogate characters and return a single Py_UCS4 value. */ -#define Py_UNICODE_JOIN_SURROGATES(high, low) \ - (((((Py_UCS4)(high) & 0x03FF) << 10) | \ - ((Py_UCS4)(low) & 0x03FF)) + 0x10000) -/* high surrogate = top 10 bits added to D800 */ -#define Py_UNICODE_HIGH_SURROGATE(ch) (0xD800 - (0x10000 >> 10) + ((ch) >> 10)) -/* low surrogate = bottom 10 bits added to DC00 */ -#define Py_UNICODE_LOW_SURROGATE(ch) (0xDC00 + ((ch) & 0x3FF)) - -/* Check if substring matches at given offset. The offset must be - valid, and the substring must not be empty. */ - -#define Py_UNICODE_MATCH(string, offset, substring) \ - ((*((string)->wstr + (offset)) == *((substring)->wstr)) && \ - ((*((string)->wstr + (offset) + (substring)->wstr_length-1) == *((substring)->wstr + (substring)->wstr_length-1))) && \ - !memcmp((string)->wstr + (offset), (substring)->wstr, (substring)->wstr_length*sizeof(Py_UNICODE))) - -#endif /* Py_LIMITED_API */ - #ifdef __cplusplus extern "C" { #endif -/* --- Unicode Type ------------------------------------------------------- */ - -#ifndef Py_LIMITED_API - -/* ASCII-only strings created through PyUnicode_New use the PyASCIIObject - structure. state.ascii and state.compact are set, and the data - immediately follow the structure. utf8_length and wstr_length can be found - in the length field; the utf8 pointer is equal to the data pointer. */ -typedef struct { - /* There are 4 forms of Unicode strings: - - - compact ascii: - - * structure = PyASCIIObject - * test: PyUnicode_IS_COMPACT_ASCII(op) - * kind = PyUnicode_1BYTE_KIND - * compact = 1 - * ascii = 1 - * ready = 1 - * (length is the length of the utf8 and wstr strings) - * (data starts just after the structure) - * (since ASCII is decoded from UTF-8, the utf8 string are the data) - - - compact: - - * structure = PyCompactUnicodeObject - * test: PyUnicode_IS_COMPACT(op) && !PyUnicode_IS_ASCII(op) - * kind = PyUnicode_1BYTE_KIND, PyUnicode_2BYTE_KIND or - PyUnicode_4BYTE_KIND - * compact = 1 - * ready = 1 - * ascii = 0 - * utf8 is not shared with data - * utf8_length = 0 if utf8 is NULL - * wstr is shared with data and wstr_length=length - if kind=PyUnicode_2BYTE_KIND and sizeof(wchar_t)=2 - or if kind=PyUnicode_4BYTE_KIND and sizeof(wchar_t)=4 - * wstr_length = 0 if wstr is NULL - * (data starts just after the structure) - - - legacy string, not ready: - - * structure = PyUnicodeObject - * test: kind == PyUnicode_WCHAR_KIND - * length = 0 (use wstr_length) - * hash = -1 - * kind = PyUnicode_WCHAR_KIND - * compact = 0 - * ascii = 0 - * ready = 0 - * interned = SSTATE_NOT_INTERNED - * wstr is not NULL - * data.any is NULL - * utf8 is NULL - * utf8_length = 0 - - - legacy string, ready: - - * structure = PyUnicodeObject structure - * test: !PyUnicode_IS_COMPACT(op) && kind != PyUnicode_WCHAR_KIND - * kind = PyUnicode_1BYTE_KIND, PyUnicode_2BYTE_KIND or - PyUnicode_4BYTE_KIND - * compact = 0 - * ready = 1 - * data.any is not NULL - * utf8 is shared and utf8_length = length with data.any if ascii = 1 - * utf8_length = 0 if utf8 is NULL - * wstr is shared with data.any and wstr_length = length - if kind=PyUnicode_2BYTE_KIND and sizeof(wchar_t)=2 - or if kind=PyUnicode_4BYTE_KIND and sizeof(wchar_4)=4 - * wstr_length = 0 if wstr is NULL - - Compact strings use only one memory block (structure + characters), - whereas legacy strings use one block for the structure and one block - for characters. - - Legacy strings are created by PyUnicode_FromUnicode() and - PyUnicode_FromStringAndSize(NULL, size) functions. They become ready - when PyUnicode_READY() is called. - - See also _PyUnicode_CheckConsistency(). - */ - PyObject_HEAD - Py_ssize_t length; /* Number of code points in the string */ - Py_hash_t hash; /* Hash value; -1 if not set */ - struct { - /* - SSTATE_NOT_INTERNED (0) - SSTATE_INTERNED_MORTAL (1) - SSTATE_INTERNED_IMMORTAL (2) - - If interned != SSTATE_NOT_INTERNED, the two references from the - dictionary to this object are *not* counted in ob_refcnt. - */ - unsigned int interned:2; - /* Character size: - - - PyUnicode_WCHAR_KIND (0): - - * character type = wchar_t (16 or 32 bits, depending on the - platform) - - - PyUnicode_1BYTE_KIND (1): - - * character type = Py_UCS1 (8 bits, unsigned) - * all characters are in the range U+0000-U+00FF (latin1) - * if ascii is set, all characters are in the range U+0000-U+007F - (ASCII), otherwise at least one character is in the range - U+0080-U+00FF - - - PyUnicode_2BYTE_KIND (2): - - * character type = Py_UCS2 (16 bits, unsigned) - * all characters are in the range U+0000-U+FFFF (BMP) - * at least one character is in the range U+0100-U+FFFF - - - PyUnicode_4BYTE_KIND (4): - - * character type = Py_UCS4 (32 bits, unsigned) - * all characters are in the range U+0000-U+10FFFF - * at least one character is in the range U+10000-U+10FFFF - */ - unsigned int kind:3; - /* Compact is with respect to the allocation scheme. Compact unicode - objects only require one memory block while non-compact objects use - one block for the PyUnicodeObject struct and another for its data - buffer. */ - unsigned int compact:1; - /* The string only contains characters in the range U+0000-U+007F (ASCII) - and the kind is PyUnicode_1BYTE_KIND. If ascii is set and compact is - set, use the PyASCIIObject structure. */ - unsigned int ascii:1; - /* The ready flag indicates whether the object layout is initialized - completely. This means that this is either a compact object, or - the data pointer is filled out. The bit is redundant, and helps - to minimize the test in PyUnicode_IS_READY(). */ - unsigned int ready:1; - /* Padding to ensure that PyUnicode_DATA() is always aligned to - 4 bytes (see issue #19537 on m68k). */ - unsigned int :24; - } state; - wchar_t *wstr; /* wchar_t representation (null-terminated) */ -} PyASCIIObject; - -/* Non-ASCII strings allocated through PyUnicode_New use the - PyCompactUnicodeObject structure. state.compact is set, and the data - immediately follow the structure. */ -typedef struct { - PyASCIIObject _base; - Py_ssize_t utf8_length; /* Number of bytes in utf8, excluding the - * terminating \0. */ - char *utf8; /* UTF-8 representation (null-terminated) */ - Py_ssize_t wstr_length; /* Number of code points in wstr, possible - * surrogates count as two code points. */ -} PyCompactUnicodeObject; - -/* Strings allocated through PyUnicode_FromUnicode(NULL, len) use the - PyUnicodeObject structure. The actual string data is initially in the wstr - block, and copied into the data block using _PyUnicode_Ready. */ -typedef struct { - PyCompactUnicodeObject _base; - union { - void *any; - Py_UCS1 *latin1; - Py_UCS2 *ucs2; - Py_UCS4 *ucs4; - } data; /* Canonical, smallest-form Unicode buffer */ -} PyUnicodeObject; -#endif PyAPI_DATA(PyTypeObject) PyUnicode_Type; PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type; @@ -363,209 +115,6 @@ PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type; PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_UNICODE_SUBCLASS) #define PyUnicode_CheckExact(op) (Py_TYPE(op) == &PyUnicode_Type) -/* Fast access macros */ -#ifndef Py_LIMITED_API - -#define PyUnicode_WSTR_LENGTH(op) \ - (PyUnicode_IS_COMPACT_ASCII(op) ? \ - ((PyASCIIObject*)op)->length : \ - ((PyCompactUnicodeObject*)op)->wstr_length) - -/* Returns the deprecated Py_UNICODE representation's size in code units - (this includes surrogate pairs as 2 units). - If the Py_UNICODE representation is not available, it will be computed - on request. Use PyUnicode_GET_LENGTH() for the length in code points. */ - -#define PyUnicode_GET_SIZE(op) \ - (assert(PyUnicode_Check(op)), \ - (((PyASCIIObject *)(op))->wstr) ? \ - PyUnicode_WSTR_LENGTH(op) : \ - ((void)PyUnicode_AsUnicode(_PyObject_CAST(op)),\ - assert(((PyASCIIObject *)(op))->wstr), \ - PyUnicode_WSTR_LENGTH(op))) - /* Py_DEPRECATED(3.3) */ - -#define PyUnicode_GET_DATA_SIZE(op) \ - (PyUnicode_GET_SIZE(op) * Py_UNICODE_SIZE) - /* Py_DEPRECATED(3.3) */ - -/* Alias for PyUnicode_AsUnicode(). This will create a wchar_t/Py_UNICODE - representation on demand. Using this macro is very inefficient now, - try to port your code to use the new PyUnicode_*BYTE_DATA() macros or - use PyUnicode_WRITE() and PyUnicode_READ(). */ - -#define PyUnicode_AS_UNICODE(op) \ - (assert(PyUnicode_Check(op)), \ - (((PyASCIIObject *)(op))->wstr) ? (((PyASCIIObject *)(op))->wstr) : \ - PyUnicode_AsUnicode(_PyObject_CAST(op))) - /* Py_DEPRECATED(3.3) */ - -#define PyUnicode_AS_DATA(op) \ - ((const char *)(PyUnicode_AS_UNICODE(op))) - /* Py_DEPRECATED(3.3) */ - - -/* --- Flexible String Representation Helper Macros (PEP 393) -------------- */ - -/* Values for PyASCIIObject.state: */ - -/* Interning state. */ -#define SSTATE_NOT_INTERNED 0 -#define SSTATE_INTERNED_MORTAL 1 -#define SSTATE_INTERNED_IMMORTAL 2 - -/* Return true if the string contains only ASCII characters, or 0 if not. The - string may be compact (PyUnicode_IS_COMPACT_ASCII) or not, but must be - ready. */ -#define PyUnicode_IS_ASCII(op) \ - (assert(PyUnicode_Check(op)), \ - assert(PyUnicode_IS_READY(op)), \ - ((PyASCIIObject*)op)->state.ascii) - -/* Return true if the string is compact or 0 if not. - No type checks or Ready calls are performed. */ -#define PyUnicode_IS_COMPACT(op) \ - (((PyASCIIObject*)(op))->state.compact) - -/* Return true if the string is a compact ASCII string (use PyASCIIObject - structure), or 0 if not. No type checks or Ready calls are performed. */ -#define PyUnicode_IS_COMPACT_ASCII(op) \ - (((PyASCIIObject*)op)->state.ascii && PyUnicode_IS_COMPACT(op)) - -enum PyUnicode_Kind { -/* String contains only wstr byte characters. This is only possible - when the string was created with a legacy API and _PyUnicode_Ready() - has not been called yet. */ - PyUnicode_WCHAR_KIND = 0, -/* Return values of the PyUnicode_KIND() macro: */ - PyUnicode_1BYTE_KIND = 1, - PyUnicode_2BYTE_KIND = 2, - PyUnicode_4BYTE_KIND = 4 -}; - -/* Return pointers to the canonical representation cast to unsigned char, - Py_UCS2, or Py_UCS4 for direct character access. - No checks are performed, use PyUnicode_KIND() before to ensure - these will work correctly. */ - -#define PyUnicode_1BYTE_DATA(op) ((Py_UCS1*)PyUnicode_DATA(op)) -#define PyUnicode_2BYTE_DATA(op) ((Py_UCS2*)PyUnicode_DATA(op)) -#define PyUnicode_4BYTE_DATA(op) ((Py_UCS4*)PyUnicode_DATA(op)) - -/* Return one of the PyUnicode_*_KIND values defined above. */ -#define PyUnicode_KIND(op) \ - (assert(PyUnicode_Check(op)), \ - assert(PyUnicode_IS_READY(op)), \ - ((PyASCIIObject *)(op))->state.kind) - -/* Return a void pointer to the raw unicode buffer. */ -#define _PyUnicode_COMPACT_DATA(op) \ - (PyUnicode_IS_ASCII(op) ? \ - ((void*)((PyASCIIObject*)(op) + 1)) : \ - ((void*)((PyCompactUnicodeObject*)(op) + 1))) - -#define _PyUnicode_NONCOMPACT_DATA(op) \ - (assert(((PyUnicodeObject*)(op))->data.any), \ - ((((PyUnicodeObject *)(op))->data.any))) - -#define PyUnicode_DATA(op) \ - (assert(PyUnicode_Check(op)), \ - PyUnicode_IS_COMPACT(op) ? _PyUnicode_COMPACT_DATA(op) : \ - _PyUnicode_NONCOMPACT_DATA(op)) - -/* In the access macros below, "kind" may be evaluated more than once. - All other macro parameters are evaluated exactly once, so it is safe - to put side effects into them (such as increasing the index). */ - -/* Write into the canonical representation, this macro does not do any sanity - checks and is intended for usage in loops. The caller should cache the - kind and data pointers obtained from other macro calls. - index is the index in the string (starts at 0) and value is the new - code point value which should be written to that location. */ -#define PyUnicode_WRITE(kind, data, index, value) \ - do { \ - switch ((kind)) { \ - case PyUnicode_1BYTE_KIND: { \ - ((Py_UCS1 *)(data))[(index)] = (Py_UCS1)(value); \ - break; \ - } \ - case PyUnicode_2BYTE_KIND: { \ - ((Py_UCS2 *)(data))[(index)] = (Py_UCS2)(value); \ - break; \ - } \ - default: { \ - assert((kind) == PyUnicode_4BYTE_KIND); \ - ((Py_UCS4 *)(data))[(index)] = (Py_UCS4)(value); \ - } \ - } \ - } while (0) - -/* Read a code point from the string's canonical representation. No checks - or ready calls are performed. */ -#define PyUnicode_READ(kind, data, index) \ - ((Py_UCS4) \ - ((kind) == PyUnicode_1BYTE_KIND ? \ - ((const Py_UCS1 *)(data))[(index)] : \ - ((kind) == PyUnicode_2BYTE_KIND ? \ - ((const Py_UCS2 *)(data))[(index)] : \ - ((const Py_UCS4 *)(data))[(index)] \ - ) \ - )) - -/* PyUnicode_READ_CHAR() is less efficient than PyUnicode_READ() because it - calls PyUnicode_KIND() and might call it twice. For single reads, use - PyUnicode_READ_CHAR, for multiple consecutive reads callers should - cache kind and use PyUnicode_READ instead. */ -#define PyUnicode_READ_CHAR(unicode, index) \ - (assert(PyUnicode_Check(unicode)), \ - assert(PyUnicode_IS_READY(unicode)), \ - (Py_UCS4) \ - (PyUnicode_KIND((unicode)) == PyUnicode_1BYTE_KIND ? \ - ((const Py_UCS1 *)(PyUnicode_DATA((unicode))))[(index)] : \ - (PyUnicode_KIND((unicode)) == PyUnicode_2BYTE_KIND ? \ - ((const Py_UCS2 *)(PyUnicode_DATA((unicode))))[(index)] : \ - ((const Py_UCS4 *)(PyUnicode_DATA((unicode))))[(index)] \ - ) \ - )) - -/* Returns the length of the unicode string. The caller has to make sure that - the string has it's canonical representation set before calling - this macro. Call PyUnicode_(FAST_)Ready to ensure that. */ -#define PyUnicode_GET_LENGTH(op) \ - (assert(PyUnicode_Check(op)), \ - assert(PyUnicode_IS_READY(op)), \ - ((PyASCIIObject *)(op))->length) - - -/* Fast check to determine whether an object is ready. Equivalent to - PyUnicode_IS_COMPACT(op) || ((PyUnicodeObject*)(op))->data.any) */ - -#define PyUnicode_IS_READY(op) (((PyASCIIObject*)op)->state.ready) - -/* PyUnicode_READY() does less work than _PyUnicode_Ready() in the best - case. If the canonical representation is not yet set, it will still call - _PyUnicode_Ready(). - Returns 0 on success and -1 on errors. */ -#define PyUnicode_READY(op) \ - (assert(PyUnicode_Check(op)), \ - (PyUnicode_IS_READY(op) ? \ - 0 : _PyUnicode_Ready(_PyObject_CAST(op)))) - -/* Return a maximum character value which is suitable for creating another - string based on op. This is always an approximation but more efficient - than iterating over the string. */ -#define PyUnicode_MAX_CHAR_VALUE(op) \ - (assert(PyUnicode_IS_READY(op)), \ - (PyUnicode_IS_ASCII(op) ? \ - (0x7f) : \ - (PyUnicode_KIND(op) == PyUnicode_1BYTE_KIND ? \ - (0xffU) : \ - (PyUnicode_KIND(op) == PyUnicode_2BYTE_KIND ? \ - (0xffffU) : \ - (0x10ffffU))))) - -#endif - /* --- Constants ---------------------------------------------------------- */ /* This Unicode character will be used as replacement character during @@ -577,120 +126,6 @@ enum PyUnicode_Kind { /* === Public API ========================================================= */ -/* --- Plain Py_UNICODE --------------------------------------------------- */ - -/* With PEP 393, this is the recommended way to allocate a new unicode object. - This function will allocate the object and its buffer in a single memory - block. Objects created using this function are not resizable. */ -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject*) PyUnicode_New( - Py_ssize_t size, /* Number of code points in the new string */ - Py_UCS4 maxchar /* maximum code point value in the string */ - ); -#endif - -/* Initializes the canonical string representation from the deprecated - wstr/Py_UNICODE representation. This function is used to convert Unicode - objects which were created using the old API to the new flexible format - introduced with PEP 393. - - Don't call this function directly, use the public PyUnicode_READY() macro - instead. */ -#ifndef Py_LIMITED_API -PyAPI_FUNC(int) _PyUnicode_Ready( - PyObject *unicode /* Unicode object */ - ); -#endif - -/* Get a copy of a Unicode string. */ -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject*) _PyUnicode_Copy( - PyObject *unicode - ); -#endif - -/* Copy character from one unicode object into another, this function performs - character conversion when necessary and falls back to memcpy() if possible. - - Fail if to is too small (smaller than *how_many* or smaller than - len(from)-from_start), or if kind(from[from_start:from_start+how_many]) > - kind(to), or if *to* has more than 1 reference. - - Return the number of written character, or return -1 and raise an exception - on error. - - Pseudo-code: - - how_many = min(how_many, len(from) - from_start) - to[to_start:to_start+how_many] = from[from_start:from_start+how_many] - return how_many - - Note: The function doesn't write a terminating null character. - */ -#ifndef Py_LIMITED_API -PyAPI_FUNC(Py_ssize_t) PyUnicode_CopyCharacters( - PyObject *to, - Py_ssize_t to_start, - PyObject *from, - Py_ssize_t from_start, - Py_ssize_t how_many - ); - -/* Unsafe version of PyUnicode_CopyCharacters(): don't check arguments and so - may crash if parameters are invalid (e.g. if the output string - is too short). */ -PyAPI_FUNC(void) _PyUnicode_FastCopyCharacters( - PyObject *to, - Py_ssize_t to_start, - PyObject *from, - Py_ssize_t from_start, - Py_ssize_t how_many - ); -#endif - -#ifndef Py_LIMITED_API -/* Fill a string with a character: write fill_char into - unicode[start:start+length]. - - Fail if fill_char is bigger than the string maximum character, or if the - string has more than 1 reference. - - Return the number of written character, or return -1 and raise an exception - on error. */ -PyAPI_FUNC(Py_ssize_t) PyUnicode_Fill( - PyObject *unicode, - Py_ssize_t start, - Py_ssize_t length, - Py_UCS4 fill_char - ); - -/* Unsafe version of PyUnicode_Fill(): don't check arguments and so may crash - if parameters are invalid (e.g. if length is longer than the string). */ -PyAPI_FUNC(void) _PyUnicode_FastFill( - PyObject *unicode, - Py_ssize_t start, - Py_ssize_t length, - Py_UCS4 fill_char - ); -#endif - -/* Create a Unicode Object from the Py_UNICODE buffer u of the given - size. - - u may be NULL which causes the contents to be undefined. It is the - user's responsibility to fill in the needed data afterwards. Note - that modifying the Unicode object contents after construction is - only allowed if u was set to NULL. - - The buffer is copied into the new object. */ - -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode( - const Py_UNICODE *u, /* Unicode buffer */ - Py_ssize_t size /* size of buffer */ - ) /* Py_DEPRECATED(3.3) */; -#endif - /* Similar to PyUnicode_FromUnicode(), but u points to UTF-8 encoded bytes */ PyAPI_FUNC(PyObject*) PyUnicode_FromStringAndSize( const char *u, /* UTF-8 encoded string */ @@ -703,21 +138,6 @@ PyAPI_FUNC(PyObject*) PyUnicode_FromString( const char *u /* UTF-8 encoded string */ ); -#ifndef Py_LIMITED_API -/* Create a new string from a buffer of Py_UCS1, Py_UCS2 or Py_UCS4 characters. - Scan the string to find the maximum character. */ -PyAPI_FUNC(PyObject*) PyUnicode_FromKindAndData( - int kind, - const void *buffer, - Py_ssize_t size); - -/* Create a new string from a buffer of ASCII characters. - WARNING: Don't check if the string contains any non-ASCII character. */ -PyAPI_FUNC(PyObject*) _PyUnicode_FromASCII( - const char *buffer, - Py_ssize_t size); -#endif - #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 PyAPI_FUNC(PyObject*) PyUnicode_Substring( PyObject *str, @@ -725,15 +145,6 @@ PyAPI_FUNC(PyObject*) PyUnicode_Substring( Py_ssize_t end); #endif -#ifndef Py_LIMITED_API -/* Compute the maximum character of the substring unicode[start:end]. - Return 127 for an empty string. */ -PyAPI_FUNC(Py_UCS4) _PyUnicode_FindMaxChar ( - PyObject *unicode, - Py_ssize_t start, - Py_ssize_t end); -#endif - #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 /* Copy the string into a UCS4 buffer including the null character if copy_null is set. Return NULL and raise an exception on error. Raise a SystemError if @@ -752,33 +163,6 @@ PyAPI_FUNC(Py_UCS4*) PyUnicode_AsUCS4( PyAPI_FUNC(Py_UCS4*) PyUnicode_AsUCS4Copy(PyObject *unicode); #endif -#ifndef Py_LIMITED_API -/* Return a read-only pointer to the Unicode object's internal - Py_UNICODE buffer. - If the wchar_t/Py_UNICODE representation is not yet available, this - function will calculate it. */ - -PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode( - PyObject *unicode /* Unicode object */ - ) /* Py_DEPRECATED(3.3) */; - -/* Similar to PyUnicode_AsUnicode(), but raises a ValueError if the string - contains null characters. */ -PyAPI_FUNC(const Py_UNICODE *) _PyUnicode_AsUnicode( - PyObject *unicode /* Unicode object */ - ); - -/* Return a read-only pointer to the Unicode object's internal - Py_UNICODE buffer and save the length at size. - If the wchar_t/Py_UNICODE representation is not yet available, this - function will calculate it. */ - -PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicodeAndSize( - PyObject *unicode, /* Unicode object */ - Py_ssize_t *size /* location where to save the length */ - ) /* Py_DEPRECATED(3.3) */; -#endif - #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 /* Get the length of the Unicode object. */ @@ -814,11 +198,6 @@ PyAPI_FUNC(int) PyUnicode_WriteChar( ); #endif -#ifndef Py_LIMITED_API -/* Get the maximum ordinal for a Unicode character. */ -PyAPI_FUNC(Py_UNICODE) PyUnicode_GetMax(void) Py_DEPRECATED(3.3); -#endif - /* Resize a Unicode object. The length is the number of characters, except if the kind of the string is PyUnicode_WCHAR_KIND: in this case, the length is the number of Py_UNICODE characters. @@ -881,141 +260,11 @@ PyAPI_FUNC(PyObject *) PyUnicode_FromFormat( ... ); -#ifndef Py_LIMITED_API -typedef struct { - PyObject *buffer; - void *data; - enum PyUnicode_Kind kind; - Py_UCS4 maxchar; - Py_ssize_t size; - Py_ssize_t pos; - - /* minimum number of allocated characters (default: 0) */ - Py_ssize_t min_length; - - /* minimum character (default: 127, ASCII) */ - Py_UCS4 min_char; - - /* If non-zero, overallocate the buffer (default: 0). */ - unsigned char overallocate; - - /* If readonly is 1, buffer is a shared string (cannot be modified) - and size is set to 0. */ - unsigned char readonly; -} _PyUnicodeWriter ; - -/* Initialize a Unicode writer. - * - * By default, the minimum buffer size is 0 character and overallocation is - * disabled. Set min_length, min_char and overallocate attributes to control - * the allocation of the buffer. */ -PyAPI_FUNC(void) -_PyUnicodeWriter_Init(_PyUnicodeWriter *writer); - -/* Prepare the buffer to write 'length' characters - with the specified maximum character. - - Return 0 on success, raise an exception and return -1 on error. */ -#define _PyUnicodeWriter_Prepare(WRITER, LENGTH, MAXCHAR) \ - (((MAXCHAR) <= (WRITER)->maxchar \ - && (LENGTH) <= (WRITER)->size - (WRITER)->pos) \ - ? 0 \ - : (((LENGTH) == 0) \ - ? 0 \ - : _PyUnicodeWriter_PrepareInternal((WRITER), (LENGTH), (MAXCHAR)))) - -/* Don't call this function directly, use the _PyUnicodeWriter_Prepare() macro - instead. */ -PyAPI_FUNC(int) -_PyUnicodeWriter_PrepareInternal(_PyUnicodeWriter *writer, - Py_ssize_t length, Py_UCS4 maxchar); - -/* Prepare the buffer to have at least the kind KIND. - For example, kind=PyUnicode_2BYTE_KIND ensures that the writer will - support characters in range U+000-U+FFFF. - - Return 0 on success, raise an exception and return -1 on error. */ -#define _PyUnicodeWriter_PrepareKind(WRITER, KIND) \ - (assert((KIND) != PyUnicode_WCHAR_KIND), \ - (KIND) <= (WRITER)->kind \ - ? 0 \ - : _PyUnicodeWriter_PrepareKindInternal((WRITER), (KIND))) - -/* Don't call this function directly, use the _PyUnicodeWriter_PrepareKind() - macro instead. */ -PyAPI_FUNC(int) -_PyUnicodeWriter_PrepareKindInternal(_PyUnicodeWriter *writer, - enum PyUnicode_Kind kind); - -/* Append a Unicode character. - Return 0 on success, raise an exception and return -1 on error. */ -PyAPI_FUNC(int) -_PyUnicodeWriter_WriteChar(_PyUnicodeWriter *writer, - Py_UCS4 ch - ); - -/* Append a Unicode string. - Return 0 on success, raise an exception and return -1 on error. */ -PyAPI_FUNC(int) -_PyUnicodeWriter_WriteStr(_PyUnicodeWriter *writer, - PyObject *str /* Unicode string */ - ); - -/* Append a substring of a Unicode string. - Return 0 on success, raise an exception and return -1 on error. */ -PyAPI_FUNC(int) -_PyUnicodeWriter_WriteSubstring(_PyUnicodeWriter *writer, - PyObject *str, /* Unicode string */ - Py_ssize_t start, - Py_ssize_t end - ); - -/* Append an ASCII-encoded byte string. - Return 0 on success, raise an exception and return -1 on error. */ -PyAPI_FUNC(int) -_PyUnicodeWriter_WriteASCIIString(_PyUnicodeWriter *writer, - const char *str, /* ASCII-encoded byte string */ - Py_ssize_t len /* number of bytes, or -1 if unknown */ - ); - -/* Append a latin1-encoded byte string. - Return 0 on success, raise an exception and return -1 on error. */ -PyAPI_FUNC(int) -_PyUnicodeWriter_WriteLatin1String(_PyUnicodeWriter *writer, - const char *str, /* latin1-encoded byte string */ - Py_ssize_t len /* length in bytes */ - ); - -/* Get the value of the writer as a Unicode string. Clear the - buffer of the writer. Raise an exception and return NULL - on error. */ -PyAPI_FUNC(PyObject *) -_PyUnicodeWriter_Finish(_PyUnicodeWriter *writer); - -/* Deallocate memory of a writer (clear its internal buffer). */ -PyAPI_FUNC(void) -_PyUnicodeWriter_Dealloc(_PyUnicodeWriter *writer); -#endif - -#ifndef Py_LIMITED_API -/* Format the object based on the format_spec, as defined in PEP 3101 - (Advanced String Formatting). */ -PyAPI_FUNC(int) _PyUnicode_FormatAdvancedWriter( - _PyUnicodeWriter *writer, - PyObject *obj, - PyObject *format_spec, - Py_ssize_t start, - Py_ssize_t end); -#endif - PyAPI_FUNC(void) PyUnicode_InternInPlace(PyObject **); PyAPI_FUNC(void) PyUnicode_InternImmortal(PyObject **); PyAPI_FUNC(PyObject *) PyUnicode_InternFromString( const char *u /* UTF-8 encoded string */ ); -#ifndef Py_LIMITED_API -PyAPI_FUNC(void) _Py_ReleaseInternedUnicodeStrings(void); -#endif /* Use only if you know it's a string */ #define PyUnicode_CHECK_INTERNED(op) \ @@ -1066,10 +315,6 @@ PyAPI_FUNC(wchar_t*) PyUnicode_AsWideCharString( Py_ssize_t *size /* number of characters of the result */ ); -#ifndef Py_LIMITED_API -PyAPI_FUNC(void*) _PyUnicode_AsKind(PyObject *s, unsigned int kind); -#endif - #endif /* --- Unicode ordinals --------------------------------------------------- */ @@ -1114,60 +359,7 @@ PyAPI_FUNC(int) PyUnicode_ClearFreeList(void); /* --- Manage the default encoding ---------------------------------------- */ -/* Returns a pointer to the default encoding (UTF-8) of the - Unicode object unicode and the size of the encoded representation - in bytes stored in *size. - - In case of an error, no *size is set. - - This function caches the UTF-8 encoded string in the unicodeobject - and subsequent calls will return the same string. The memory is released - when the unicodeobject is deallocated. - - _PyUnicode_AsStringAndSize is a #define for PyUnicode_AsUTF8AndSize to - support the previous internal function with the same behaviour. - - *** This API is for interpreter INTERNAL USE ONLY and will likely - *** be removed or changed in the future. - - *** If you need to access the Unicode object as UTF-8 bytes string, - *** please use PyUnicode_AsUTF8String() instead. -*/ - -#ifndef Py_LIMITED_API -PyAPI_FUNC(const char *) PyUnicode_AsUTF8AndSize( - PyObject *unicode, - Py_ssize_t *size); -#define _PyUnicode_AsStringAndSize PyUnicode_AsUTF8AndSize -#endif - -/* Returns a pointer to the default encoding (UTF-8) of the - Unicode object unicode. - - Like PyUnicode_AsUTF8AndSize(), this also caches the UTF-8 representation - in the unicodeobject. - - _PyUnicode_AsString is a #define for PyUnicode_AsUTF8 to - support the previous internal function with the same behaviour. - - Use of this API is DEPRECATED since no size information can be - extracted from the returned data. - - *** This API is for interpreter INTERNAL USE ONLY and will likely - *** be removed or changed for Python 3.1. - - *** If you need to access the Unicode object as UTF-8 bytes string, - *** please use PyUnicode_AsUTF8String() instead. - -*/ - -#ifndef Py_LIMITED_API -PyAPI_FUNC(const char *) PyUnicode_AsUTF8(PyObject *unicode); -#define _PyUnicode_AsString PyUnicode_AsUTF8 -#endif - /* Returns "utf-8". */ - PyAPI_FUNC(const char*) PyUnicode_GetDefaultEncoding(void); /* --- Generic Codecs ----------------------------------------------------- */ @@ -1208,18 +400,6 @@ PyAPI_FUNC(PyObject*) PyUnicode_AsDecodedUnicode( const char *errors /* error handling */ ) Py_DEPRECATED(3.6); -/* Encodes a Py_UNICODE buffer of the given size and returns a - Python string object. */ - -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject*) PyUnicode_Encode( - const Py_UNICODE *s, /* Unicode char buffer */ - Py_ssize_t size, /* number of Py_UNICODE chars to encode */ - const char *encoding, /* encoding */ - const char *errors /* error handling */ - ) Py_DEPRECATED(3.3); -#endif - /* Encodes a Unicode object and returns the result as Python object. @@ -1277,22 +457,6 @@ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF7Stateful( Py_ssize_t *consumed /* bytes consumed */ ); -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF7( - const Py_UNICODE *data, /* Unicode char buffer */ - Py_ssize_t length, /* number of Py_UNICODE chars to encode */ - int base64SetO, /* Encode RFC2152 Set O characters in base64 */ - int base64WhiteSpace, /* Encode whitespace (sp, ht, nl, cr) in base64 */ - const char *errors /* error handling */ - ) Py_DEPRECATED(3.3); -PyAPI_FUNC(PyObject*) _PyUnicode_EncodeUTF7( - PyObject *unicode, /* Unicode object */ - int base64SetO, /* Encode RFC2152 Set O characters in base64 */ - int base64WhiteSpace, /* Encode whitespace (sp, ht, nl, cr) in base64 */ - const char *errors /* error handling */ - ); -#endif - /* --- UTF-8 Codecs ------------------------------------------------------- */ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF8( @@ -1312,18 +476,6 @@ PyAPI_FUNC(PyObject*) PyUnicode_AsUTF8String( PyObject *unicode /* Unicode object */ ); -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject*) _PyUnicode_AsUTF8String( - PyObject *unicode, - const char *errors); - -PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF8( - const Py_UNICODE *data, /* Unicode char buffer */ - Py_ssize_t length, /* number of Py_UNICODE chars to encode */ - const char *errors /* error handling */ - ) Py_DEPRECATED(3.3); -#endif - /* --- UTF-32 Codecs ------------------------------------------------------ */ /* Decodes length bytes from a UTF-32 encoded buffer string and returns @@ -1391,20 +543,6 @@ PyAPI_FUNC(PyObject*) PyUnicode_AsUTF32String( */ -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF32( - const Py_UNICODE *data, /* Unicode char buffer */ - Py_ssize_t length, /* number of Py_UNICODE chars to encode */ - const char *errors, /* error handling */ - int byteorder /* byteorder to use 0=BOM+native;-1=LE,1=BE */ - ) Py_DEPRECATED(3.3); -PyAPI_FUNC(PyObject*) _PyUnicode_EncodeUTF32( - PyObject *object, /* Unicode object */ - const char *errors, /* error handling */ - int byteorder /* byteorder to use 0=BOM+native;-1=LE,1=BE */ - ); -#endif - /* --- UTF-16 Codecs ------------------------------------------------------ */ /* Decodes length bytes from a UTF-16 encoded buffer string and returns @@ -1456,40 +594,6 @@ PyAPI_FUNC(PyObject*) PyUnicode_AsUTF16String( PyObject *unicode /* Unicode object */ ); -/* Returns a Python string object holding the UTF-16 encoded value of - the Unicode data. - - If byteorder is not 0, output is written according to the following - byte order: - - byteorder == -1: little endian - byteorder == 0: native byte order (writes a BOM mark) - byteorder == 1: big endian - - If byteorder is 0, the output string will always start with the - Unicode BOM mark (U+FEFF). In the other two modes, no BOM mark is - prepended. - - Note that Py_UNICODE data is being interpreted as UTF-16 reduced to - UCS-2. This trick makes it possible to add full UTF-16 capabilities - at a later point without compromising the APIs. - -*/ - -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF16( - const Py_UNICODE *data, /* Unicode char buffer */ - Py_ssize_t length, /* number of Py_UNICODE chars to encode */ - const char *errors, /* error handling */ - int byteorder /* byteorder to use 0=BOM+native;-1=LE,1=BE */ - ) Py_DEPRECATED(3.3); -PyAPI_FUNC(PyObject*) _PyUnicode_EncodeUTF16( - PyObject* unicode, /* Unicode object */ - const char *errors, /* error handling */ - int byteorder /* byteorder to use 0=BOM+native;-1=LE,1=BE */ - ); -#endif - /* --- Unicode-Escape Codecs ---------------------------------------------- */ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUnicodeEscape( @@ -1498,30 +602,10 @@ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUnicodeEscape( const char *errors /* error handling */ ); -#ifndef Py_LIMITED_API -/* Helper for PyUnicode_DecodeUnicodeEscape that detects invalid escape - chars. */ -PyAPI_FUNC(PyObject*) _PyUnicode_DecodeUnicodeEscape( - const char *string, /* Unicode-Escape encoded string */ - Py_ssize_t length, /* size of string */ - const char *errors, /* error handling */ - const char **first_invalid_escape /* on return, points to first - invalid escaped char in - string. */ -); -#endif - PyAPI_FUNC(PyObject*) PyUnicode_AsUnicodeEscapeString( PyObject *unicode /* Unicode object */ ); -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject*) PyUnicode_EncodeUnicodeEscape( - const Py_UNICODE *data, /* Unicode char buffer */ - Py_ssize_t length /* Number of Py_UNICODE chars to encode */ - ) Py_DEPRECATED(3.3); -#endif - /* --- Raw-Unicode-Escape Codecs ------------------------------------------ */ PyAPI_FUNC(PyObject*) PyUnicode_DecodeRawUnicodeEscape( @@ -1534,30 +618,9 @@ PyAPI_FUNC(PyObject*) PyUnicode_AsRawUnicodeEscapeString( PyObject *unicode /* Unicode object */ ); -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject*) PyUnicode_EncodeRawUnicodeEscape( - const Py_UNICODE *data, /* Unicode char buffer */ - Py_ssize_t length /* Number of Py_UNICODE chars to encode */ - ) Py_DEPRECATED(3.3); -#endif - -/* --- Unicode Internal Codec --------------------------------------------- - - Only for internal use in _codecsmodule.c */ - -#ifndef Py_LIMITED_API -PyObject *_PyUnicode_DecodeUnicodeInternal( - const char *string, - Py_ssize_t length, - const char *errors - ); -#endif - /* --- Latin-1 Codecs ----------------------------------------------------- - Note: Latin-1 corresponds to the first 256 Unicode ordinals. - -*/ + Note: Latin-1 corresponds to the first 256 Unicode ordinals. */ PyAPI_FUNC(PyObject*) PyUnicode_DecodeLatin1( const char *string, /* Latin-1 encoded string */ @@ -1569,18 +632,6 @@ PyAPI_FUNC(PyObject*) PyUnicode_AsLatin1String( PyObject *unicode /* Unicode object */ ); -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject*) _PyUnicode_AsLatin1String( - PyObject* unicode, - const char* errors); - -PyAPI_FUNC(PyObject*) PyUnicode_EncodeLatin1( - const Py_UNICODE *data, /* Unicode char buffer */ - Py_ssize_t length, /* Number of Py_UNICODE chars to encode */ - const char *errors /* error handling */ - ) Py_DEPRECATED(3.3); -#endif - /* --- ASCII Codecs ------------------------------------------------------- Only 7-bit ASCII data is excepted. All other codes generate errors. @@ -1597,18 +648,6 @@ PyAPI_FUNC(PyObject*) PyUnicode_AsASCIIString( PyObject *unicode /* Unicode object */ ); -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject*) _PyUnicode_AsASCIIString( - PyObject* unicode, - const char* errors); - -PyAPI_FUNC(PyObject*) PyUnicode_EncodeASCII( - const Py_UNICODE *data, /* Unicode char buffer */ - Py_ssize_t length, /* Number of Py_UNICODE chars to encode */ - const char *errors /* error handling */ - ) Py_DEPRECATED(3.3); -#endif - /* --- Character Map Codecs ----------------------------------------------- This codec uses mappings to encode and decode characters. @@ -1638,46 +677,9 @@ PyAPI_FUNC(PyObject*) PyUnicode_AsCharmapString( PyObject *mapping /* encoding mapping */ ); -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject*) PyUnicode_EncodeCharmap( - const Py_UNICODE *data, /* Unicode char buffer */ - Py_ssize_t length, /* Number of Py_UNICODE chars to encode */ - PyObject *mapping, /* encoding mapping */ - const char *errors /* error handling */ - ) Py_DEPRECATED(3.3); -PyAPI_FUNC(PyObject*) _PyUnicode_EncodeCharmap( - PyObject *unicode, /* Unicode object */ - PyObject *mapping, /* encoding mapping */ - const char *errors /* error handling */ - ); -#endif - -/* Translate a Py_UNICODE buffer of the given length by applying a - character mapping table to it and return the resulting Unicode - object. - - The mapping table must map Unicode ordinal integers to Unicode strings, - Unicode ordinal integers or None (causing deletion of the character). - - Mapping tables may be dictionaries or sequences. Unmapped character - ordinals (ones which cause a LookupError) are left untouched and - are copied as-is. - -*/ - -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject *) PyUnicode_TranslateCharmap( - const Py_UNICODE *data, /* Unicode char buffer */ - Py_ssize_t length, /* Number of Py_UNICODE chars to encode */ - PyObject *table, /* Translate table */ - const char *errors /* error handling */ - ) Py_DEPRECATED(3.3); -#endif - -#ifdef MS_WINDOWS - /* --- MBCS codecs for Windows -------------------------------------------- */ +#ifdef MS_WINDOWS PyAPI_FUNC(PyObject*) PyUnicode_DecodeMBCS( const char *string, /* MBCS encoded string */ Py_ssize_t length, /* size of string */ @@ -1705,14 +707,6 @@ PyAPI_FUNC(PyObject*) PyUnicode_AsMBCSString( PyObject *unicode /* Unicode object */ ); -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject*) PyUnicode_EncodeMBCS( - const Py_UNICODE *data, /* Unicode char buffer */ - Py_ssize_t length, /* number of Py_UNICODE chars to encode */ - const char *errors /* error handling */ - ) Py_DEPRECATED(3.3); -#endif - #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 PyAPI_FUNC(PyObject*) PyUnicode_EncodeCodePage( int code_page, /* code page number */ @@ -1723,61 +717,6 @@ PyAPI_FUNC(PyObject*) PyUnicode_EncodeCodePage( #endif /* MS_WINDOWS */ -#ifndef Py_LIMITED_API -/* --- Decimal Encoder ---------------------------------------------------- */ - -/* Takes a Unicode string holding a decimal value and writes it into - an output buffer using standard ASCII digit codes. - - The output buffer has to provide at least length+1 bytes of storage - area. The output string is 0-terminated. - - The encoder converts whitespace to ' ', decimal characters to their - corresponding ASCII digit and all other Latin-1 characters except - \0 as-is. Characters outside this range (Unicode ordinals 1-256) - are treated as errors. This includes embedded NULL bytes. - - Error handling is defined by the errors argument: - - NULL or "strict": raise a ValueError - "ignore": ignore the wrong characters (these are not copied to the - output buffer) - "replace": replaces illegal characters with '?' - - Returns 0 on success, -1 on failure. - -*/ - -PyAPI_FUNC(int) PyUnicode_EncodeDecimal( - Py_UNICODE *s, /* Unicode buffer */ - Py_ssize_t length, /* Number of Py_UNICODE chars to encode */ - char *output, /* Output buffer; must have size >= length */ - const char *errors /* error handling */ - ) /* Py_DEPRECATED(3.3) */; - -/* Transforms code points that have decimal digit property to the - corresponding ASCII digit code points. - - Returns a new Unicode string on success, NULL on failure. -*/ - -PyAPI_FUNC(PyObject*) PyUnicode_TransformDecimalToASCII( - Py_UNICODE *s, /* Unicode buffer */ - Py_ssize_t length /* Number of Py_UNICODE chars to transform */ - ) /* Py_DEPRECATED(3.3) */; - -/* Coverts a Unicode object holding a decimal value to an ASCII string - for using in int, float and complex parsers. - Transforms code points that have decimal digit property to the - corresponding ASCII digit code points. Transforms spaces to ASCII. - Transforms code points starting from the first non-ASCII code point that - is neither a decimal digit nor a space to the end into '?'. */ - -PyAPI_FUNC(PyObject*) _PyUnicode_TransformDecimalAndSpaceToASCII( - PyObject *unicode /* Unicode object */ - ); -#endif - /* --- Locale encoding --------------------------------------------------- */ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 @@ -1976,14 +915,6 @@ PyAPI_FUNC(PyObject*) PyUnicode_Join( PyObject *seq /* Sequence object */ ); -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject *) _PyUnicode_JoinArray( - PyObject *separator, - PyObject *const *items, - Py_ssize_t seqlen - ); -#endif /* Py_LIMITED_API */ - /* Return 1 if substr matches str[start:end] at the given tail end, 0 otherwise. */ @@ -2047,17 +978,6 @@ PyAPI_FUNC(int) PyUnicode_Compare( PyObject *right /* Right string */ ); -#ifndef Py_LIMITED_API -/* Test whether a unicode is equal to ASCII identifier. Return 1 if true, - 0 otherwise. The right argument must be ASCII identifier. - Any error occurs inside will be cleared before return. */ - -PyAPI_FUNC(int) _PyUnicode_EqualToASCIIId( - PyObject *left, /* Left string */ - _Py_Identifier *right /* Right identifier */ - ); -#endif - /* Compare a Unicode object with C string and return -1, 0, 1 for less than, equal, and greater than, respectively. It is best to pass only ASCII-encoded strings, but the function interprets the input string as @@ -2069,17 +989,6 @@ PyAPI_FUNC(int) PyUnicode_CompareWithASCIIString( const char *right /* ASCII-encoded string */ ); -#ifndef Py_LIMITED_API -/* Test whether a unicode is equal to ASCII string. Return 1 if true, - 0 otherwise. The right argument must be ASCII-encoded string. - Any error occurs inside will be cleared before return. */ - -PyAPI_FUNC(int) _PyUnicode_EqualToASCIIString( - PyObject *left, - const char *right /* ASCII-encoded string */ - ); -#endif - /* Rich compare two strings and return one of the following: - NULL in case an exception was raised @@ -2121,192 +1030,8 @@ PyAPI_FUNC(int) PyUnicode_Contains( PyAPI_FUNC(int) PyUnicode_IsIdentifier(PyObject *s); -#ifndef Py_LIMITED_API -/* Externally visible for str.strip(unicode) */ -PyAPI_FUNC(PyObject *) _PyUnicode_XStrip( - PyObject *self, - int striptype, - PyObject *sepobj - ); -#endif - -/* Using explicit passed-in values, insert the thousands grouping - into the string pointed to by buffer. For the argument descriptions, - see Objects/stringlib/localeutil.h */ -#ifndef Py_LIMITED_API -PyAPI_FUNC(Py_ssize_t) _PyUnicode_InsertThousandsGrouping( - _PyUnicodeWriter *writer, - Py_ssize_t n_buffer, - PyObject *digits, - Py_ssize_t d_pos, - Py_ssize_t n_digits, - Py_ssize_t min_width, - const char *grouping, - PyObject *thousands_sep, - Py_UCS4 *maxchar); -#endif /* === Characters Type APIs =============================================== */ -/* Helper array used by Py_UNICODE_ISSPACE(). */ - -#ifndef Py_LIMITED_API -PyAPI_DATA(const unsigned char) _Py_ascii_whitespace[]; - -/* These should not be used directly. Use the Py_UNICODE_IS* and - Py_UNICODE_TO* macros instead. - - These APIs are implemented in Objects/unicodectype.c. - -*/ - -PyAPI_FUNC(int) _PyUnicode_IsLowercase( - Py_UCS4 ch /* Unicode character */ - ); - -PyAPI_FUNC(int) _PyUnicode_IsUppercase( - Py_UCS4 ch /* Unicode character */ - ); - -PyAPI_FUNC(int) _PyUnicode_IsTitlecase( - Py_UCS4 ch /* Unicode character */ - ); - -PyAPI_FUNC(int) _PyUnicode_IsXidStart( - Py_UCS4 ch /* Unicode character */ - ); - -PyAPI_FUNC(int) _PyUnicode_IsXidContinue( - Py_UCS4 ch /* Unicode character */ - ); - -PyAPI_FUNC(int) _PyUnicode_IsWhitespace( - const Py_UCS4 ch /* Unicode character */ - ); - -PyAPI_FUNC(int) _PyUnicode_IsLinebreak( - const Py_UCS4 ch /* Unicode character */ - ); - -PyAPI_FUNC(Py_UCS4) _PyUnicode_ToLowercase( - Py_UCS4 ch /* Unicode character */ - ) /* Py_DEPRECATED(3.3) */; - -PyAPI_FUNC(Py_UCS4) _PyUnicode_ToUppercase( - Py_UCS4 ch /* Unicode character */ - ) /* Py_DEPRECATED(3.3) */; - -PyAPI_FUNC(Py_UCS4) _PyUnicode_ToTitlecase( - Py_UCS4 ch /* Unicode character */ - ) Py_DEPRECATED(3.3); - -PyAPI_FUNC(int) _PyUnicode_ToLowerFull( - Py_UCS4 ch, /* Unicode character */ - Py_UCS4 *res - ); - -PyAPI_FUNC(int) _PyUnicode_ToTitleFull( - Py_UCS4 ch, /* Unicode character */ - Py_UCS4 *res - ); - -PyAPI_FUNC(int) _PyUnicode_ToUpperFull( - Py_UCS4 ch, /* Unicode character */ - Py_UCS4 *res - ); - -PyAPI_FUNC(int) _PyUnicode_ToFoldedFull( - Py_UCS4 ch, /* Unicode character */ - Py_UCS4 *res - ); - -PyAPI_FUNC(int) _PyUnicode_IsCaseIgnorable( - Py_UCS4 ch /* Unicode character */ - ); - -PyAPI_FUNC(int) _PyUnicode_IsCased( - Py_UCS4 ch /* Unicode character */ - ); - -PyAPI_FUNC(int) _PyUnicode_ToDecimalDigit( - Py_UCS4 ch /* Unicode character */ - ); - -PyAPI_FUNC(int) _PyUnicode_ToDigit( - Py_UCS4 ch /* Unicode character */ - ); - -PyAPI_FUNC(double) _PyUnicode_ToNumeric( - Py_UCS4 ch /* Unicode character */ - ); - -PyAPI_FUNC(int) _PyUnicode_IsDecimalDigit( - Py_UCS4 ch /* Unicode character */ - ); - -PyAPI_FUNC(int) _PyUnicode_IsDigit( - Py_UCS4 ch /* Unicode character */ - ); - -PyAPI_FUNC(int) _PyUnicode_IsNumeric( - Py_UCS4 ch /* Unicode character */ - ); - -PyAPI_FUNC(int) _PyUnicode_IsPrintable( - Py_UCS4 ch /* Unicode character */ - ); - -PyAPI_FUNC(int) _PyUnicode_IsAlpha( - Py_UCS4 ch /* Unicode character */ - ); - -PyAPI_FUNC(size_t) Py_UNICODE_strlen( - const Py_UNICODE *u - ) Py_DEPRECATED(3.3); - -PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strcpy( - Py_UNICODE *s1, - const Py_UNICODE *s2) Py_DEPRECATED(3.3); - -PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strcat( - Py_UNICODE *s1, const Py_UNICODE *s2) Py_DEPRECATED(3.3); - -PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strncpy( - Py_UNICODE *s1, - const Py_UNICODE *s2, - size_t n) Py_DEPRECATED(3.3); - -PyAPI_FUNC(int) Py_UNICODE_strcmp( - const Py_UNICODE *s1, - const Py_UNICODE *s2 - ) Py_DEPRECATED(3.3); - -PyAPI_FUNC(int) Py_UNICODE_strncmp( - const Py_UNICODE *s1, - const Py_UNICODE *s2, - size_t n - ) Py_DEPRECATED(3.3); - -PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strchr( - const Py_UNICODE *s, - Py_UNICODE c - ) Py_DEPRECATED(3.3); - -PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strrchr( - const Py_UNICODE *s, - Py_UNICODE c - ) Py_DEPRECATED(3.3); - -PyAPI_FUNC(PyObject*) _PyUnicode_FormatLong(PyObject *, int, int, int); - -/* Create a copy of a unicode string ending with a nul character. Return NULL - and raise a MemoryError exception on memory allocation failure, otherwise - return a new allocated buffer (use PyMem_Free() to free the buffer). */ - -PyAPI_FUNC(Py_UNICODE*) PyUnicode_AsUnicodeCopy( - PyObject *unicode - ) Py_DEPRECATED(3.3); -#endif /* Py_LIMITED_API */ - #if defined(Py_DEBUG) && !defined(Py_LIMITED_API) PyAPI_FUNC(int) _PyUnicode_CheckConsistency( PyObject *op, @@ -2318,15 +1043,10 @@ PyAPI_FUNC(int) _PyUnicode_CheckConsistency( #endif #ifndef Py_LIMITED_API -/* Return an interned Unicode object for an Identifier; may fail if there is no memory.*/ -PyAPI_FUNC(PyObject*) _PyUnicode_FromId(_Py_Identifier*); -/* Clear all static strings. */ -PyAPI_FUNC(void) _PyUnicode_ClearStaticStrings(void); - -/* Fast equality check when the inputs are known to be exact unicode types - and where the hash values are equal (i.e. a very probable match) */ -PyAPI_FUNC(int) _PyUnicode_EQ(PyObject *, PyObject *); -#endif /* !Py_LIMITED_API */ +# define Py_CPYTHON_UNICODEOBJECT_H +# include "cpython/unicodeobject.h" +# undef Py_CPYTHON_UNICODEOBJECT_H +#endif #ifdef __cplusplus } From webhook-mailer at python.org Mon Nov 26 12:05:53 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 26 Nov 2018 17:05:53 -0000 Subject: [Python-checkins] [3.7] bpo-35255: Doc: Delete now useless Windows FAQ section (GH-10557) (GH-10722) Message-ID: https://github.com/python/cpython/commit/6f8cab0db044132c6192d6ac1536d28cf72c9d27 commit: 6f8cab0db044132c6192d6ac1536d28cf72c9d27 branch: 3.7 author: Julien Palard committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-11-26T09:05:48-08:00 summary: [3.7] bpo-35255: Doc: Delete now useless Windows FAQ section (GH-10557) (GH-10722) (cherry picked from commit 5719f275b7153a00a800f5481271a6fc26659c65) Co-authored-by: Mathieu Dupuy https://bugs.python.org/issue35255 files: M Doc/faq/windows.rst diff --git a/Doc/faq/windows.rst b/Doc/faq/windows.rst index d063e7c550c0..9292a2407a75 100644 --- a/Doc/faq/windows.rst +++ b/Doc/faq/windows.rst @@ -301,14 +301,3 @@ In 2.7 and 3.2, :func:`os.kill` is implemented similar to the above function, with the additional feature of being able to send :kbd:`Ctrl+C` and :kbd:`Ctrl+Break` to console subprocesses which are designed to handle those signals. See :func:`os.kill` for further details. - -How do I extract the downloaded documentation on Windows? ---------------------------------------------------------- - -Sometimes, when you download the documentation package to a Windows machine -using a web browser, the file extension of the saved file ends up being .EXE. -This is a mistake; the extension should be .TGZ. - -Simply rename the downloaded file to have the .TGZ extension, and WinZip will be -able to handle it. (If your copy of WinZip doesn't, get a newer one from -https://www.winzip.com.) From webhook-mailer at python.org Mon Nov 26 12:16:17 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 26 Nov 2018 17:16:17 -0000 Subject: [Python-checkins] [3.6] bpo-35255: Doc: Delete now useless Windows FAQ section (GH-10557) (GH-10725) Message-ID: https://github.com/python/cpython/commit/7f93f93fa68f54c1bc128d58fa17536245396de3 commit: 7f93f93fa68f54c1bc128d58fa17536245396de3 branch: 3.6 author: Julien Palard committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-11-26T09:16:13-08:00 summary: [3.6] bpo-35255: Doc: Delete now useless Windows FAQ section (GH-10557) (GH-10725) (cherry picked from commit 5719f275b7153a00a800f5481271a6fc26659c65) Co-authored-by: Mathieu Dupuy https://bugs.python.org/issue35255 files: M Doc/faq/windows.rst diff --git a/Doc/faq/windows.rst b/Doc/faq/windows.rst index bcfd7f4f1fde..772b8c2012c3 100644 --- a/Doc/faq/windows.rst +++ b/Doc/faq/windows.rst @@ -301,14 +301,3 @@ In 2.7 and 3.2, :func:`os.kill` is implemented similar to the above function, with the additional feature of being able to send :kbd:`Ctrl+C` and :kbd:`Ctrl+Break` to console subprocesses which are designed to handle those signals. See :func:`os.kill` for further details. - -How do I extract the downloaded documentation on Windows? ---------------------------------------------------------- - -Sometimes, when you download the documentation package to a Windows machine -using a web browser, the file extension of the saved file ends up being .EXE. -This is a mistake; the extension should be .TGZ. - -Simply rename the downloaded file to have the .TGZ extension, and WinZip will be -able to handle it. (If your copy of WinZip doesn't, get a newer one from -https://www.winzip.com.) From webhook-mailer at python.org Mon Nov 26 13:43:46 2018 From: webhook-mailer at python.org (Lisa Roach) Date: Mon, 26 Nov 2018 18:43:46 -0000 Subject: [Python-checkins] Adds IPv6 support when invoking http.server directly. (GH-10595) Message-ID: https://github.com/python/cpython/commit/433433fa6d55091600ce88dd19206b3902e0a87d commit: 433433fa6d55091600ce88dd19206b3902e0a87d branch: master author: Lisa Roach committer: GitHub date: 2018-11-26T10:43:38-08:00 summary: Adds IPv6 support when invoking http.server directly. (GH-10595) files: A Misc/NEWS.d/next/Library/2018-11-18-18-44-40.bpo-24209.p3YWOf.rst M Doc/library/http.server.rst M Lib/http/server.py M Lib/test/test_httpservers.py diff --git a/Doc/library/http.server.rst b/Doc/library/http.server.rst index 29f6e7da3bde..a367e373dc3c 100644 --- a/Doc/library/http.server.rst +++ b/Doc/library/http.server.rst @@ -410,14 +410,18 @@ the previous example, this serves files relative to the current directory:: python -m http.server 8000 By default, server binds itself to all interfaces. The option ``-b/--bind`` -specifies a specific address to which it should bind. For example, the -following command causes the server to bind to localhost only:: +specifies a specific address to which it should bind. Both IPv4 and IPv6 +addresses are supported. For example, the following command causes the server +to bind to localhost only:: python -m http.server 8000 --bind 127.0.0.1 .. versionadded:: 3.4 ``--bind`` argument was introduced. +.. versionadded:: 3.8 + ``--bind`` argument enhanced to support IPv6 + By default, server uses the current directory. The option ``-d/--directory`` specifies a directory to which it should serve the files. For example, the following command uses a specific directory:: diff --git a/Lib/http/server.py b/Lib/http/server.py index ca2dd507392c..22d865f2fdfa 100644 --- a/Lib/http/server.py +++ b/Lib/http/server.py @@ -1226,6 +1226,9 @@ def test(HandlerClass=BaseHTTPRequestHandler, """ server_address = (bind, port) + if ':' in bind: + ServerClass.address_family = socket.AF_INET6 + HandlerClass.protocol_version = protocol with ServerClass(server_address, HandlerClass) as httpd: sa = httpd.socket.getsockname() diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py index cc829a522b88..3d8e0af8b45c 100644 --- a/Lib/test/test_httpservers.py +++ b/Lib/test/test_httpservers.py @@ -9,6 +9,7 @@ from http import server, HTTPStatus import os +import socket import sys import re import base64 @@ -1116,6 +1117,24 @@ def test_all(self): self.assertCountEqual(server.__all__, expected) +class ScriptTestCase(unittest.TestCase): + @mock.patch('builtins.print') + def test_server_test_ipv6(self, _): + mock_server = mock.MagicMock() + server.test(ServerClass=mock_server, bind="::") + self.assertEqual(mock_server.address_family, socket.AF_INET6) + + mock_server.reset_mock() + server.test(ServerClass=mock_server, + bind="2001:0db8:85a3:0000:0000:8a2e:0370:7334") + self.assertEqual(mock_server.address_family, socket.AF_INET6) + + mock_server.reset_mock() + server.test(ServerClass=mock_server, + bind="::1") + self.assertEqual(mock_server.address_family, socket.AF_INET6) + + def test_main(verbose=None): cwd = os.getcwd() try: @@ -1127,6 +1146,7 @@ def test_main(verbose=None): CGIHTTPServerTestCase, SimpleHTTPRequestHandlerTestCase, MiscTestCase, + ScriptTestCase ) finally: os.chdir(cwd) diff --git a/Misc/NEWS.d/next/Library/2018-11-18-18-44-40.bpo-24209.p3YWOf.rst b/Misc/NEWS.d/next/Library/2018-11-18-18-44-40.bpo-24209.p3YWOf.rst new file mode 100644 index 000000000000..88749e920c2c --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-11-18-18-44-40.bpo-24209.p3YWOf.rst @@ -0,0 +1 @@ +Adds IPv6 support when invoking http.server directly. From webhook-mailer at python.org Mon Nov 26 15:19:35 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 26 Nov 2018 20:19:35 -0000 Subject: [Python-checkins] bpo-33723: Fix test_time.test_thread_time() (GH-10724) Message-ID: https://github.com/python/cpython/commit/65c216e74f7957006ef7653b7e2afe83007c45ce commit: 65c216e74f7957006ef7653b7e2afe83007c45ce branch: master author: Victor Stinner committer: GitHub date: 2018-11-26T21:19:29+01:00 summary: bpo-33723: Fix test_time.test_thread_time() (GH-10724) Tolerate up to 30 ms, instead of 15 min, in other threads. files: M Lib/test/test_time.py diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py index 16b48a92f327..381cc823014e 100644 --- a/Lib/test/test_time.py +++ b/Lib/test/test_time.py @@ -496,7 +496,8 @@ def test_process_time(self): self.assertLess(stop - start, 0.020) # bpo-33723: A busy loop of 100 ms should increase process_time() - # by at least 15 ms + # by at least 15 ms. Tolerate 15 ms because of the bad resolution of + # the clock on Windows (around 15.6 ms). min_time = 0.015 busy_time = 0.100 @@ -534,8 +535,11 @@ def test_thread_time(self): self.assertLess(stop - start, 0.020) # bpo-33723: A busy loop of 100 ms should increase thread_time() - # by at least 15 ms + # by at least 15 ms, but less than 30 ms in other threads. + # Tolerate 15 and 30 ms because of the bad resolution + # of the clock on Windows (around 15.6 ms). min_time = 0.015 + max_time = 0.030 busy_time = 0.100 # thread_time() should include CPU time spent in current thread... @@ -550,7 +554,7 @@ def test_thread_time(self): t.start() t.join() stop = time.thread_time() - self.assertLess(stop - start, min_time) + self.assertLess(stop - start, max_time) info = time.get_clock_info('thread_time') self.assertTrue(info.monotonic) From webhook-mailer at python.org Mon Nov 26 15:36:59 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 26 Nov 2018 20:36:59 -0000 Subject: [Python-checkins] bpo-33723: Fix test_time.test_thread_time() (GH-10724) Message-ID: https://github.com/python/cpython/commit/5350dd1b50e60882a2da6d53ed27e02d2b698f2e commit: 5350dd1b50e60882a2da6d53ed27e02d2b698f2e branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-26T12:36:54-08:00 summary: bpo-33723: Fix test_time.test_thread_time() (GH-10724) Tolerate up to 30 ms, instead of 15 min, in other threads. (cherry picked from commit 65c216e74f7957006ef7653b7e2afe83007c45ce) Co-authored-by: Victor Stinner files: M Lib/test/test_time.py diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py index 62abd891aafa..b9c678640808 100644 --- a/Lib/test/test_time.py +++ b/Lib/test/test_time.py @@ -497,7 +497,8 @@ def test_process_time(self): self.assertLess(stop - start, 0.020) # bpo-33723: A busy loop of 100 ms should increase process_time() - # by at least 15 ms + # by at least 15 ms. Tolerate 15 ms because of the bad resolution of + # the clock on Windows (around 15.6 ms). min_time = 0.015 busy_time = 0.100 @@ -535,8 +536,11 @@ def test_thread_time(self): self.assertLess(stop - start, 0.020) # bpo-33723: A busy loop of 100 ms should increase thread_time() - # by at least 15 ms + # by at least 15 ms, but less than 30 ms in other threads. + # Tolerate 15 and 30 ms because of the bad resolution + # of the clock on Windows (around 15.6 ms). min_time = 0.015 + max_time = 0.030 busy_time = 0.100 # thread_time() should include CPU time spent in current thread... @@ -551,7 +555,7 @@ def test_thread_time(self): t.start() t.join() stop = time.thread_time() - self.assertLess(stop - start, min_time) + self.assertLess(stop - start, max_time) info = time.get_clock_info('thread_time') self.assertTrue(info.monotonic) From webhook-mailer at python.org Mon Nov 26 16:11:28 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 26 Nov 2018 21:11:28 -0000 Subject: [Python-checkins] bpo-35134: Add Include/cpython/pyerrors.h (GH-10727) Message-ID: https://github.com/python/cpython/commit/5a8c240b1d97de0bd6ced2a57cbcf26da19c1fcc commit: 5a8c240b1d97de0bd6ced2a57cbcf26da19c1fcc branch: master author: Victor Stinner committer: GitHub date: 2018-11-26T22:11:25+01:00 summary: bpo-35134: Add Include/cpython/pyerrors.h (GH-10727) Move pyerrors.h code surrounded by "#ifndef Py_LIMITED_API" to a new Include/cpython/pyerrors.h header file. files: A Include/cpython/pyerrors.h M Include/pyerrors.h diff --git a/Include/cpython/pyerrors.h b/Include/cpython/pyerrors.h new file mode 100644 index 000000000000..0b43d7528b97 --- /dev/null +++ b/Include/cpython/pyerrors.h @@ -0,0 +1,176 @@ +#ifndef Py_CPYTHON_ERRORS_H +# error "this header file must not be included directly" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* Error objects */ + +/* PyException_HEAD defines the initial segment of every exception class. */ +#define PyException_HEAD PyObject_HEAD PyObject *dict;\ + PyObject *args; PyObject *traceback;\ + PyObject *context; PyObject *cause;\ + char suppress_context; + +typedef struct { + PyException_HEAD +} PyBaseExceptionObject; + +typedef struct { + PyException_HEAD + PyObject *msg; + PyObject *filename; + PyObject *lineno; + PyObject *offset; + PyObject *text; + PyObject *print_file_and_line; +} PySyntaxErrorObject; + +typedef struct { + PyException_HEAD + PyObject *msg; + PyObject *name; + PyObject *path; +} PyImportErrorObject; + +typedef struct { + PyException_HEAD + PyObject *encoding; + PyObject *object; + Py_ssize_t start; + Py_ssize_t end; + PyObject *reason; +} PyUnicodeErrorObject; + +typedef struct { + PyException_HEAD + PyObject *code; +} PySystemExitObject; + +typedef struct { + PyException_HEAD + PyObject *myerrno; + PyObject *strerror; + PyObject *filename; + PyObject *filename2; +#ifdef MS_WINDOWS + PyObject *winerror; +#endif + Py_ssize_t written; /* only for BlockingIOError, -1 otherwise */ +} PyOSErrorObject; + +typedef struct { + PyException_HEAD + PyObject *value; +} PyStopIterationObject; + +/* Compatibility typedefs */ +typedef PyOSErrorObject PyEnvironmentErrorObject; +#ifdef MS_WINDOWS +typedef PyOSErrorObject PyWindowsErrorObject; +#endif + +/* Error handling definitions */ + +PyAPI_FUNC(void) _PyErr_SetKeyError(PyObject *); +_PyErr_StackItem *_PyErr_GetTopmostException(PyThreadState *tstate); + +/* Context manipulation (PEP 3134) */ + +PyAPI_FUNC(void) _PyErr_ChainExceptions(PyObject *, PyObject *, PyObject *); + +/* */ + +#define PyExceptionClass_Name(x) (((PyTypeObject*)(x))->tp_name) + +/* Convenience functions */ + +#ifdef MS_WINDOWS +PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename( + PyObject *, const Py_UNICODE *) Py_DEPRECATED(3.3); +#endif /* MS_WINDOWS */ + +/* Like PyErr_Format(), but saves current exception as __context__ and + __cause__. + */ +PyAPI_FUNC(PyObject *) _PyErr_FormatFromCause( + PyObject *exception, + const char *format, /* ASCII-encoded string */ + ... + ); + +#ifdef MS_WINDOWS +/* XXX redeclare to use WSTRING */ +PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithUnicodeFilename( + int, const Py_UNICODE *) Py_DEPRECATED(3.3); + +PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithUnicodeFilename( + PyObject *,int, const Py_UNICODE *) Py_DEPRECATED(3.3); +#endif + +/* In exceptions.c */ + +/* Helper that attempts to replace the current exception with one of the + * same type but with a prefix added to the exception text. The resulting + * exception description looks like: + * + * prefix (exc_type: original_exc_str) + * + * Only some exceptions can be safely replaced. If the function determines + * it isn't safe to perform the replacement, it will leave the original + * unmodified exception in place. + * + * Returns a borrowed reference to the new exception (if any), NULL if the + * existing exception was left in place. + */ +PyAPI_FUNC(PyObject *) _PyErr_TrySetFromCause( + const char *prefix_format, /* ASCII-encoded string */ + ... + ); + +/* In signalmodule.c */ + +int PySignal_SetWakeupFd(int fd); + +/* Support for adding program text to SyntaxErrors */ + +PyAPI_FUNC(void) PyErr_SyntaxLocationObject( + PyObject *filename, + int lineno, + int col_offset); + +PyAPI_FUNC(PyObject *) PyErr_ProgramTextObject( + PyObject *filename, + int lineno); + +/* Create a UnicodeEncodeError object */ +PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_Create( + const char *encoding, /* UTF-8 encoded string */ + const Py_UNICODE *object, + Py_ssize_t length, + Py_ssize_t start, + Py_ssize_t end, + const char *reason /* UTF-8 encoded string */ + ) Py_DEPRECATED(3.3); + +/* Create a UnicodeTranslateError object */ +PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_Create( + const Py_UNICODE *object, + Py_ssize_t length, + Py_ssize_t start, + Py_ssize_t end, + const char *reason /* UTF-8 encoded string */ + ) Py_DEPRECATED(3.3); +PyAPI_FUNC(PyObject *) _PyUnicodeTranslateError_Create( + PyObject *object, + Py_ssize_t start, + Py_ssize_t end, + const char *reason /* UTF-8 encoded string */ + ); + + +#ifdef __cplusplus +} +#endif diff --git a/Include/pyerrors.h b/Include/pyerrors.h index 808e0def06b4..efe1c49d2d08 100644 --- a/Include/pyerrors.h +++ b/Include/pyerrors.h @@ -4,82 +4,10 @@ extern "C" { #endif -/* Error objects */ - -#ifndef Py_LIMITED_API -/* PyException_HEAD defines the initial segment of every exception class. */ -#define PyException_HEAD PyObject_HEAD PyObject *dict;\ - PyObject *args; PyObject *traceback;\ - PyObject *context; PyObject *cause;\ - char suppress_context; - -typedef struct { - PyException_HEAD -} PyBaseExceptionObject; - -typedef struct { - PyException_HEAD - PyObject *msg; - PyObject *filename; - PyObject *lineno; - PyObject *offset; - PyObject *text; - PyObject *print_file_and_line; -} PySyntaxErrorObject; - -typedef struct { - PyException_HEAD - PyObject *msg; - PyObject *name; - PyObject *path; -} PyImportErrorObject; - -typedef struct { - PyException_HEAD - PyObject *encoding; - PyObject *object; - Py_ssize_t start; - Py_ssize_t end; - PyObject *reason; -} PyUnicodeErrorObject; - -typedef struct { - PyException_HEAD - PyObject *code; -} PySystemExitObject; - -typedef struct { - PyException_HEAD - PyObject *myerrno; - PyObject *strerror; - PyObject *filename; - PyObject *filename2; -#ifdef MS_WINDOWS - PyObject *winerror; -#endif - Py_ssize_t written; /* only for BlockingIOError, -1 otherwise */ -} PyOSErrorObject; - -typedef struct { - PyException_HEAD - PyObject *value; -} PyStopIterationObject; - -/* Compatibility typedefs */ -typedef PyOSErrorObject PyEnvironmentErrorObject; -#ifdef MS_WINDOWS -typedef PyOSErrorObject PyWindowsErrorObject; -#endif -#endif /* !Py_LIMITED_API */ - /* Error handling definitions */ PyAPI_FUNC(void) PyErr_SetNone(PyObject *); PyAPI_FUNC(void) PyErr_SetObject(PyObject *, PyObject *); -#ifndef Py_LIMITED_API -PyAPI_FUNC(void) _PyErr_SetKeyError(PyObject *); -_PyErr_StackItem *_PyErr_GetTopmostException(PyThreadState *tstate); -#endif PyAPI_FUNC(void) PyErr_SetString( PyObject *exception, const char *string /* decoded from utf-8 */ @@ -129,9 +57,6 @@ PyAPI_FUNC(void) PyException_SetCause(PyObject *, PyObject *); /* Context manipulation (PEP 3134) */ PyAPI_FUNC(PyObject *) PyException_GetContext(PyObject *); PyAPI_FUNC(void) PyException_SetContext(PyObject *, PyObject *); -#ifndef Py_LIMITED_API -PyAPI_FUNC(void) _PyErr_ChainExceptions(PyObject *, PyObject *, PyObject *); -#endif /* */ @@ -143,9 +68,6 @@ PyAPI_FUNC(void) _PyErr_ChainExceptions(PyObject *, PyObject *, PyObject *); PyType_FastSubclass((x)->ob_type, Py_TPFLAGS_BASE_EXC_SUBCLASS) PyAPI_FUNC(const char *) PyExceptionClass_Name(PyObject *); -#ifndef Py_LIMITED_API -#define PyExceptionClass_Name(x) (((PyTypeObject*)(x))->tp_name) -#endif #define PyExceptionInstance_Class(x) ((PyObject*)((x)->ob_type)) @@ -253,10 +175,6 @@ PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename( PyObject *exc, const char *filename /* decoded from the filesystem encoding */ ); -#if defined(MS_WINDOWS) && !defined(Py_LIMITED_API) -PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename( - PyObject *, const Py_UNICODE *) Py_DEPRECATED(3.3); -#endif /* MS_WINDOWS */ PyAPI_FUNC(PyObject *) PyErr_Format( PyObject *exception, @@ -270,27 +188,11 @@ PyAPI_FUNC(PyObject *) PyErr_FormatV( va_list vargs); #endif -#ifndef Py_LIMITED_API -/* Like PyErr_Format(), but saves current exception as __context__ and - __cause__. - */ -PyAPI_FUNC(PyObject *) _PyErr_FormatFromCause( - PyObject *exception, - const char *format, /* ASCII-encoded string */ - ... - ); -#endif - #ifdef MS_WINDOWS PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilename( int ierr, const char *filename /* decoded from the filesystem encoding */ ); -#ifndef Py_LIMITED_API -/* XXX redeclare to use WSTRING */ -PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithUnicodeFilename( - int, const Py_UNICODE *) Py_DEPRECATED(3.3); -#endif PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErr(int); PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilenameObject( PyObject *,int, PyObject *); @@ -303,10 +205,6 @@ PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilename( int ierr, const char *filename /* decoded from the filesystem encoding */ ); -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithUnicodeFilename( - PyObject *,int, const Py_UNICODE *) Py_DEPRECATED(3.3); -#endif PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErr(PyObject *, int); #endif /* MS_WINDOWS */ @@ -333,37 +231,11 @@ PyAPI_FUNC(PyObject *) PyErr_NewExceptionWithDoc( const char *name, const char *doc, PyObject *base, PyObject *dict); PyAPI_FUNC(void) PyErr_WriteUnraisable(PyObject *); -/* In exceptions.c */ -#ifndef Py_LIMITED_API -/* Helper that attempts to replace the current exception with one of the - * same type but with a prefix added to the exception text. The resulting - * exception description looks like: - * - * prefix (exc_type: original_exc_str) - * - * Only some exceptions can be safely replaced. If the function determines - * it isn't safe to perform the replacement, it will leave the original - * unmodified exception in place. - * - * Returns a borrowed reference to the new exception (if any), NULL if the - * existing exception was left in place. - */ -PyAPI_FUNC(PyObject *) _PyErr_TrySetFromCause( - const char *prefix_format, /* ASCII-encoded string */ - ... - ); -#endif - /* In signalmodule.c */ PyAPI_FUNC(int) PyErr_CheckSignals(void); PyAPI_FUNC(void) PyErr_SetInterrupt(void); -/* In signalmodule.c */ -#ifndef Py_LIMITED_API -int PySignal_SetWakeupFd(int fd); -#endif - /* Support for adding program text to SyntaxErrors */ PyAPI_FUNC(void) PyErr_SyntaxLocation( const char *filename, /* decoded from the filesystem encoding */ @@ -372,20 +244,9 @@ PyAPI_FUNC(void) PyErr_SyntaxLocationEx( const char *filename, /* decoded from the filesystem encoding */ int lineno, int col_offset); -#ifndef Py_LIMITED_API -PyAPI_FUNC(void) PyErr_SyntaxLocationObject( - PyObject *filename, - int lineno, - int col_offset); -#endif PyAPI_FUNC(PyObject *) PyErr_ProgramText( const char *filename, /* decoded from the filesystem encoding */ int lineno); -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject *) PyErr_ProgramTextObject( - PyObject *filename, - int lineno); -#endif /* The following functions are used to create and modify unicode exceptions from C */ @@ -400,35 +261,6 @@ PyAPI_FUNC(PyObject *) PyUnicodeDecodeError_Create( const char *reason /* UTF-8 encoded string */ ); -/* create a UnicodeEncodeError object */ -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_Create( - const char *encoding, /* UTF-8 encoded string */ - const Py_UNICODE *object, - Py_ssize_t length, - Py_ssize_t start, - Py_ssize_t end, - const char *reason /* UTF-8 encoded string */ - ) Py_DEPRECATED(3.3); -#endif - -/* create a UnicodeTranslateError object */ -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_Create( - const Py_UNICODE *object, - Py_ssize_t length, - Py_ssize_t start, - Py_ssize_t end, - const char *reason /* UTF-8 encoded string */ - ) Py_DEPRECATED(3.3); -PyAPI_FUNC(PyObject *) _PyUnicodeTranslateError_Create( - PyObject *object, - Py_ssize_t start, - Py_ssize_t end, - const char *reason /* UTF-8 encoded string */ - ); -#endif - /* get the encoding attribute */ PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_GetEncoding(PyObject *); PyAPI_FUNC(PyObject *) PyUnicodeDecodeError_GetEncoding(PyObject *); @@ -502,6 +334,12 @@ PyAPI_FUNC(int) PyOS_snprintf(char *str, size_t size, const char *format, ...) PyAPI_FUNC(int) PyOS_vsnprintf(char *str, size_t size, const char *format, va_list va) Py_GCC_ATTRIBUTE((format(printf, 3, 0))); +#ifndef Py_LIMITED_API +# define Py_CPYTHON_ERRORS_H +# include "cpython/pyerrors.h" +# undef Py_CPYTHON_ERRORS_H +#endif + #ifdef __cplusplus } #endif From webhook-mailer at python.org Mon Nov 26 16:29:49 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Mon, 26 Nov 2018 21:29:49 -0000 Subject: [Python-checkins] bpo-35308: Fix regression where BROWSER env var is not respected. (GH-10693) Message-ID: https://github.com/python/cpython/commit/8c281ed403fd915284d5bba2405d7c47f8195066 commit: 8c281ed403fd915284d5bba2405d7c47f8195066 branch: master author: Zhiming Wang committer: Serhiy Storchaka date: 2018-11-26T23:29:45+02:00 summary: bpo-35308: Fix regression where BROWSER env var is not respected. (GH-10693) Regression introduced in e3ce695 and 25b804a, where the old parameter update_tryorder to _synthesize was first ignored, then given the opposite value in the attempt to fix bpo-31014. files: A Misc/NEWS.d/next/Library/2018-11-24-10-33-42.bpo-35308.9--2iy.rst M Lib/test/test_webbrowser.py M Lib/webbrowser.py diff --git a/Lib/test/test_webbrowser.py b/Lib/test/test_webbrowser.py index 71f2e27467ee..519a9432abe0 100644 --- a/Lib/test/test_webbrowser.py +++ b/Lib/test/test_webbrowser.py @@ -309,6 +309,24 @@ def test_environment(self): webbrowser = support.import_fresh_module('webbrowser') webbrowser.get() + def test_environment_preferred(self): + webbrowser = support.import_fresh_module('webbrowser') + try: + webbrowser.get() + least_preferred_browser = webbrowser.get(webbrowser._tryorder[-1]).name + except (webbrowser.Error, AttributeError, IndexError) as err: + self.skipTest(str(err)) + + with support.EnvironmentVarGuard() as env: + env["BROWSER"] = least_preferred_browser + webbrowser = support.import_fresh_module('webbrowser') + self.assertEqual(webbrowser.get().name, least_preferred_browser) + + with support.EnvironmentVarGuard() as env: + env["BROWSER"] = sys.executable + webbrowser = support.import_fresh_module('webbrowser') + self.assertEqual(webbrowser.get().name, sys.executable) + if __name__=='__main__': unittest.main() diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py index 1e27c83fd947..82bff835fdd0 100755 --- a/Lib/webbrowser.py +++ b/Lib/webbrowser.py @@ -86,7 +86,7 @@ def open_new_tab(url): return open(url, 2) -def _synthesize(browser, *, preferred=True): +def _synthesize(browser, *, preferred=False): """Attempt to synthesize a controller base on existing controllers. This is useful to create a controller when a user specifies a path to @@ -563,7 +563,7 @@ def register_standard_browsers(): # and prepend to _tryorder for cmdline in userchoices: if cmdline != '': - cmd = _synthesize(cmdline, preferred=False) + cmd = _synthesize(cmdline, preferred=True) if cmd[1] is None: register(cmdline, None, GenericBrowser(cmdline), preferred=True) diff --git a/Misc/NEWS.d/next/Library/2018-11-24-10-33-42.bpo-35308.9--2iy.rst b/Misc/NEWS.d/next/Library/2018-11-24-10-33-42.bpo-35308.9--2iy.rst new file mode 100644 index 000000000000..a33fe2e4812b --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-11-24-10-33-42.bpo-35308.9--2iy.rst @@ -0,0 +1,2 @@ +Fix regression in ``webbrowser`` where default browsers may be preferred +over browsers in the ``BROWSER`` environment variable. From webhook-mailer at python.org Mon Nov 26 16:42:09 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 26 Nov 2018 21:42:09 -0000 Subject: [Python-checkins] bpo-35134: Create Include/cpython/abstract.h (GH-10728) Message-ID: https://github.com/python/cpython/commit/4060283fcec7bb2bde4eb3c42b0a6ec99cf1d391 commit: 4060283fcec7bb2bde4eb3c42b0a6ec99cf1d391 branch: master author: Victor Stinner committer: GitHub date: 2018-11-26T22:42:04+01:00 summary: bpo-35134: Create Include/cpython/abstract.h (GH-10728) Move abstract.h code surrounded by "#ifndef Py_LIMITED_API" to a new Include/cpython/abstract.h header file. files: A Include/cpython/abstract.h M Include/abstract.h diff --git a/Include/abstract.h b/Include/abstract.h index 85550a34ca26..79002a76a8c8 100644 --- a/Include/abstract.h +++ b/Include/abstract.h @@ -138,9 +138,6 @@ extern "C" { #ifdef PY_SSIZE_T_CLEAN # define PyObject_CallFunction _PyObject_CallFunction_SizeT # define PyObject_CallMethod _PyObject_CallMethod_SizeT -# ifndef Py_LIMITED_API -# define _PyObject_CallMethodId _PyObject_CallMethodId_SizeT -# endif /* !Py_LIMITED_API */ #endif @@ -155,123 +152,6 @@ extern "C" { PyAPI_FUNC(PyObject *) PyObject_Call(PyObject *callable, PyObject *args, PyObject *kwargs); -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject*) _PyStack_AsTuple( - PyObject *const *stack, - Py_ssize_t nargs); - -PyAPI_FUNC(PyObject*) _PyStack_AsTupleSlice( - PyObject *const *stack, - Py_ssize_t nargs, - Py_ssize_t start, - Py_ssize_t end); - -/* Convert keyword arguments from the FASTCALL (stack: C array, kwnames: tuple) - format to a Python dictionary ("kwargs" dict). - - The type of kwnames keys is not checked. The final function getting - arguments is responsible to check if all keys are strings, for example using - PyArg_ParseTupleAndKeywords() or PyArg_ValidateKeywordArguments(). - - Duplicate keys are merged using the last value. If duplicate keys must raise - an exception, the caller is responsible to implement an explicit keys on - kwnames. */ -PyAPI_FUNC(PyObject *) _PyStack_AsDict( - PyObject *const *values, - PyObject *kwnames); - -/* Convert (args, nargs, kwargs: dict) into a (stack, nargs, kwnames: tuple). - - Return 0 on success, raise an exception and return -1 on error. - - Write the new stack into *p_stack. If *p_stack is differen than args, it - must be released by PyMem_Free(). - - The stack uses borrowed references. - - The type of keyword keys is not checked, these checks should be done - later (ex: _PyArg_ParseStackAndKeywords). */ -PyAPI_FUNC(int) _PyStack_UnpackDict( - PyObject *const *args, - Py_ssize_t nargs, - PyObject *kwargs, - PyObject *const **p_stack, - PyObject **p_kwnames); - -/* Suggested size (number of positional arguments) for arrays of PyObject* - allocated on a C stack to avoid allocating memory on the heap memory. Such - array is used to pass positional arguments to call functions of the - _PyObject_FastCall() family. - - The size is chosen to not abuse the C stack and so limit the risk of stack - overflow. The size is also chosen to allow using the small stack for most - function calls of the Python standard library. On 64-bit CPU, it allocates - 40 bytes on the stack. */ -#define _PY_FASTCALL_SMALL_STACK 5 - -/* Return 1 if callable supports FASTCALL calling convention for positional - arguments: see _PyObject_FastCallDict() and _PyObject_FastCallKeywords() */ -PyAPI_FUNC(int) _PyObject_HasFastCall(PyObject *callable); - -/* Call the callable object 'callable' with the "fast call" calling convention: - args is a C array for positional arguments (nargs is the number of - positional arguments), kwargs is a dictionary for keyword arguments. - - If nargs is equal to zero, args can be NULL. kwargs can be NULL. - nargs must be greater or equal to zero. - - Return the result on success. Raise an exception on return NULL on - error. */ -PyAPI_FUNC(PyObject *) _PyObject_FastCallDict( - PyObject *callable, - PyObject *const *args, - Py_ssize_t nargs, - PyObject *kwargs); - -/* Call the callable object 'callable' with the "fast call" calling convention: - args is a C array for positional arguments followed by values of - keyword arguments. Keys of keyword arguments are stored as a tuple - of strings in kwnames. nargs is the number of positional parameters at - the beginning of stack. The size of kwnames gives the number of keyword - values in the stack after positional arguments. - - kwnames must only contains str strings, no subclass, and all keys must - be unique. - - If nargs is equal to zero and there is no keyword argument (kwnames is - NULL or its size is zero), args can be NULL. - - Return the result on success. Raise an exception and return NULL on - error. */ -PyAPI_FUNC(PyObject *) _PyObject_FastCallKeywords( - PyObject *callable, - PyObject *const *args, - Py_ssize_t nargs, - PyObject *kwnames); - -#define _PyObject_FastCall(func, args, nargs) \ - _PyObject_FastCallDict((func), (args), (nargs), NULL) - -#define _PyObject_CallNoArg(func) \ - _PyObject_FastCallDict((func), NULL, 0, NULL) - -PyAPI_FUNC(PyObject *) _PyObject_Call_Prepend( - PyObject *callable, - PyObject *obj, - PyObject *args, - PyObject *kwargs); - -PyAPI_FUNC(PyObject *) _PyObject_FastCall_Prepend( - PyObject *callable, - PyObject *obj, - PyObject *const *args, - Py_ssize_t nargs); - -PyAPI_FUNC(PyObject *) _Py_CheckFunctionResult(PyObject *callable, - PyObject *result, - const char *where); -#endif /* Py_LIMITED_API */ - /* Call a callable Python object 'callable', with arguments given by the tuple 'args'. If no arguments are needed, then 'args' can be *NULL*. @@ -309,14 +189,6 @@ PyAPI_FUNC(PyObject *) PyObject_CallMethod(PyObject *obj, const char *name, const char *format, ...); -#ifndef Py_LIMITED_API -/* Like PyObject_CallMethod(), but expect a _Py_Identifier* - as the method name. */ -PyAPI_FUNC(PyObject *) _PyObject_CallMethodId(PyObject *obj, - _Py_Identifier *name, - const char *format, ...); -#endif /* !Py_LIMITED_API */ - PyAPI_FUNC(PyObject *) _PyObject_CallFunction_SizeT(PyObject *callable, const char *format, ...); @@ -326,13 +198,6 @@ PyAPI_FUNC(PyObject *) _PyObject_CallMethod_SizeT(PyObject *obj, const char *format, ...); -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject *) _PyObject_CallMethodId_SizeT(PyObject *obj, - _Py_Identifier *name, - const char *format, - ...); -#endif /* !Py_LIMITED_API */ - /* Call a callable Python object 'callable' with a variable number of C arguments. The C arguments are provided as PyObject* values, terminated by a NULL. @@ -357,13 +222,6 @@ PyAPI_FUNC(PyObject *) PyObject_CallMethodObjArgs( PyObject *name, ...); -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject *) _PyObject_CallMethodIdObjArgs( - PyObject *obj, - struct _Py_Identifier *name, - ...); -#endif /* !Py_LIMITED_API */ - /* Implemented elsewhere: @@ -418,16 +276,6 @@ PyAPI_FUNC(Py_ssize_t) PyObject_Size(PyObject *o); PyAPI_FUNC(Py_ssize_t) PyObject_Length(PyObject *o); #define PyObject_Length PyObject_Size - -#ifndef Py_LIMITED_API -PyAPI_FUNC(int) _PyObject_HasLen(PyObject *o); - -/* Guess the size of object 'o' using len(o) or o.__length_hint__(). - If neither of those return a non-negative value, then return the default - value. If one of the calls fails, this function returns -1. */ -PyAPI_FUNC(Py_ssize_t) PyObject_LengthHint(PyObject *o, Py_ssize_t); -#endif - /* Return element of 'o' corresponding to the object 'key'. Return NULL on failure. @@ -505,78 +353,6 @@ PyAPI_FUNC(int) PyObject_AsWriteBuffer(PyObject *obj, /* === New Buffer API ============================================ */ -#ifndef Py_LIMITED_API - -/* Return 1 if the getbuffer function is available, otherwise return 0. */ -#define PyObject_CheckBuffer(obj) \ - (((obj)->ob_type->tp_as_buffer != NULL) && \ - ((obj)->ob_type->tp_as_buffer->bf_getbuffer != NULL)) - -/* This is a C-API version of the getbuffer function call. It checks - to make sure object has the required function pointer and issues the - call. - - Returns -1 and raises an error on failure and returns 0 on success. */ -PyAPI_FUNC(int) PyObject_GetBuffer(PyObject *obj, Py_buffer *view, - int flags); - -/* Get the memory area pointed to by the indices for the buffer given. - Note that view->ndim is the assumed size of indices. */ -PyAPI_FUNC(void *) PyBuffer_GetPointer(Py_buffer *view, Py_ssize_t *indices); - -/* Return the implied itemsize of the data-format area from a - struct-style description. */ -PyAPI_FUNC(int) PyBuffer_SizeFromFormat(const char *); - -/* Implementation in memoryobject.c */ -PyAPI_FUNC(int) PyBuffer_ToContiguous(void *buf, Py_buffer *view, - Py_ssize_t len, char order); - -PyAPI_FUNC(int) PyBuffer_FromContiguous(Py_buffer *view, void *buf, - Py_ssize_t len, char order); - -/* Copy len bytes of data from the contiguous chunk of memory - pointed to by buf into the buffer exported by obj. Return - 0 on success and return -1 and raise a PyBuffer_Error on - error (i.e. the object does not have a buffer interface or - it is not working). - - If fort is 'F', then if the object is multi-dimensional, - then the data will be copied into the array in - Fortran-style (first dimension varies the fastest). If - fort is 'C', then the data will be copied into the array - in C-style (last dimension varies the fastest). If fort - is 'A', then it does not matter and the copy will be made - in whatever way is more efficient. */ -PyAPI_FUNC(int) PyObject_CopyData(PyObject *dest, PyObject *src); - -/* Copy the data from the src buffer to the buffer of destination. */ -PyAPI_FUNC(int) PyBuffer_IsContiguous(const Py_buffer *view, char fort); - -/*Fill the strides array with byte-strides of a contiguous - (Fortran-style if fort is 'F' or C-style otherwise) - array of the given shape with the given number of bytes - per element. */ -PyAPI_FUNC(void) PyBuffer_FillContiguousStrides(int ndims, - Py_ssize_t *shape, - Py_ssize_t *strides, - int itemsize, - char fort); - -/* Fills in a buffer-info structure correctly for an exporter - that can only share a contiguous chunk of memory of - "unsigned bytes" of the given length. - - Returns 0 on success and -1 (with raising an error) on error. */ -PyAPI_FUNC(int) PyBuffer_FillInfo(Py_buffer *view, PyObject *o, void *buf, - Py_ssize_t len, int readonly, - int flags); - -/* Releases a Py_buffer obtained from getbuffer ParseTuple's "s*". */ -PyAPI_FUNC(void) PyBuffer_Release(Py_buffer *view); - -#endif /* Py_LIMITED_API */ - /* Takes an arbitrary object and returns the result of calling obj.__format__(format_spec). */ PyAPI_FUNC(PyObject *) PyObject_Format(PyObject *obj, @@ -594,11 +370,6 @@ PyAPI_FUNC(PyObject *) PyObject_GetIter(PyObject *); This function always succeeds. */ PyAPI_FUNC(int) PyIter_Check(PyObject *); -#ifndef Py_LIMITED_API -#define PyIter_Check(obj) \ - ((obj)->ob_type->tp_iternext != NULL && \ - (obj)->ob_type->tp_iternext != &_PyObject_NextNotImplemented) -#endif /* Takes an iterator object and calls its tp_iternext slot, returning the next value. @@ -719,11 +490,6 @@ PyAPI_FUNC(PyObject *) PyNumber_Or(PyObject *o1, PyObject *o2); /* Returns 1 if obj is an index integer (has the nb_index slot of the tp_as_number structure filled in), and 0 otherwise. */ PyAPI_FUNC(int) PyIndex_Check(PyObject *); -#ifndef Py_LIMITED_API -#define PyIndex_Check(obj) \ - ((obj)->ob_type->tp_as_number != NULL && \ - (obj)->ob_type->tp_as_number->nb_index != NULL) -#endif /* Returns the object 'o' converted to a Python int, or NULL with an exception raised on failure. */ @@ -930,13 +696,6 @@ PyAPI_FUNC(PyObject *) PySequence_Fast(PyObject *o, const char* m); #define PySequence_Fast_GET_ITEM(o, i)\ (PyList_Check(o) ? PyList_GET_ITEM(o, i) : PyTuple_GET_ITEM(o, i)) -/* Assume tp_as_sequence and sq_item exist and that 'i' does not - need to be corrected for a negative index. */ -#ifndef Py_LIMITED_API -#define PySequence_ITEM(o, i)\ - ( Py_TYPE(o)->tp_as_sequence->sq_item(o, i) ) -#endif - /* Return a pointer to the underlying item array for an object retured by PySequence_Fast */ #define PySequence_Fast_ITEMS(sf) \ @@ -956,27 +715,6 @@ PyAPI_FUNC(Py_ssize_t) PySequence_Count(PyObject *o, PyObject *value); Use __contains__ if possible, else _PySequence_IterSearch(). */ PyAPI_FUNC(int) PySequence_Contains(PyObject *seq, PyObject *ob); -#ifndef Py_LIMITED_API -#define PY_ITERSEARCH_COUNT 1 -#define PY_ITERSEARCH_INDEX 2 -#define PY_ITERSEARCH_CONTAINS 3 - -/* Iterate over seq. - - Result depends on the operation: - - PY_ITERSEARCH_COUNT: return # of times obj appears in seq; -1 if - error. - PY_ITERSEARCH_INDEX: return 0-based index of first occurrence of - obj in seq; set ValueError and return -1 if none found; - also return -1 on error. - PY_ITERSEARCH_CONTAINS: return 1 if obj in seq, else 0; -1 on - error. */ -PyAPI_FUNC(Py_ssize_t) _PySequence_IterSearch(PyObject *seq, - PyObject *obj, int operation); -#endif - - /* For DLL-level backwards compatibility */ #undef PySequence_In /* Determine if the sequence 'o' contains 'value'. If an item in 'o' is equal @@ -1095,26 +833,11 @@ PyAPI_FUNC(int) PyObject_IsInstance(PyObject *object, PyObject *typeorclass); /* issubclass(object, typeorclass) */ PyAPI_FUNC(int) PyObject_IsSubclass(PyObject *object, PyObject *typeorclass); - #ifndef Py_LIMITED_API -PyAPI_FUNC(int) _PyObject_RealIsInstance(PyObject *inst, PyObject *cls); - -PyAPI_FUNC(int) _PyObject_RealIsSubclass(PyObject *derived, PyObject *cls); - -PyAPI_FUNC(char *const *) _PySequence_BytesToCharpArray(PyObject* self); - -PyAPI_FUNC(void) _Py_FreeCharPArray(char *const array[]); - -/* For internal use by buffer API functions */ -PyAPI_FUNC(void) _Py_add_one_to_index_F(int nd, Py_ssize_t *index, - const Py_ssize_t *shape); -PyAPI_FUNC(void) _Py_add_one_to_index_C(int nd, Py_ssize_t *index, - const Py_ssize_t *shape); - -/* Convert Python int to Py_ssize_t. Do nothing if the argument is None. */ -PyAPI_FUNC(int) _Py_convert_optional_to_ssize_t(PyObject *, void *); -#endif /* !Py_LIMITED_API */ - +# define Py_CPYTHON_ABSTRACTOBJECT_H +# include "cpython/abstract.h" +# undef Py_CPYTHON_ABSTRACTOBJECT_H +#endif #ifdef __cplusplus } diff --git a/Include/cpython/abstract.h b/Include/cpython/abstract.h new file mode 100644 index 000000000000..0e002659f6bf --- /dev/null +++ b/Include/cpython/abstract.h @@ -0,0 +1,281 @@ +#ifndef Py_CPYTHON_ABSTRACTOBJECT_H +# error "this header file must not be included directly" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* === Object Protocol ================================================== */ + +#ifdef PY_SSIZE_T_CLEAN +# define _PyObject_CallMethodId _PyObject_CallMethodId_SizeT +#endif + +PyAPI_FUNC(PyObject*) _PyStack_AsTuple( + PyObject *const *stack, + Py_ssize_t nargs); + +PyAPI_FUNC(PyObject*) _PyStack_AsTupleSlice( + PyObject *const *stack, + Py_ssize_t nargs, + Py_ssize_t start, + Py_ssize_t end); + +/* Convert keyword arguments from the FASTCALL (stack: C array, kwnames: tuple) + format to a Python dictionary ("kwargs" dict). + + The type of kwnames keys is not checked. The final function getting + arguments is responsible to check if all keys are strings, for example using + PyArg_ParseTupleAndKeywords() or PyArg_ValidateKeywordArguments(). + + Duplicate keys are merged using the last value. If duplicate keys must raise + an exception, the caller is responsible to implement an explicit keys on + kwnames. */ +PyAPI_FUNC(PyObject *) _PyStack_AsDict( + PyObject *const *values, + PyObject *kwnames); + +/* Convert (args, nargs, kwargs: dict) into a (stack, nargs, kwnames: tuple). + + Return 0 on success, raise an exception and return -1 on error. + + Write the new stack into *p_stack. If *p_stack is differen than args, it + must be released by PyMem_Free(). + + The stack uses borrowed references. + + The type of keyword keys is not checked, these checks should be done + later (ex: _PyArg_ParseStackAndKeywords). */ +PyAPI_FUNC(int) _PyStack_UnpackDict( + PyObject *const *args, + Py_ssize_t nargs, + PyObject *kwargs, + PyObject *const **p_stack, + PyObject **p_kwnames); + +/* Suggested size (number of positional arguments) for arrays of PyObject* + allocated on a C stack to avoid allocating memory on the heap memory. Such + array is used to pass positional arguments to call functions of the + _PyObject_FastCall() family. + + The size is chosen to not abuse the C stack and so limit the risk of stack + overflow. The size is also chosen to allow using the small stack for most + function calls of the Python standard library. On 64-bit CPU, it allocates + 40 bytes on the stack. */ +#define _PY_FASTCALL_SMALL_STACK 5 + +/* Return 1 if callable supports FASTCALL calling convention for positional + arguments: see _PyObject_FastCallDict() and _PyObject_FastCallKeywords() */ +PyAPI_FUNC(int) _PyObject_HasFastCall(PyObject *callable); + +/* Call the callable object 'callable' with the "fast call" calling convention: + args is a C array for positional arguments (nargs is the number of + positional arguments), kwargs is a dictionary for keyword arguments. + + If nargs is equal to zero, args can be NULL. kwargs can be NULL. + nargs must be greater or equal to zero. + + Return the result on success. Raise an exception on return NULL on + error. */ +PyAPI_FUNC(PyObject *) _PyObject_FastCallDict( + PyObject *callable, + PyObject *const *args, + Py_ssize_t nargs, + PyObject *kwargs); + +/* Call the callable object 'callable' with the "fast call" calling convention: + args is a C array for positional arguments followed by values of + keyword arguments. Keys of keyword arguments are stored as a tuple + of strings in kwnames. nargs is the number of positional parameters at + the beginning of stack. The size of kwnames gives the number of keyword + values in the stack after positional arguments. + + kwnames must only contains str strings, no subclass, and all keys must + be unique. + + If nargs is equal to zero and there is no keyword argument (kwnames is + NULL or its size is zero), args can be NULL. + + Return the result on success. Raise an exception and return NULL on + error. */ +PyAPI_FUNC(PyObject *) _PyObject_FastCallKeywords( + PyObject *callable, + PyObject *const *args, + Py_ssize_t nargs, + PyObject *kwnames); + +#define _PyObject_FastCall(func, args, nargs) \ + _PyObject_FastCallDict((func), (args), (nargs), NULL) + +#define _PyObject_CallNoArg(func) \ + _PyObject_FastCallDict((func), NULL, 0, NULL) + +PyAPI_FUNC(PyObject *) _PyObject_Call_Prepend( + PyObject *callable, + PyObject *obj, + PyObject *args, + PyObject *kwargs); + +PyAPI_FUNC(PyObject *) _PyObject_FastCall_Prepend( + PyObject *callable, + PyObject *obj, + PyObject *const *args, + Py_ssize_t nargs); + +PyAPI_FUNC(PyObject *) _Py_CheckFunctionResult(PyObject *callable, + PyObject *result, + const char *where); + +/* Like PyObject_CallMethod(), but expect a _Py_Identifier* + as the method name. */ +PyAPI_FUNC(PyObject *) _PyObject_CallMethodId(PyObject *obj, + _Py_Identifier *name, + const char *format, ...); + +PyAPI_FUNC(PyObject *) _PyObject_CallMethodId_SizeT(PyObject *obj, + _Py_Identifier *name, + const char *format, + ...); + +PyAPI_FUNC(PyObject *) _PyObject_CallMethodIdObjArgs( + PyObject *obj, + struct _Py_Identifier *name, + ...); + +PyAPI_FUNC(int) _PyObject_HasLen(PyObject *o); + +/* Guess the size of object 'o' using len(o) or o.__length_hint__(). + If neither of those return a non-negative value, then return the default + value. If one of the calls fails, this function returns -1. */ +PyAPI_FUNC(Py_ssize_t) PyObject_LengthHint(PyObject *o, Py_ssize_t); + +/* === New Buffer API ============================================ */ + +/* Return 1 if the getbuffer function is available, otherwise return 0. */ +#define PyObject_CheckBuffer(obj) \ + (((obj)->ob_type->tp_as_buffer != NULL) && \ + ((obj)->ob_type->tp_as_buffer->bf_getbuffer != NULL)) + +/* This is a C-API version of the getbuffer function call. It checks + to make sure object has the required function pointer and issues the + call. + + Returns -1 and raises an error on failure and returns 0 on success. */ +PyAPI_FUNC(int) PyObject_GetBuffer(PyObject *obj, Py_buffer *view, + int flags); + +/* Get the memory area pointed to by the indices for the buffer given. + Note that view->ndim is the assumed size of indices. */ +PyAPI_FUNC(void *) PyBuffer_GetPointer(Py_buffer *view, Py_ssize_t *indices); + +/* Return the implied itemsize of the data-format area from a + struct-style description. */ +PyAPI_FUNC(int) PyBuffer_SizeFromFormat(const char *); + +/* Implementation in memoryobject.c */ +PyAPI_FUNC(int) PyBuffer_ToContiguous(void *buf, Py_buffer *view, + Py_ssize_t len, char order); + +PyAPI_FUNC(int) PyBuffer_FromContiguous(Py_buffer *view, void *buf, + Py_ssize_t len, char order); + +/* Copy len bytes of data from the contiguous chunk of memory + pointed to by buf into the buffer exported by obj. Return + 0 on success and return -1 and raise a PyBuffer_Error on + error (i.e. the object does not have a buffer interface or + it is not working). + + If fort is 'F', then if the object is multi-dimensional, + then the data will be copied into the array in + Fortran-style (first dimension varies the fastest). If + fort is 'C', then the data will be copied into the array + in C-style (last dimension varies the fastest). If fort + is 'A', then it does not matter and the copy will be made + in whatever way is more efficient. */ +PyAPI_FUNC(int) PyObject_CopyData(PyObject *dest, PyObject *src); + +/* Copy the data from the src buffer to the buffer of destination. */ +PyAPI_FUNC(int) PyBuffer_IsContiguous(const Py_buffer *view, char fort); + +/*Fill the strides array with byte-strides of a contiguous + (Fortran-style if fort is 'F' or C-style otherwise) + array of the given shape with the given number of bytes + per element. */ +PyAPI_FUNC(void) PyBuffer_FillContiguousStrides(int ndims, + Py_ssize_t *shape, + Py_ssize_t *strides, + int itemsize, + char fort); + +/* Fills in a buffer-info structure correctly for an exporter + that can only share a contiguous chunk of memory of + "unsigned bytes" of the given length. + + Returns 0 on success and -1 (with raising an error) on error. */ +PyAPI_FUNC(int) PyBuffer_FillInfo(Py_buffer *view, PyObject *o, void *buf, + Py_ssize_t len, int readonly, + int flags); + +/* Releases a Py_buffer obtained from getbuffer ParseTuple's "s*". */ +PyAPI_FUNC(void) PyBuffer_Release(Py_buffer *view); + +/* ==== Iterators ================================================ */ + +#define PyIter_Check(obj) \ + ((obj)->ob_type->tp_iternext != NULL && \ + (obj)->ob_type->tp_iternext != &_PyObject_NextNotImplemented) + +/* === Number Protocol ================================================== */ + +#define PyIndex_Check(obj) \ + ((obj)->ob_type->tp_as_number != NULL && \ + (obj)->ob_type->tp_as_number->nb_index != NULL) + +/* === Sequence protocol ================================================ */ + +/* Assume tp_as_sequence and sq_item exist and that 'i' does not + need to be corrected for a negative index. */ +#define PySequence_ITEM(o, i)\ + ( Py_TYPE(o)->tp_as_sequence->sq_item(o, i) ) + +#define PY_ITERSEARCH_COUNT 1 +#define PY_ITERSEARCH_INDEX 2 +#define PY_ITERSEARCH_CONTAINS 3 + +/* Iterate over seq. + + Result depends on the operation: + + PY_ITERSEARCH_COUNT: return # of times obj appears in seq; -1 if + error. + PY_ITERSEARCH_INDEX: return 0-based index of first occurrence of + obj in seq; set ValueError and return -1 if none found; + also return -1 on error. + PY_ITERSEARCH_CONTAINS: return 1 if obj in seq, else 0; -1 on + error. */ +PyAPI_FUNC(Py_ssize_t) _PySequence_IterSearch(PyObject *seq, + PyObject *obj, int operation); + +/* === Mapping protocol ================================================= */ + +PyAPI_FUNC(int) _PyObject_RealIsInstance(PyObject *inst, PyObject *cls); + +PyAPI_FUNC(int) _PyObject_RealIsSubclass(PyObject *derived, PyObject *cls); + +PyAPI_FUNC(char *const *) _PySequence_BytesToCharpArray(PyObject* self); + +PyAPI_FUNC(void) _Py_FreeCharPArray(char *const array[]); + +/* For internal use by buffer API functions */ +PyAPI_FUNC(void) _Py_add_one_to_index_F(int nd, Py_ssize_t *index, + const Py_ssize_t *shape); +PyAPI_FUNC(void) _Py_add_one_to_index_C(int nd, Py_ssize_t *index, + const Py_ssize_t *shape); + +/* Convert Python int to Py_ssize_t. Do nothing if the argument is None. */ +PyAPI_FUNC(int) _Py_convert_optional_to_ssize_t(PyObject *, void *); + +#ifdef __cplusplus +} +#endif From webhook-mailer at python.org Mon Nov 26 16:49:34 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 26 Nov 2018 21:49:34 -0000 Subject: [Python-checkins] bpo-35308: Fix regression where BROWSER env var is not respected. (GH-10693) Message-ID: https://github.com/python/cpython/commit/2a37f013ec81099a6156160ce66803b2609bb7f4 commit: 2a37f013ec81099a6156160ce66803b2609bb7f4 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-26T13:49:28-08:00 summary: bpo-35308: Fix regression where BROWSER env var is not respected. (GH-10693) Regression introduced in e3ce695 and 25b804a, where the old parameter update_tryorder to _synthesize was first ignored, then given the opposite value in the attempt to fix bpo-31014. (cherry picked from commit 8c281ed403fd915284d5bba2405d7c47f8195066) Co-authored-by: Zhiming Wang files: A Misc/NEWS.d/next/Library/2018-11-24-10-33-42.bpo-35308.9--2iy.rst M Lib/test/test_webbrowser.py M Lib/webbrowser.py diff --git a/Lib/test/test_webbrowser.py b/Lib/test/test_webbrowser.py index 71f2e27467ee..519a9432abe0 100644 --- a/Lib/test/test_webbrowser.py +++ b/Lib/test/test_webbrowser.py @@ -309,6 +309,24 @@ def test_environment(self): webbrowser = support.import_fresh_module('webbrowser') webbrowser.get() + def test_environment_preferred(self): + webbrowser = support.import_fresh_module('webbrowser') + try: + webbrowser.get() + least_preferred_browser = webbrowser.get(webbrowser._tryorder[-1]).name + except (webbrowser.Error, AttributeError, IndexError) as err: + self.skipTest(str(err)) + + with support.EnvironmentVarGuard() as env: + env["BROWSER"] = least_preferred_browser + webbrowser = support.import_fresh_module('webbrowser') + self.assertEqual(webbrowser.get().name, least_preferred_browser) + + with support.EnvironmentVarGuard() as env: + env["BROWSER"] = sys.executable + webbrowser = support.import_fresh_module('webbrowser') + self.assertEqual(webbrowser.get().name, sys.executable) + if __name__=='__main__': unittest.main() diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py index 1e27c83fd947..82bff835fdd0 100755 --- a/Lib/webbrowser.py +++ b/Lib/webbrowser.py @@ -86,7 +86,7 @@ def open_new_tab(url): return open(url, 2) -def _synthesize(browser, *, preferred=True): +def _synthesize(browser, *, preferred=False): """Attempt to synthesize a controller base on existing controllers. This is useful to create a controller when a user specifies a path to @@ -563,7 +563,7 @@ def register_standard_browsers(): # and prepend to _tryorder for cmdline in userchoices: if cmdline != '': - cmd = _synthesize(cmdline, preferred=False) + cmd = _synthesize(cmdline, preferred=True) if cmd[1] is None: register(cmdline, None, GenericBrowser(cmdline), preferred=True) diff --git a/Misc/NEWS.d/next/Library/2018-11-24-10-33-42.bpo-35308.9--2iy.rst b/Misc/NEWS.d/next/Library/2018-11-24-10-33-42.bpo-35308.9--2iy.rst new file mode 100644 index 000000000000..a33fe2e4812b --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-11-24-10-33-42.bpo-35308.9--2iy.rst @@ -0,0 +1,2 @@ +Fix regression in ``webbrowser`` where default browsers may be preferred +over browsers in the ``BROWSER`` environment variable. From webhook-mailer at python.org Mon Nov 26 18:12:11 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 26 Nov 2018 23:12:11 -0000 Subject: [Python-checkins] bpo-35134: Create Include/cpython/pylifecycle.h (GH-10731) Message-ID: https://github.com/python/cpython/commit/dd12aa0aea733820807ec4f99e4e476064a0ee41 commit: dd12aa0aea733820807ec4f99e4e476064a0ee41 branch: master author: Victor Stinner committer: GitHub date: 2018-11-27T00:12:05+01:00 summary: bpo-35134: Create Include/cpython/pylifecycle.h (GH-10731) Move pylifecycle.h code surrounded by "#ifndef Py_LIMITED_API" to a new Include/cpython/pylifecycle.h header file. files: A Include/cpython/pylifecycle.h M Include/pylifecycle.h diff --git a/Include/cpython/pylifecycle.h b/Include/cpython/pylifecycle.h new file mode 100644 index 000000000000..3009c4f10d3a --- /dev/null +++ b/Include/cpython/pylifecycle.h @@ -0,0 +1,99 @@ +#ifndef Py_CPYTHON_PYLIFECYCLE_H +# error "this header file must not be included directly" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* Only used by applications that embed the interpreter and need to + * override the standard encoding determination mechanism + */ +PyAPI_FUNC(int) Py_SetStandardStreamEncoding(const char *encoding, + const char *errors); + +/* PEP 432 Multi-phase initialization API (Private while provisional!) */ + +PyAPI_FUNC(_PyInitError) _Py_InitializeCore( + PyInterpreterState **interp, + const _PyCoreConfig *); +PyAPI_FUNC(int) _Py_IsCoreInitialized(void); + + +PyAPI_FUNC(_PyInitError) _PyMainInterpreterConfig_Read( + _PyMainInterpreterConfig *config, + const _PyCoreConfig *core_config); +PyAPI_FUNC(void) _PyMainInterpreterConfig_Clear(_PyMainInterpreterConfig *); +PyAPI_FUNC(int) _PyMainInterpreterConfig_Copy( + _PyMainInterpreterConfig *config, + const _PyMainInterpreterConfig *config2); +/* Used by _testcapi.get_main_config() */ +PyAPI_FUNC(PyObject*) _PyMainInterpreterConfig_AsDict( + const _PyMainInterpreterConfig *config); + +PyAPI_FUNC(_PyInitError) _Py_InitializeMainInterpreter( + PyInterpreterState *interp, + const _PyMainInterpreterConfig *); + +/* Initialization and finalization */ + +PyAPI_FUNC(_PyInitError) _Py_InitializeFromConfig( + const _PyCoreConfig *config); +PyAPI_FUNC(void) _Py_NO_RETURN _Py_FatalInitError(_PyInitError err); + +/* Py_PyAtExit is for the atexit module, Py_AtExit is for low-level + * exit functions. + */ +PyAPI_FUNC(void) _Py_PyAtExit(void (*func)(PyObject *), PyObject *); + +/* Restore signals that the interpreter has called SIG_IGN on to SIG_DFL. */ +PyAPI_FUNC(void) _Py_RestoreSignals(void); + +PyAPI_FUNC(int) Py_FdIsInteractive(FILE *, const char *); + +PyAPI_FUNC(void) _Py_SetProgramFullPath(const wchar_t *); + +PyAPI_FUNC(const char *) _Py_gitidentifier(void); +PyAPI_FUNC(const char *) _Py_gitversion(void); + +/* Internal -- various one-time initializations */ +PyAPI_FUNC(PyObject *) _PyBuiltin_Init(void); +PyAPI_FUNC(_PyInitError) _PySys_BeginInit(PyObject **sysmod); +PyAPI_FUNC(int) _PySys_EndInit(PyObject *sysdict, PyInterpreterState *interp); +PyAPI_FUNC(_PyInitError) _PyImport_Init(PyInterpreterState *interp); +PyAPI_FUNC(void) _PyExc_Init(PyObject * bltinmod); +PyAPI_FUNC(_PyInitError) _PyImportHooks_Init(void); +PyAPI_FUNC(int) _PyFloat_Init(void); +PyAPI_FUNC(int) PyByteArray_Init(void); +PyAPI_FUNC(_PyInitError) _Py_HashRandomization_Init(const _PyCoreConfig *); + +/* Various internal finalizers */ + +PyAPI_FUNC(void) PyMethod_Fini(void); +PyAPI_FUNC(void) PyFrame_Fini(void); +PyAPI_FUNC(void) PyCFunction_Fini(void); +PyAPI_FUNC(void) PyDict_Fini(void); +PyAPI_FUNC(void) PyTuple_Fini(void); +PyAPI_FUNC(void) PyList_Fini(void); +PyAPI_FUNC(void) PySet_Fini(void); +PyAPI_FUNC(void) PyBytes_Fini(void); +PyAPI_FUNC(void) PyByteArray_Fini(void); +PyAPI_FUNC(void) PyFloat_Fini(void); +PyAPI_FUNC(void) PyOS_FiniInterrupts(void); +PyAPI_FUNC(void) PySlice_Fini(void); +PyAPI_FUNC(void) PyAsyncGen_Fini(void); + +PyAPI_FUNC(int) _Py_IsFinalizing(void); + +/* Random */ +PyAPI_FUNC(int) _PyOS_URandom(void *buffer, Py_ssize_t size); +PyAPI_FUNC(int) _PyOS_URandomNonblock(void *buffer, Py_ssize_t size); + +/* Legacy locale support */ +PyAPI_FUNC(void) _Py_CoerceLegacyLocale(int warn); +PyAPI_FUNC(int) _Py_LegacyLocaleDetected(void); +PyAPI_FUNC(char *) _Py_SetLocaleFromEnv(int category); + +#ifdef __cplusplus +} +#endif diff --git a/Include/pylifecycle.h b/Include/pylifecycle.h index 93fb26b43fe8..5419bc943240 100644 --- a/Include/pylifecycle.h +++ b/Include/pylifecycle.h @@ -7,47 +7,10 @@ extern "C" { #endif -#ifndef Py_LIMITED_API -/* Only used by applications that embed the interpreter and need to - * override the standard encoding determination mechanism - */ -PyAPI_FUNC(int) Py_SetStandardStreamEncoding(const char *encoding, - const char *errors); -#endif - - -#ifndef Py_LIMITED_API -/* PEP 432 Multi-phase initialization API (Private while provisional!) */ -PyAPI_FUNC(_PyInitError) _Py_InitializeCore( - PyInterpreterState **interp, - const _PyCoreConfig *); -PyAPI_FUNC(int) _Py_IsCoreInitialized(void); - - -PyAPI_FUNC(_PyInitError) _PyMainInterpreterConfig_Read( - _PyMainInterpreterConfig *config, - const _PyCoreConfig *core_config); -PyAPI_FUNC(void) _PyMainInterpreterConfig_Clear(_PyMainInterpreterConfig *); -PyAPI_FUNC(int) _PyMainInterpreterConfig_Copy( - _PyMainInterpreterConfig *config, - const _PyMainInterpreterConfig *config2); -/* Used by _testcapi.get_main_config() */ -PyAPI_FUNC(PyObject*) _PyMainInterpreterConfig_AsDict( - const _PyMainInterpreterConfig *config); - -PyAPI_FUNC(_PyInitError) _Py_InitializeMainInterpreter( - PyInterpreterState *interp, - const _PyMainInterpreterConfig *); -#endif /* Initialization and finalization */ PyAPI_FUNC(void) Py_Initialize(void); PyAPI_FUNC(void) Py_InitializeEx(int); -#ifndef Py_LIMITED_API -PyAPI_FUNC(_PyInitError) _Py_InitializeFromConfig( - const _PyCoreConfig *config); -PyAPI_FUNC(void) _Py_NO_RETURN _Py_FatalInitError(_PyInitError err); -#endif PyAPI_FUNC(void) Py_Finalize(void); PyAPI_FUNC(int) Py_FinalizeEx(void); PyAPI_FUNC(int) Py_IsInitialized(void); @@ -60,20 +23,10 @@ PyAPI_FUNC(void) Py_EndInterpreter(PyThreadState *); /* Py_PyAtExit is for the atexit module, Py_AtExit is for low-level * exit functions. */ -#ifndef Py_LIMITED_API -PyAPI_FUNC(void) _Py_PyAtExit(void (*func)(PyObject *), PyObject *); -#endif PyAPI_FUNC(int) Py_AtExit(void (*func)(void)); PyAPI_FUNC(void) _Py_NO_RETURN Py_Exit(int); -/* Restore signals that the interpreter has called SIG_IGN on to SIG_DFL. */ -#ifndef Py_LIMITED_API -PyAPI_FUNC(void) _Py_RestoreSignals(void); - -PyAPI_FUNC(int) Py_FdIsInteractive(FILE *, const char *); -#endif - /* Bootstrap __main__ (defined in Modules/main.c) */ PyAPI_FUNC(int) Py_Main(int argc, wchar_t **argv); @@ -84,9 +37,6 @@ PyAPI_FUNC(wchar_t *) Py_GetProgramName(void); PyAPI_FUNC(void) Py_SetPythonHome(const wchar_t *); PyAPI_FUNC(wchar_t *) Py_GetPythonHome(void); -#ifndef Py_LIMITED_API -PyAPI_FUNC(void) _Py_SetProgramFullPath(const wchar_t *); -#endif PyAPI_FUNC(wchar_t *) Py_GetProgramFullPath(void); PyAPI_FUNC(wchar_t *) Py_GetPrefix(void); @@ -103,43 +53,6 @@ PyAPI_FUNC(const char *) Py_GetPlatform(void); PyAPI_FUNC(const char *) Py_GetCopyright(void); PyAPI_FUNC(const char *) Py_GetCompiler(void); PyAPI_FUNC(const char *) Py_GetBuildInfo(void); -#ifndef Py_LIMITED_API -PyAPI_FUNC(const char *) _Py_gitidentifier(void); -PyAPI_FUNC(const char *) _Py_gitversion(void); -#endif - -/* Internal -- various one-time initializations */ -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject *) _PyBuiltin_Init(void); -PyAPI_FUNC(_PyInitError) _PySys_BeginInit(PyObject **sysmod); -PyAPI_FUNC(int) _PySys_EndInit(PyObject *sysdict, PyInterpreterState *interp); -PyAPI_FUNC(_PyInitError) _PyImport_Init(PyInterpreterState *interp); -PyAPI_FUNC(void) _PyExc_Init(PyObject * bltinmod); -PyAPI_FUNC(_PyInitError) _PyImportHooks_Init(void); -PyAPI_FUNC(int) _PyFloat_Init(void); -PyAPI_FUNC(int) PyByteArray_Init(void); -PyAPI_FUNC(_PyInitError) _Py_HashRandomization_Init(const _PyCoreConfig *); -#endif - -/* Various internal finalizers */ - -#ifndef Py_LIMITED_API -PyAPI_FUNC(void) PyMethod_Fini(void); -PyAPI_FUNC(void) PyFrame_Fini(void); -PyAPI_FUNC(void) PyCFunction_Fini(void); -PyAPI_FUNC(void) PyDict_Fini(void); -PyAPI_FUNC(void) PyTuple_Fini(void); -PyAPI_FUNC(void) PyList_Fini(void); -PyAPI_FUNC(void) PySet_Fini(void); -PyAPI_FUNC(void) PyBytes_Fini(void); -PyAPI_FUNC(void) PyByteArray_Fini(void); -PyAPI_FUNC(void) PyFloat_Fini(void); -PyAPI_FUNC(void) PyOS_FiniInterrupts(void); -PyAPI_FUNC(void) PySlice_Fini(void); -PyAPI_FUNC(void) PyAsyncGen_Fini(void); - -PyAPI_FUNC(int) _Py_IsFinalizing(void); -#endif /* !Py_LIMITED_API */ /* Signals */ typedef void (*PyOS_sighandler_t)(int); @@ -147,16 +60,9 @@ PyAPI_FUNC(PyOS_sighandler_t) PyOS_getsig(int); PyAPI_FUNC(PyOS_sighandler_t) PyOS_setsig(int, PyOS_sighandler_t); #ifndef Py_LIMITED_API -/* Random */ -PyAPI_FUNC(int) _PyOS_URandom(void *buffer, Py_ssize_t size); -PyAPI_FUNC(int) _PyOS_URandomNonblock(void *buffer, Py_ssize_t size); -#endif /* !Py_LIMITED_API */ - -/* Legacy locale support */ -#ifndef Py_LIMITED_API -PyAPI_FUNC(void) _Py_CoerceLegacyLocale(int warn); -PyAPI_FUNC(int) _Py_LegacyLocaleDetected(void); -PyAPI_FUNC(char *) _Py_SetLocaleFromEnv(int category); +# define Py_CPYTHON_PYLIFECYCLE_H +# include "cpython/pylifecycle.h" +# undef Py_CPYTHON_PYLIFECYCLE_H #endif #ifdef __cplusplus From webhook-mailer at python.org Mon Nov 26 18:12:30 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 26 Nov 2018 23:12:30 -0000 Subject: [Python-checkins] bpo-35134: Create Include/cpython/dictobject.h (GH-10732) Message-ID: https://github.com/python/cpython/commit/ffedd9ad2a8be4bf82a4d8f2bac3eaee5b44191e commit: ffedd9ad2a8be4bf82a4d8f2bac3eaee5b44191e branch: master author: Victor Stinner committer: GitHub date: 2018-11-27T00:12:26+01:00 summary: bpo-35134: Create Include/cpython/dictobject.h (GH-10732) * Move dictobject.h code surrounded by "#ifndef Py_LIMITED_API" to a new Include/cpython/dictobject.h header file. * Add PyAPI_FUNC() to _PyDictView_New(). * Reorganize dictobject.h: move views and iterators at the end. files: A Include/cpython/dictobject.h M Include/dictobject.h diff --git a/Include/cpython/dictobject.h b/Include/cpython/dictobject.h new file mode 100644 index 000000000000..4c7457cd0b26 --- /dev/null +++ b/Include/cpython/dictobject.h @@ -0,0 +1,93 @@ +#ifndef Py_CPYTHON_DICTOBJECT_H +# error "this header file must not be included directly" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct _dictkeysobject PyDictKeysObject; + +/* The ma_values pointer is NULL for a combined table + * or points to an array of PyObject* for a split table + */ +typedef struct { + PyObject_HEAD + + /* Number of items in the dictionary */ + Py_ssize_t ma_used; + + /* Dictionary version: globally unique, value change each time + the dictionary is modified */ + uint64_t ma_version_tag; + + PyDictKeysObject *ma_keys; + + /* If ma_values is NULL, the table is "combined": keys and values + are stored in ma_keys. + + If ma_values is not NULL, the table is splitted: + keys are stored in ma_keys and values are stored in ma_values */ + PyObject **ma_values; +} PyDictObject; + +PyAPI_FUNC(PyObject *) _PyDict_GetItem_KnownHash(PyObject *mp, PyObject *key, + Py_hash_t hash); +PyAPI_FUNC(PyObject *) _PyDict_GetItemIdWithError(PyObject *dp, + struct _Py_Identifier *key); +PyAPI_FUNC(PyObject *) PyDict_SetDefault( + PyObject *mp, PyObject *key, PyObject *defaultobj); +PyAPI_FUNC(int) _PyDict_SetItem_KnownHash(PyObject *mp, PyObject *key, + PyObject *item, Py_hash_t hash); +PyAPI_FUNC(int) _PyDict_DelItem_KnownHash(PyObject *mp, PyObject *key, + Py_hash_t hash); +PyAPI_FUNC(int) _PyDict_DelItemIf(PyObject *mp, PyObject *key, + int (*predicate)(PyObject *value)); +PyDictKeysObject *_PyDict_NewKeysForClass(void); +PyAPI_FUNC(PyObject *) PyObject_GenericGetDict(PyObject *, void *); +PyAPI_FUNC(int) _PyDict_Next( + PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value, Py_hash_t *hash); + +/* Get the number of items of a dictionary. */ +#define PyDict_GET_SIZE(mp) (assert(PyDict_Check(mp)),((PyDictObject *)mp)->ma_used) +PyAPI_FUNC(int) _PyDict_Contains(PyObject *mp, PyObject *key, Py_hash_t hash); +PyAPI_FUNC(PyObject *) _PyDict_NewPresized(Py_ssize_t minused); +PyAPI_FUNC(void) _PyDict_MaybeUntrack(PyObject *mp); +PyAPI_FUNC(int) _PyDict_HasOnlyStringKeys(PyObject *mp); +Py_ssize_t _PyDict_KeysSize(PyDictKeysObject *keys); +PyAPI_FUNC(Py_ssize_t) _PyDict_SizeOf(PyDictObject *); +PyAPI_FUNC(PyObject *) _PyDict_Pop(PyObject *, PyObject *, PyObject *); +PyObject *_PyDict_Pop_KnownHash(PyObject *, PyObject *, Py_hash_t, PyObject *); +PyObject *_PyDict_FromKeys(PyObject *, PyObject *, PyObject *); +#define _PyDict_HasSplitTable(d) ((d)->ma_values != NULL) + +PyAPI_FUNC(int) PyDict_ClearFreeList(void); + +/* Like PyDict_Merge, but override can be 0, 1 or 2. If override is 0, + the first occurrence of a key wins, if override is 1, the last occurrence + of a key wins, if override is 2, a KeyError with conflicting key as + argument is raised. +*/ +PyAPI_FUNC(int) _PyDict_MergeEx(PyObject *mp, PyObject *other, int override); +PyAPI_FUNC(PyObject *) _PyDict_GetItemId(PyObject *dp, struct _Py_Identifier *key); +PyAPI_FUNC(int) _PyDict_SetItemId(PyObject *dp, struct _Py_Identifier *key, PyObject *item); + +PyAPI_FUNC(int) _PyDict_DelItemId(PyObject *mp, struct _Py_Identifier *key); +PyAPI_FUNC(void) _PyDict_DebugMallocStats(FILE *out); + +int _PyObjectDict_SetItem(PyTypeObject *tp, PyObject **dictptr, PyObject *name, PyObject *value); +PyObject *_PyDict_LoadGlobal(PyDictObject *, PyDictObject *, PyObject *); + +/* _PyDictView */ + +typedef struct { + PyObject_HEAD + PyDictObject *dv_dict; +} _PyDictViewObject; + +PyAPI_FUNC(PyObject *) _PyDictView_New(PyObject *, PyTypeObject *); +PyAPI_FUNC(PyObject *) _PyDictView_Intersect(PyObject* self, PyObject *other); + +#ifdef __cplusplus +} +#endif diff --git a/Include/dictobject.h b/Include/dictobject.h index c0f24df7d265..b37573ad48c0 100644 --- a/Include/dictobject.h +++ b/Include/dictobject.h @@ -4,7 +4,6 @@ extern "C" { #endif - /* Dictionary object type -- mapping from hashable object to object */ /* The distribution includes a separate file, Objects/dictnotes.txt, @@ -13,119 +12,26 @@ extern "C" { tuning dictionaries, and several ideas for possible optimizations. */ -#ifndef Py_LIMITED_API - -typedef struct _dictkeysobject PyDictKeysObject; - -/* The ma_values pointer is NULL for a combined table - * or points to an array of PyObject* for a split table - */ -typedef struct { - PyObject_HEAD - - /* Number of items in the dictionary */ - Py_ssize_t ma_used; - - /* Dictionary version: globally unique, value change each time - the dictionary is modified */ - uint64_t ma_version_tag; - - PyDictKeysObject *ma_keys; - - /* If ma_values is NULL, the table is "combined": keys and values - are stored in ma_keys. - - If ma_values is not NULL, the table is splitted: - keys are stored in ma_keys and values are stored in ma_values */ - PyObject **ma_values; -} PyDictObject; - -typedef struct { - PyObject_HEAD - PyDictObject *dv_dict; -} _PyDictViewObject; - -#endif /* Py_LIMITED_API */ - PyAPI_DATA(PyTypeObject) PyDict_Type; -PyAPI_DATA(PyTypeObject) PyDictIterKey_Type; -PyAPI_DATA(PyTypeObject) PyDictIterValue_Type; -PyAPI_DATA(PyTypeObject) PyDictIterItem_Type; -PyAPI_DATA(PyTypeObject) PyDictRevIterKey_Type; -PyAPI_DATA(PyTypeObject) PyDictRevIterItem_Type; -PyAPI_DATA(PyTypeObject) PyDictRevIterValue_Type; -PyAPI_DATA(PyTypeObject) PyDictKeys_Type; -PyAPI_DATA(PyTypeObject) PyDictItems_Type; -PyAPI_DATA(PyTypeObject) PyDictValues_Type; #define PyDict_Check(op) \ PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_DICT_SUBCLASS) #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) -#define PyDictKeys_Check(op) PyObject_TypeCheck(op, &PyDictKeys_Type) -#define PyDictItems_Check(op) PyObject_TypeCheck(op, &PyDictItems_Type) -#define PyDictValues_Check(op) PyObject_TypeCheck(op, &PyDictValues_Type) -/* This excludes Values, since they are not sets. */ -# define PyDictViewSet_Check(op) \ - (PyDictKeys_Check(op) || PyDictItems_Check(op)) - PyAPI_FUNC(PyObject *) PyDict_New(void); PyAPI_FUNC(PyObject *) PyDict_GetItem(PyObject *mp, PyObject *key); -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject *) _PyDict_GetItem_KnownHash(PyObject *mp, PyObject *key, - Py_hash_t hash); -#endif PyAPI_FUNC(PyObject *) PyDict_GetItemWithError(PyObject *mp, PyObject *key); -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject *) _PyDict_GetItemIdWithError(PyObject *dp, - struct _Py_Identifier *key); -PyAPI_FUNC(PyObject *) PyDict_SetDefault( - PyObject *mp, PyObject *key, PyObject *defaultobj); -#endif PyAPI_FUNC(int) PyDict_SetItem(PyObject *mp, PyObject *key, PyObject *item); -#ifndef Py_LIMITED_API -PyAPI_FUNC(int) _PyDict_SetItem_KnownHash(PyObject *mp, PyObject *key, - PyObject *item, Py_hash_t hash); -#endif PyAPI_FUNC(int) PyDict_DelItem(PyObject *mp, PyObject *key); -#ifndef Py_LIMITED_API -PyAPI_FUNC(int) _PyDict_DelItem_KnownHash(PyObject *mp, PyObject *key, - Py_hash_t hash); -PyAPI_FUNC(int) _PyDict_DelItemIf(PyObject *mp, PyObject *key, - int (*predicate)(PyObject *value)); -#endif PyAPI_FUNC(void) PyDict_Clear(PyObject *mp); PyAPI_FUNC(int) PyDict_Next( PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value); -#ifndef Py_LIMITED_API -PyDictKeysObject *_PyDict_NewKeysForClass(void); -PyAPI_FUNC(PyObject *) PyObject_GenericGetDict(PyObject *, void *); -PyAPI_FUNC(int) _PyDict_Next( - PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value, Py_hash_t *hash); -PyObject *_PyDictView_New(PyObject *, PyTypeObject *); -#endif PyAPI_FUNC(PyObject *) PyDict_Keys(PyObject *mp); PyAPI_FUNC(PyObject *) PyDict_Values(PyObject *mp); PyAPI_FUNC(PyObject *) PyDict_Items(PyObject *mp); PyAPI_FUNC(Py_ssize_t) PyDict_Size(PyObject *mp); PyAPI_FUNC(PyObject *) PyDict_Copy(PyObject *mp); PyAPI_FUNC(int) PyDict_Contains(PyObject *mp, PyObject *key); -#ifndef Py_LIMITED_API -/* Get the number of items of a dictionary. */ -#define PyDict_GET_SIZE(mp) (assert(PyDict_Check(mp)),((PyDictObject *)mp)->ma_used) -PyAPI_FUNC(int) _PyDict_Contains(PyObject *mp, PyObject *key, Py_hash_t hash); -PyAPI_FUNC(PyObject *) _PyDict_NewPresized(Py_ssize_t minused); -PyAPI_FUNC(void) _PyDict_MaybeUntrack(PyObject *mp); -PyAPI_FUNC(int) _PyDict_HasOnlyStringKeys(PyObject *mp); -Py_ssize_t _PyDict_KeysSize(PyDictKeysObject *keys); -PyAPI_FUNC(Py_ssize_t) _PyDict_SizeOf(PyDictObject *); -PyAPI_FUNC(PyObject *) _PyDict_Pop(PyObject *, PyObject *, PyObject *); -PyObject *_PyDict_Pop_KnownHash(PyObject *, PyObject *, Py_hash_t, PyObject *); -PyObject *_PyDict_FromKeys(PyObject *, PyObject *, PyObject *); -#define _PyDict_HasSplitTable(d) ((d)->ma_values != NULL) - -PyAPI_FUNC(int) PyDict_ClearFreeList(void); -#endif /* PyDict_Update(mp, other) is equivalent to PyDict_Merge(mp, other, 1). */ PyAPI_FUNC(int) PyDict_Update(PyObject *mp, PyObject *other); @@ -136,18 +42,8 @@ PyAPI_FUNC(int) PyDict_Update(PyObject *mp, PyObject *other); dict.update(other) is equivalent to PyDict_Merge(dict, other, 1). */ PyAPI_FUNC(int) PyDict_Merge(PyObject *mp, - PyObject *other, - int override); - -#ifndef Py_LIMITED_API -/* Like PyDict_Merge, but override can be 0, 1 or 2. If override is 0, - the first occurrence of a key wins, if override is 1, the last occurrence - of a key wins, if override is 2, a KeyError with conflicting key as - argument is raised. -*/ -PyAPI_FUNC(int) _PyDict_MergeEx(PyObject *mp, PyObject *other, int override); -PyAPI_FUNC(PyObject *) _PyDictView_Intersect(PyObject* self, PyObject *other); -#endif + PyObject *other, + int override); /* PyDict_MergeFromSeq2 updates/merges from an iterable object producing iterable objects of length 2. If override is true, the last occurrence @@ -155,25 +51,41 @@ PyAPI_FUNC(PyObject *) _PyDictView_Intersect(PyObject* self, PyObject *other); is equivalent to dict={}; PyDict_MergeFromSeq(dict, seq2, 1). */ PyAPI_FUNC(int) PyDict_MergeFromSeq2(PyObject *d, - PyObject *seq2, - int override); + PyObject *seq2, + int override); PyAPI_FUNC(PyObject *) PyDict_GetItemString(PyObject *dp, const char *key); -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject *) _PyDict_GetItemId(PyObject *dp, struct _Py_Identifier *key); -#endif /* !Py_LIMITED_API */ PyAPI_FUNC(int) PyDict_SetItemString(PyObject *dp, const char *key, PyObject *item); -#ifndef Py_LIMITED_API -PyAPI_FUNC(int) _PyDict_SetItemId(PyObject *dp, struct _Py_Identifier *key, PyObject *item); -#endif /* !Py_LIMITED_API */ PyAPI_FUNC(int) PyDict_DelItemString(PyObject *dp, const char *key); -#ifndef Py_LIMITED_API -PyAPI_FUNC(int) _PyDict_DelItemId(PyObject *mp, struct _Py_Identifier *key); -PyAPI_FUNC(void) _PyDict_DebugMallocStats(FILE *out); +/* Dictionary (keys, values, items) views */ + +PyAPI_DATA(PyTypeObject) PyDictKeys_Type; +PyAPI_DATA(PyTypeObject) PyDictValues_Type; +PyAPI_DATA(PyTypeObject) PyDictItems_Type; + +#define PyDictKeys_Check(op) PyObject_TypeCheck(op, &PyDictKeys_Type) +#define PyDictValues_Check(op) PyObject_TypeCheck(op, &PyDictValues_Type) +#define PyDictItems_Check(op) PyObject_TypeCheck(op, &PyDictItems_Type) +/* This excludes Values, since they are not sets. */ +# define PyDictViewSet_Check(op) \ + (PyDictKeys_Check(op) || PyDictItems_Check(op)) + +/* Dictionary (key, value, items) iterators */ -int _PyObjectDict_SetItem(PyTypeObject *tp, PyObject **dictptr, PyObject *name, PyObject *value); -PyObject *_PyDict_LoadGlobal(PyDictObject *, PyDictObject *, PyObject *); +PyAPI_DATA(PyTypeObject) PyDictIterKey_Type; +PyAPI_DATA(PyTypeObject) PyDictIterValue_Type; +PyAPI_DATA(PyTypeObject) PyDictIterItem_Type; + +PyAPI_DATA(PyTypeObject) PyDictRevIterKey_Type; +PyAPI_DATA(PyTypeObject) PyDictRevIterItem_Type; +PyAPI_DATA(PyTypeObject) PyDictRevIterValue_Type; + + +#ifndef Py_LIMITED_API +# define Py_CPYTHON_DICTOBJECT_H +# include "cpython/dictobject.h" +# undef Py_CPYTHON_DICTOBJECT_H #endif #ifdef __cplusplus From webhook-mailer at python.org Mon Nov 26 18:20:03 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 26 Nov 2018 23:20:03 -0000 Subject: [Python-checkins] bpo-35134: Create Include/cpython/pystate.h (GH-10733) Message-ID: https://github.com/python/cpython/commit/f2a9d5c8378cd7eca90b3b197e2cc0989da55014 commit: f2a9d5c8378cd7eca90b3b197e2cc0989da55014 branch: master author: Victor Stinner committer: GitHub date: 2018-11-27T00:20:00+01:00 summary: bpo-35134: Create Include/cpython/pystate.h (GH-10733) Move pystate.h code surrounded by "#ifndef Py_LIMITED_API" to a new Include/cpython/pystate.h header file. files: A Include/cpython/pystate.h M Include/pystate.h diff --git a/Include/cpython/pystate.h b/Include/cpython/pystate.h new file mode 100644 index 000000000000..78e9a5ed1013 --- /dev/null +++ b/Include/cpython/pystate.h @@ -0,0 +1,272 @@ +#ifndef Py_CPYTHON_PYSTATE_H +# error "this header file must not be included directly" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef PyObject* (*_PyFrameEvalFunction)(struct _frame *, int); + +/* Placeholders while working on the new configuration API + * + * See PEP 432 for final anticipated contents + */ +typedef struct { + int install_signal_handlers; /* Install signal handlers? -1 means unset */ + PyObject *argv; /* sys.argv list, can be NULL */ + PyObject *executable; /* sys.executable str */ + PyObject *prefix; /* sys.prefix str */ + PyObject *base_prefix; /* sys.base_prefix str, can be NULL */ + PyObject *exec_prefix; /* sys.exec_prefix str */ + PyObject *base_exec_prefix; /* sys.base_exec_prefix str, can be NULL */ + PyObject *warnoptions; /* sys.warnoptions list, can be NULL */ + PyObject *xoptions; /* sys._xoptions dict, can be NULL */ + PyObject *module_search_path; /* sys.path list */ + PyObject *pycache_prefix; /* sys.pycache_prefix str, can be NULL */ +} _PyMainInterpreterConfig; + +#define _PyMainInterpreterConfig_INIT \ + (_PyMainInterpreterConfig){.install_signal_handlers = -1} +/* Note: _PyMainInterpreterConfig_INIT sets other fields to 0/NULL */ + +typedef struct _is { + + struct _is *next; + struct _ts *tstate_head; + + int64_t id; + int64_t id_refcount; + PyThread_type_lock id_mutex; + + PyObject *modules; + PyObject *modules_by_index; + PyObject *sysdict; + PyObject *builtins; + PyObject *importlib; + + /* Used in Python/sysmodule.c. */ + int check_interval; + + /* Used in Modules/_threadmodule.c. */ + long num_threads; + /* Support for runtime thread stack size tuning. + A value of 0 means using the platform's default stack size + or the size specified by the THREAD_STACK_SIZE macro. */ + /* Used in Python/thread.c. */ + size_t pythread_stacksize; + + PyObject *codec_search_path; + PyObject *codec_search_cache; + PyObject *codec_error_registry; + int codecs_initialized; + int fscodec_initialized; + + _PyCoreConfig core_config; + _PyMainInterpreterConfig config; +#ifdef HAVE_DLOPEN + int dlopenflags; +#endif + + PyObject *builtins_copy; + PyObject *import_func; + /* Initialized to PyEval_EvalFrameDefault(). */ + _PyFrameEvalFunction eval_frame; + + Py_ssize_t co_extra_user_count; + freefunc co_extra_freefuncs[MAX_CO_EXTRA_USERS]; + +#ifdef HAVE_FORK + PyObject *before_forkers; + PyObject *after_forkers_parent; + PyObject *after_forkers_child; +#endif + /* AtExit module */ + void (*pyexitfunc)(PyObject *); + PyObject *pyexitmodule; + + uint64_t tstate_next_unique_id; +} PyInterpreterState; + +/* State unique per thread */ + +/* Py_tracefunc return -1 when raising an exception, or 0 for success. */ +typedef int (*Py_tracefunc)(PyObject *, struct _frame *, int, PyObject *); + +/* The following values are used for 'what' for tracefunc functions + * + * To add a new kind of trace event, also update "trace_init" in + * Python/sysmodule.c to define the Python level event name + */ +#define PyTrace_CALL 0 +#define PyTrace_EXCEPTION 1 +#define PyTrace_LINE 2 +#define PyTrace_RETURN 3 +#define PyTrace_C_CALL 4 +#define PyTrace_C_EXCEPTION 5 +#define PyTrace_C_RETURN 6 +#define PyTrace_OPCODE 7 + + +typedef struct _err_stackitem { + /* This struct represents an entry on the exception stack, which is a + * per-coroutine state. (Coroutine in the computer science sense, + * including the thread and generators). + * This ensures that the exception state is not impacted by "yields" + * from an except handler. + */ + PyObject *exc_type, *exc_value, *exc_traceback; + + struct _err_stackitem *previous_item; + +} _PyErr_StackItem; + + +typedef struct _ts { + /* See Python/ceval.c for comments explaining most fields */ + + struct _ts *prev; + struct _ts *next; + PyInterpreterState *interp; + + struct _frame *frame; + int recursion_depth; + char overflowed; /* The stack has overflowed. Allow 50 more calls + to handle the runtime error. */ + char recursion_critical; /* The current calls must not cause + a stack overflow. */ + int stackcheck_counter; + + /* 'tracing' keeps track of the execution depth when tracing/profiling. + This is to prevent the actual trace/profile code from being recorded in + the trace/profile. */ + int tracing; + int use_tracing; + + Py_tracefunc c_profilefunc; + Py_tracefunc c_tracefunc; + PyObject *c_profileobj; + PyObject *c_traceobj; + + /* The exception currently being raised */ + PyObject *curexc_type; + PyObject *curexc_value; + PyObject *curexc_traceback; + + /* The exception currently being handled, if no coroutines/generators + * are present. Always last element on the stack referred to be exc_info. + */ + _PyErr_StackItem exc_state; + + /* Pointer to the top of the stack of the exceptions currently + * being handled */ + _PyErr_StackItem *exc_info; + + PyObject *dict; /* Stores per-thread state */ + + int gilstate_counter; + + PyObject *async_exc; /* Asynchronous exception to raise */ + unsigned long thread_id; /* Thread id where this tstate was created */ + + int trash_delete_nesting; + PyObject *trash_delete_later; + + /* Called when a thread state is deleted normally, but not when it + * is destroyed after fork(). + * Pain: to prevent rare but fatal shutdown errors (issue 18808), + * Thread.join() must wait for the join'ed thread's tstate to be unlinked + * from the tstate chain. That happens at the end of a thread's life, + * in pystate.c. + * The obvious way doesn't quite work: create a lock which the tstate + * unlinking code releases, and have Thread.join() wait to acquire that + * lock. The problem is that we _are_ at the end of the thread's life: + * if the thread holds the last reference to the lock, decref'ing the + * lock will delete the lock, and that may trigger arbitrary Python code + * if there's a weakref, with a callback, to the lock. But by this time + * _PyRuntime.gilstate.tstate_current is already NULL, so only the simplest + * of C code can be allowed to run (in particular it must not be possible to + * release the GIL). + * So instead of holding the lock directly, the tstate holds a weakref to + * the lock: that's the value of on_delete_data below. Decref'ing a + * weakref is harmless. + * on_delete points to _threadmodule.c's static release_sentinel() function. + * After the tstate is unlinked, release_sentinel is called with the + * weakref-to-lock (on_delete_data) argument, and release_sentinel releases + * the indirectly held lock. + */ + void (*on_delete)(void *); + void *on_delete_data; + + int coroutine_origin_tracking_depth; + + PyObject *coroutine_wrapper; + int in_coroutine_wrapper; + + PyObject *async_gen_firstiter; + PyObject *async_gen_finalizer; + + PyObject *context; + uint64_t context_ver; + + /* Unique thread state id. */ + uint64_t id; + + /* XXX signal handlers should also be here */ + +} PyThreadState; + +/* Get the current interpreter state. + + Issue a fatal error if there no current Python thread state or no current + interpreter. It cannot return NULL. + + The caller must hold the GIL.*/ +PyAPI_FUNC(PyInterpreterState *) _PyInterpreterState_Get(void); + +PyAPI_FUNC(int) _PyState_AddModule(PyObject*, struct PyModuleDef*); +PyAPI_FUNC(void) _PyState_ClearModules(void); +PyAPI_FUNC(PyThreadState *) _PyThreadState_Prealloc(PyInterpreterState *); +PyAPI_FUNC(void) _PyThreadState_Init(PyThreadState *); +PyAPI_FUNC(void) _PyThreadState_DeleteExcept(PyThreadState *tstate); +PyAPI_FUNC(void) _PyGILState_Reinit(void); + +/* Similar to PyThreadState_Get(), but don't issue a fatal error + * if it is NULL. */ +PyAPI_FUNC(PyThreadState *) _PyThreadState_UncheckedGet(void); + +/* PyGILState */ + +/* Helper/diagnostic function - return 1 if the current thread + currently holds the GIL, 0 otherwise. + + The function returns 1 if _PyGILState_check_enabled is non-zero. */ +PyAPI_FUNC(int) PyGILState_Check(void); + +/* Get the single PyInterpreterState used by this process' GILState + implementation. + + This function doesn't check for error. Return NULL before _PyGILState_Init() + is called and after _PyGILState_Fini() is called. + + See also _PyInterpreterState_Get() and _PyInterpreterState_GET_UNSAFE(). */ +PyAPI_FUNC(PyInterpreterState *) _PyGILState_GetInterpreterStateUnsafe(void); + +/* The implementation of sys._current_frames() Returns a dict mapping + thread id to that thread's current frame. +*/ +PyAPI_FUNC(PyObject *) _PyThread_CurrentFrames(void); + +/* Routines for advanced debuggers, requested by David Beazley. + Don't use unless you know what you are doing! */ +PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Main(void); +PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Head(void); +PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Next(PyInterpreterState *); +PyAPI_FUNC(PyThreadState *) PyInterpreterState_ThreadHead(PyInterpreterState *); +PyAPI_FUNC(PyThreadState *) PyThreadState_Next(PyThreadState *); + +typedef struct _frame *(*PyThreadFrameGetter)(PyThreadState *self_); + +#ifdef __cplusplus +} +#endif diff --git a/Include/pystate.h b/Include/pystate.h index 58499ea35b47..cc479ff867a4 100644 --- a/Include/pystate.h +++ b/Include/pystate.h @@ -20,273 +20,31 @@ struct _ts; /* Forward */ struct _is; /* Forward */ struct _frame; /* Forward declaration for PyFrameObject. */ -#ifdef Py_LIMITED_API typedef struct _is PyInterpreterState; -#else -typedef PyObject* (*_PyFrameEvalFunction)(struct _frame *, int); - -/* Placeholders while working on the new configuration API - * - * See PEP 432 for final anticipated contents - */ -typedef struct { - int install_signal_handlers; /* Install signal handlers? -1 means unset */ - PyObject *argv; /* sys.argv list, can be NULL */ - PyObject *executable; /* sys.executable str */ - PyObject *prefix; /* sys.prefix str */ - PyObject *base_prefix; /* sys.base_prefix str, can be NULL */ - PyObject *exec_prefix; /* sys.exec_prefix str */ - PyObject *base_exec_prefix; /* sys.base_exec_prefix str, can be NULL */ - PyObject *warnoptions; /* sys.warnoptions list, can be NULL */ - PyObject *xoptions; /* sys._xoptions dict, can be NULL */ - PyObject *module_search_path; /* sys.path list */ - PyObject *pycache_prefix; /* sys.pycache_prefix str, can be NULL */ -} _PyMainInterpreterConfig; - -#define _PyMainInterpreterConfig_INIT \ - (_PyMainInterpreterConfig){.install_signal_handlers = -1} -/* Note: _PyMainInterpreterConfig_INIT sets other fields to 0/NULL */ - -typedef struct _is { - - struct _is *next; - struct _ts *tstate_head; - - int64_t id; - int64_t id_refcount; - PyThread_type_lock id_mutex; - - PyObject *modules; - PyObject *modules_by_index; - PyObject *sysdict; - PyObject *builtins; - PyObject *importlib; - - /* Used in Python/sysmodule.c. */ - int check_interval; - - /* Used in Modules/_threadmodule.c. */ - long num_threads; - /* Support for runtime thread stack size tuning. - A value of 0 means using the platform's default stack size - or the size specified by the THREAD_STACK_SIZE macro. */ - /* Used in Python/thread.c. */ - size_t pythread_stacksize; - - PyObject *codec_search_path; - PyObject *codec_search_cache; - PyObject *codec_error_registry; - int codecs_initialized; - int fscodec_initialized; - - _PyCoreConfig core_config; - _PyMainInterpreterConfig config; -#ifdef HAVE_DLOPEN - int dlopenflags; -#endif - - PyObject *builtins_copy; - PyObject *import_func; - /* Initialized to PyEval_EvalFrameDefault(). */ - _PyFrameEvalFunction eval_frame; - - Py_ssize_t co_extra_user_count; - freefunc co_extra_freefuncs[MAX_CO_EXTRA_USERS]; - -#ifdef HAVE_FORK - PyObject *before_forkers; - PyObject *after_forkers_parent; - PyObject *after_forkers_child; -#endif - /* AtExit module */ - void (*pyexitfunc)(PyObject *); - PyObject *pyexitmodule; - - uint64_t tstate_next_unique_id; -} PyInterpreterState; -#endif /* !Py_LIMITED_API */ - /* State unique per thread */ -#ifndef Py_LIMITED_API -/* Py_tracefunc return -1 when raising an exception, or 0 for success. */ -typedef int (*Py_tracefunc)(PyObject *, struct _frame *, int, PyObject *); - -/* The following values are used for 'what' for tracefunc functions - * - * To add a new kind of trace event, also update "trace_init" in - * Python/sysmodule.c to define the Python level event name - */ -#define PyTrace_CALL 0 -#define PyTrace_EXCEPTION 1 -#define PyTrace_LINE 2 -#define PyTrace_RETURN 3 -#define PyTrace_C_CALL 4 -#define PyTrace_C_EXCEPTION 5 -#define PyTrace_C_RETURN 6 -#define PyTrace_OPCODE 7 -#endif /* Py_LIMITED_API */ - -#ifdef Py_LIMITED_API typedef struct _ts PyThreadState; -#else - -typedef struct _err_stackitem { - /* This struct represents an entry on the exception stack, which is a - * per-coroutine state. (Coroutine in the computer science sense, - * including the thread and generators). - * This ensures that the exception state is not impacted by "yields" - * from an except handler. - */ - PyObject *exc_type, *exc_value, *exc_traceback; - - struct _err_stackitem *previous_item; - -} _PyErr_StackItem; - - -typedef struct _ts { - /* See Python/ceval.c for comments explaining most fields */ - - struct _ts *prev; - struct _ts *next; - PyInterpreterState *interp; - - struct _frame *frame; - int recursion_depth; - char overflowed; /* The stack has overflowed. Allow 50 more calls - to handle the runtime error. */ - char recursion_critical; /* The current calls must not cause - a stack overflow. */ - int stackcheck_counter; - - /* 'tracing' keeps track of the execution depth when tracing/profiling. - This is to prevent the actual trace/profile code from being recorded in - the trace/profile. */ - int tracing; - int use_tracing; - - Py_tracefunc c_profilefunc; - Py_tracefunc c_tracefunc; - PyObject *c_profileobj; - PyObject *c_traceobj; - - /* The exception currently being raised */ - PyObject *curexc_type; - PyObject *curexc_value; - PyObject *curexc_traceback; - - /* The exception currently being handled, if no coroutines/generators - * are present. Always last element on the stack referred to be exc_info. - */ - _PyErr_StackItem exc_state; - - /* Pointer to the top of the stack of the exceptions currently - * being handled */ - _PyErr_StackItem *exc_info; - - PyObject *dict; /* Stores per-thread state */ - - int gilstate_counter; - - PyObject *async_exc; /* Asynchronous exception to raise */ - unsigned long thread_id; /* Thread id where this tstate was created */ - - int trash_delete_nesting; - PyObject *trash_delete_later; - - /* Called when a thread state is deleted normally, but not when it - * is destroyed after fork(). - * Pain: to prevent rare but fatal shutdown errors (issue 18808), - * Thread.join() must wait for the join'ed thread's tstate to be unlinked - * from the tstate chain. That happens at the end of a thread's life, - * in pystate.c. - * The obvious way doesn't quite work: create a lock which the tstate - * unlinking code releases, and have Thread.join() wait to acquire that - * lock. The problem is that we _are_ at the end of the thread's life: - * if the thread holds the last reference to the lock, decref'ing the - * lock will delete the lock, and that may trigger arbitrary Python code - * if there's a weakref, with a callback, to the lock. But by this time - * _PyRuntime.gilstate.tstate_current is already NULL, so only the simplest - * of C code can be allowed to run (in particular it must not be possible to - * release the GIL). - * So instead of holding the lock directly, the tstate holds a weakref to - * the lock: that's the value of on_delete_data below. Decref'ing a - * weakref is harmless. - * on_delete points to _threadmodule.c's static release_sentinel() function. - * After the tstate is unlinked, release_sentinel is called with the - * weakref-to-lock (on_delete_data) argument, and release_sentinel releases - * the indirectly held lock. - */ - void (*on_delete)(void *); - void *on_delete_data; - - int coroutine_origin_tracking_depth; - - PyObject *coroutine_wrapper; - int in_coroutine_wrapper; - - PyObject *async_gen_firstiter; - PyObject *async_gen_finalizer; - - PyObject *context; - uint64_t context_ver; - - /* Unique thread state id. */ - uint64_t id; - - /* XXX signal handlers should also be here */ - -} PyThreadState; -#endif /* !Py_LIMITED_API */ - PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_New(void); PyAPI_FUNC(void) PyInterpreterState_Clear(PyInterpreterState *); PyAPI_FUNC(void) PyInterpreterState_Delete(PyInterpreterState *); -#if !defined(Py_LIMITED_API) -/* Get the current interpreter state. - - Issue a fatal error if there no current Python thread state or no current - interpreter. It cannot return NULL. - - The caller must hold the GIL.*/ -PyAPI_FUNC(PyInterpreterState *) _PyInterpreterState_Get(void); -#endif - #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03070000 /* New in 3.7 */ PyAPI_FUNC(int64_t) PyInterpreterState_GetID(PyInterpreterState *); #endif -#ifndef Py_LIMITED_API -PyAPI_FUNC(int) _PyState_AddModule(PyObject*, struct PyModuleDef*); -#endif /* !Py_LIMITED_API */ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 /* New in 3.3 */ PyAPI_FUNC(int) PyState_AddModule(PyObject*, struct PyModuleDef*); PyAPI_FUNC(int) PyState_RemoveModule(struct PyModuleDef*); #endif PyAPI_FUNC(PyObject*) PyState_FindModule(struct PyModuleDef*); -#ifndef Py_LIMITED_API -PyAPI_FUNC(void) _PyState_ClearModules(void); -#endif PyAPI_FUNC(PyThreadState *) PyThreadState_New(PyInterpreterState *); -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyThreadState *) _PyThreadState_Prealloc(PyInterpreterState *); -PyAPI_FUNC(void) _PyThreadState_Init(PyThreadState *); -#endif /* !Py_LIMITED_API */ PyAPI_FUNC(void) PyThreadState_Clear(PyThreadState *); PyAPI_FUNC(void) PyThreadState_Delete(PyThreadState *); -#ifndef Py_LIMITED_API -PyAPI_FUNC(void) _PyThreadState_DeleteExcept(PyThreadState *tstate); -#endif /* !Py_LIMITED_API */ PyAPI_FUNC(void) PyThreadState_DeleteCurrent(void); -#ifndef Py_LIMITED_API -PyAPI_FUNC(void) _PyGILState_Reinit(void); -#endif /* !Py_LIMITED_API */ /* Get the current thread state. @@ -309,12 +67,6 @@ PyAPI_FUNC(PyThreadState *) PyThreadState_Get(void); See also PyThreadState_Get() and _PyThreadState_GET(). */ #define PyThreadState_GET() PyThreadState_Get() -#ifndef Py_LIMITED_API -/* Similar to PyThreadState_Get(), but don't issue a fatal error - * if it is NULL. */ -PyAPI_FUNC(PyThreadState *) _PyThreadState_UncheckedGet(void); -#endif /* !Py_LIMITED_API */ - PyAPI_FUNC(PyThreadState *) PyThreadState_Swap(PyThreadState *); PyAPI_FUNC(PyObject *) PyThreadState_GetDict(void); PyAPI_FUNC(int) PyThreadState_SetAsyncExc(unsigned long, PyObject *); @@ -365,41 +117,11 @@ PyAPI_FUNC(void) PyGILState_Release(PyGILState_STATE); */ PyAPI_FUNC(PyThreadState *) PyGILState_GetThisThreadState(void); -#ifndef Py_LIMITED_API -/* Helper/diagnostic function - return 1 if the current thread - currently holds the GIL, 0 otherwise. - - The function returns 1 if _PyGILState_check_enabled is non-zero. */ -PyAPI_FUNC(int) PyGILState_Check(void); - -/* Get the single PyInterpreterState used by this process' GILState - implementation. - This function doesn't check for error. Return NULL before _PyGILState_Init() - is called and after _PyGILState_Fini() is called. - - See also _PyInterpreterState_Get() and _PyInterpreterState_GET_UNSAFE(). */ -PyAPI_FUNC(PyInterpreterState *) _PyGILState_GetInterpreterStateUnsafe(void); -#endif /* !Py_LIMITED_API */ - - -/* The implementation of sys._current_frames() Returns a dict mapping - thread id to that thread's current frame. -*/ #ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject *) _PyThread_CurrentFrames(void); -#endif - -/* Routines for advanced debuggers, requested by David Beazley. - Don't use unless you know what you are doing! */ -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Main(void); -PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Head(void); -PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Next(PyInterpreterState *); -PyAPI_FUNC(PyThreadState *) PyInterpreterState_ThreadHead(PyInterpreterState *); -PyAPI_FUNC(PyThreadState *) PyThreadState_Next(PyThreadState *); - -typedef struct _frame *(*PyThreadFrameGetter)(PyThreadState *self_); +# define Py_CPYTHON_PYSTATE_H +# include "cpython/pystate.h" +# undef Py_CPYTHON_PYSTATE_H #endif #ifdef __cplusplus From webhook-mailer at python.org Mon Nov 26 21:21:41 2018 From: webhook-mailer at python.org (Benjamin Peterson) Date: Tue, 27 Nov 2018 02:21:41 -0000 Subject: [Python-checkins] closes bpo-34212: Build core extension modules with Py_BUILD_CORE_BUILTIN. (GH-8712) Message-ID: https://github.com/python/cpython/commit/da324d53d420347344236ff64cf5eb9b675d6f86 commit: da324d53d420347344236ff64cf5eb9b675d6f86 branch: master author: E. M. Bray committer: Benjamin Peterson date: 2018-11-26T20:21:31-06:00 summary: closes bpo-34212: Build core extension modules with Py_BUILD_CORE_BUILTIN. (GH-8712) files: M Makefile.pre.in M Modules/makesetup diff --git a/Makefile.pre.in b/Makefile.pre.in index 2c92db23489e..17007aef5623 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -106,6 +106,7 @@ ARFLAGS= @ARFLAGS@ CFLAGSFORSHARED=@CFLAGSFORSHARED@ # C flags used for building the interpreter object files PY_STDMODULE_CFLAGS= $(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) $(CFLAGSFORSHARED) +PY_BUILTIN_MODULE_CFLAGS= $(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN PY_CORE_CFLAGS= $(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE # Strict or non-strict aliasing flags used to compile dtoa.c, see above CFLAGS_ALIASING=@CFLAGS_ALIASING@ diff --git a/Modules/makesetup b/Modules/makesetup index bf5ca3902b56..fefe3fd129ee 100755 --- a/Modules/makesetup +++ b/Modules/makesetup @@ -233,7 +233,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' | case $doconfig in no) cc="$cc \$(CCSHARED) \$(PY_CFLAGS) \$(PY_CPPFLAGS)";; *) - cc="$cc \$(PY_STDMODULE_CFLAGS)";; + cc="$cc \$(PY_BUILTIN_MODULE_CFLAGS)";; esac rule="$obj: $src; $cc $cpps -c $src -o $obj" echo "$rule" >>$rulesf From webhook-mailer at python.org Mon Nov 26 21:33:02 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 27 Nov 2018 02:33:02 -0000 Subject: [Python-checkins] closes bpo-34212: Build core extension modules with Py_BUILD_CORE_BUILTIN. (GH-8712) Message-ID: https://github.com/python/cpython/commit/716a8089b04095acaba493925751df194a4916bb commit: 716a8089b04095acaba493925751df194a4916bb branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-26T18:32:57-08:00 summary: closes bpo-34212: Build core extension modules with Py_BUILD_CORE_BUILTIN. (GH-8712) (cherry picked from commit da324d53d420347344236ff64cf5eb9b675d6f86) Co-authored-by: E. M. Bray files: M Makefile.pre.in M Modules/makesetup diff --git a/Makefile.pre.in b/Makefile.pre.in index 4c23c0e4114a..afbc8f8c9bea 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -107,6 +107,7 @@ ARFLAGS= @ARFLAGS@ CFLAGSFORSHARED=@CFLAGSFORSHARED@ # C flags used for building the interpreter object files PY_STDMODULE_CFLAGS= $(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) $(CFLAGSFORSHARED) +PY_BUILTIN_MODULE_CFLAGS= $(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN PY_CORE_CFLAGS= $(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE # Strict or non-strict aliasing flags used to compile dtoa.c, see above CFLAGS_ALIASING=@CFLAGS_ALIASING@ diff --git a/Modules/makesetup b/Modules/makesetup index 020b19938c48..eac97ad1346c 100755 --- a/Modules/makesetup +++ b/Modules/makesetup @@ -233,7 +233,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' | case $doconfig in no) cc="$cc \$(CCSHARED) \$(PY_CFLAGS) \$(PY_CPPFLAGS)";; *) - cc="$cc \$(PY_STDMODULE_CFLAGS)";; + cc="$cc \$(PY_BUILTIN_MODULE_CFLAGS)";; esac rule="$obj: $src; $cc $cpps -c $src -o $obj" echo "$rule" >>$rulesf From webhook-mailer at python.org Tue Nov 27 00:40:59 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Tue, 27 Nov 2018 05:40:59 -0000 Subject: [Python-checkins] Include the highest pickle protocol in a couple of tests. (GH-10735) Message-ID: https://github.com/python/cpython/commit/d1cbc6f8a00cf881ced6238c5e652054e8fdc30f commit: d1cbc6f8a00cf881ced6238c5e652054e8fdc30f branch: master author: Zackery Spytz committer: Serhiy Storchaka date: 2018-11-27T07:40:49+02:00 summary: Include the highest pickle protocol in a couple of tests. (GH-10735) test_reduce_ex() in test_array.py and test_reversevaluesiterator_pickling() in test_dict.py weren't using the highest pickle protocol. files: M Lib/test/test_array.py M Lib/test/test_dict.py diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py index e9218f3dd68c..7f402f864471 100644 --- a/Lib/test/test_array.py +++ b/Lib/test/test_array.py @@ -248,7 +248,7 @@ def test_reduce_ex(self): a = array.array(self.typecode, self.example) for protocol in range(3): self.assertIs(a.__reduce_ex__(protocol)[0], array.array) - for protocol in range(3, pickle.HIGHEST_PROTOCOL): + for protocol in range(3, pickle.HIGHEST_PROTOCOL + 1): self.assertIs(a.__reduce_ex__(protocol)[0], array_reconstructor) def test_pickle(self): diff --git a/Lib/test/test_dict.py b/Lib/test/test_dict.py index 71fffe398f34..03afd5b2a6c7 100644 --- a/Lib/test/test_dict.py +++ b/Lib/test/test_dict.py @@ -1112,7 +1112,7 @@ def test_reverseitemiterator_pickling(self): self.assertEqual(dict(it), data) def test_reversevaluesiterator_pickling(self): - for proto in range(pickle.HIGHEST_PROTOCOL): + for proto in range(pickle.HIGHEST_PROTOCOL + 1): data = {1:"a", 2:"b", 3:"c"} # data.values() isn't picklable, only its iterator it = reversed(data.values()) From webhook-mailer at python.org Tue Nov 27 02:40:36 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Tue, 27 Nov 2018 07:40:36 -0000 Subject: [Python-checkins] bpo-31241: Fix AST node position for list and generator comprehensions. (GH-10633) Message-ID: https://github.com/python/cpython/commit/b619b097923155a7034c05c4018bf06af9f994d0 commit: b619b097923155a7034c05c4018bf06af9f994d0 branch: master author: Serhiy Storchaka committer: GitHub date: 2018-11-27T09:40:29+02:00 summary: bpo-31241: Fix AST node position for list and generator comprehensions. (GH-10633) The lineno and col_offset attributes of AST nodes for list comprehensions, generator expressions and tuples are now point to the opening parenthesis or square brace. For tuples without parenthesis they point to the position of the first item. files: A Misc/NEWS.d/next/Core and Builtins/2018-11-21-14-05-51.bpo-31241.Kin10-.rst M Lib/test/test_ast.py M Lib/test/test_exceptions.py M Python/ast.c M Python/importlib_zipimport.h diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py index 0d51b1141925..db9a6caf42f1 100644 --- a/Lib/test/test_ast.py +++ b/Lib/test/test_ast.py @@ -55,6 +55,9 @@ def to_tuple(t): "del v", # Assign "v = 1", + "a,b = c", + "(a,b) = c", + "[a,b] = c", # AugAssign "v += 1", # For @@ -90,9 +93,8 @@ def to_tuple(t): "for v in v:continue", # for statements with naked tuples (see http://bugs.python.org/issue6704) "for a,b in c: pass", - "[(a,b) for a,b in c]", - "((a,b) for a,b in c)", - "((a,b) for (a,b) in c)", + "for (a,b) in c: pass", + "for [a,b] in c: pass", # Multiline generator expression (test for .lineno & .col_offset) """( ( @@ -130,6 +132,8 @@ def to_tuple(t): "@deco1\n at deco2()\nasync def f(): pass", # Decorated ClassDef "@deco1\n at deco2()\nclass C: pass", + # Decorator with generator argument + "@deco(a for a in b)\ndef f(): pass", ] # These are compiled through "single" @@ -168,12 +172,24 @@ def to_tuple(t): "[a for b in c if d]", # GeneratorExp "(a for b in c if d)", + # Comprehensions with multiple for targets + "[(a,b) for a,b in c]", + "[(a,b) for (a,b) in c]", + "[(a,b) for [a,b] in c]", + "{(a,b) for a,b in c}", + "{(a,b) for (a,b) in c}", + "{(a,b) for [a,b] in c}", + "((a,b) for a,b in c)", + "((a,b) for (a,b) in c)", + "((a,b) for [a,b] in c)", # Yield - yield expressions can't work outside a function # # Compare "1 < 2 < 3", # Call "f(1,2,c=3,*d,**e)", + # Call with a generator argument + "f(a for a in b)", # Num "10", # Str @@ -1266,6 +1282,9 @@ def main(): ('Module', [('FunctionDef', (1, 0), 'f', ('arguments', [], None, [], [], None, []), [('Return', (1, 8), ('Constant', (1, 15), 1))], [], None)]), ('Module', [('Delete', (1, 0), [('Name', (1, 4), 'v', ('Del',))])]), ('Module', [('Assign', (1, 0), [('Name', (1, 0), 'v', ('Store',))], ('Constant', (1, 4), 1))]), +('Module', [('Assign', (1, 0), [('Tuple', (1, 0), [('Name', (1, 0), 'a', ('Store',)), ('Name', (1, 2), 'b', ('Store',))], ('Store',))], ('Name', (1, 6), 'c', ('Load',)))]), +('Module', [('Assign', (1, 0), [('Tuple', (1, 0), [('Name', (1, 1), 'a', ('Store',)), ('Name', (1, 3), 'b', ('Store',))], ('Store',))], ('Name', (1, 8), 'c', ('Load',)))]), +('Module', [('Assign', (1, 0), [('List', (1, 0), [('Name', (1, 1), 'a', ('Store',)), ('Name', (1, 3), 'b', ('Store',))], ('Store',))], ('Name', (1, 8), 'c', ('Load',)))]), ('Module', [('AugAssign', (1, 0), ('Name', (1, 0), 'v', ('Store',)), ('Add',), ('Constant', (1, 5), 1))]), ('Module', [('For', (1, 0), ('Name', (1, 4), 'v', ('Store',)), ('Name', (1, 9), 'v', ('Load',)), [('Pass', (1, 11))], [])]), ('Module', [('While', (1, 0), ('Name', (1, 6), 'v', ('Load',)), [('Pass', (1, 8))], [])]), @@ -1284,10 +1303,9 @@ def main(): ('Module', [('For', (1, 0), ('Name', (1, 4), 'v', ('Store',)), ('Name', (1, 9), 'v', ('Load',)), [('Break', (1, 11))], [])]), ('Module', [('For', (1, 0), ('Name', (1, 4), 'v', ('Store',)), ('Name', (1, 9), 'v', ('Load',)), [('Continue', (1, 11))], [])]), ('Module', [('For', (1, 0), ('Tuple', (1, 4), [('Name', (1, 4), 'a', ('Store',)), ('Name', (1, 6), 'b', ('Store',))], ('Store',)), ('Name', (1, 11), 'c', ('Load',)), [('Pass', (1, 14))], [])]), -('Module', [('Expr', (1, 0), ('ListComp', (1, 1), ('Tuple', (1, 2), [('Name', (1, 2), 'a', ('Load',)), ('Name', (1, 4), 'b', ('Load',))], ('Load',)), [('comprehension', ('Tuple', (1, 11), [('Name', (1, 11), 'a', ('Store',)), ('Name', (1, 13), 'b', ('Store',))], ('Store',)), ('Name', (1, 18), 'c', ('Load',)), [], 0)]))]), -('Module', [('Expr', (1, 0), ('GeneratorExp', (1, 1), ('Tuple', (1, 2), [('Name', (1, 2), 'a', ('Load',)), ('Name', (1, 4), 'b', ('Load',))], ('Load',)), [('comprehension', ('Tuple', (1, 11), [('Name', (1, 11), 'a', ('Store',)), ('Name', (1, 13), 'b', ('Store',))], ('Store',)), ('Name', (1, 18), 'c', ('Load',)), [], 0)]))]), -('Module', [('Expr', (1, 0), ('GeneratorExp', (1, 1), ('Tuple', (1, 2), [('Name', (1, 2), 'a', ('Load',)), ('Name', (1, 4), 'b', ('Load',))], ('Load',)), [('comprehension', ('Tuple', (1, 12), [('Name', (1, 12), 'a', ('Store',)), ('Name', (1, 14), 'b', ('Store',))], ('Store',)), ('Name', (1, 20), 'c', ('Load',)), [], 0)]))]), -('Module', [('Expr', (1, 0), ('GeneratorExp', (2, 4), ('Tuple', (3, 4), [('Name', (3, 4), 'Aa', ('Load',)), ('Name', (5, 7), 'Bb', ('Load',))], ('Load',)), [('comprehension', ('Tuple', (8, 4), [('Name', (8, 4), 'Aa', ('Store',)), ('Name', (10, 4), 'Bb', ('Store',))], ('Store',)), ('Name', (10, 10), 'Cc', ('Load',)), [], 0)]))]), +('Module', [('For', (1, 0), ('Tuple', (1, 4), [('Name', (1, 5), 'a', ('Store',)), ('Name', (1, 7), 'b', ('Store',))], ('Store',)), ('Name', (1, 13), 'c', ('Load',)), [('Pass', (1, 16))], [])]), +('Module', [('For', (1, 0), ('List', (1, 4), [('Name', (1, 5), 'a', ('Store',)), ('Name', (1, 7), 'b', ('Store',))], ('Store',)), ('Name', (1, 13), 'c', ('Load',)), [('Pass', (1, 16))], [])]), +('Module', [('Expr', (1, 0), ('GeneratorExp', (1, 0), ('Tuple', (2, 4), [('Name', (3, 4), 'Aa', ('Load',)), ('Name', (5, 7), 'Bb', ('Load',))], ('Load',)), [('comprehension', ('Tuple', (8, 4), [('Name', (8, 4), 'Aa', ('Store',)), ('Name', (10, 4), 'Bb', ('Store',))], ('Store',)), ('Name', (10, 10), 'Cc', ('Load',)), [], 0)]))]), ('Module', [('Expr', (1, 0), ('DictComp', (1, 0), ('Name', (1, 1), 'a', ('Load',)), ('Name', (1, 5), 'b', ('Load',)), [('comprehension', ('Name', (1, 11), 'w', ('Store',)), ('Name', (1, 16), 'x', ('Load',)), [], 0), ('comprehension', ('Name', (1, 22), 'm', ('Store',)), ('Name', (1, 27), 'p', ('Load',)), [('Name', (1, 32), 'g', ('Load',))], 0)]))]), ('Module', [('Expr', (1, 0), ('DictComp', (1, 0), ('Name', (1, 1), 'a', ('Load',)), ('Name', (1, 5), 'b', ('Load',)), [('comprehension', ('Tuple', (1, 11), [('Name', (1, 11), 'v', ('Store',)), ('Name', (1, 13), 'w', ('Store',))], ('Store',)), ('Name', (1, 18), 'x', ('Load',)), [], 0)]))]), ('Module', [('Expr', (1, 0), ('SetComp', (1, 0), ('Name', (1, 1), 'r', ('Load',)), [('comprehension', ('Name', (1, 7), 'l', ('Store',)), ('Name', (1, 12), 'x', ('Load',)), [('Name', (1, 17), 'g', ('Load',))], 0)]))]), @@ -1297,10 +1315,11 @@ def main(): ('Module', [('AsyncFunctionDef', (1, 0), 'f', ('arguments', [], None, [], [], None, []), [('AsyncWith', (2, 1), [('withitem', ('Name', (2, 12), 'a', ('Load',)), ('Name', (2, 17), 'b', ('Store',)))], [('Expr', (2, 20), ('Constant', (2, 20), 1))])], [], None)]), ('Module', [('Expr', (1, 0), ('Dict', (1, 0), [None, ('Constant', (1, 10), 2)], [('Dict', (1, 3), [('Constant', (1, 4), 1)], [('Constant', (1, 6), 2)]), ('Constant', (1, 12), 3)]))]), ('Module', [('Expr', (1, 0), ('Set', (1, 0), [('Starred', (1, 1), ('Set', (1, 2), [('Constant', (1, 3), 1), ('Constant', (1, 6), 2)]), ('Load',)), ('Constant', (1, 10), 3)]))]), -('Module', [('AsyncFunctionDef', (1, 0), 'f', ('arguments', [], None, [], [], None, []), [('Expr', (2, 1), ('ListComp', (2, 2), ('Name', (2, 2), 'i', ('Load',)), [('comprehension', ('Name', (2, 14), 'b', ('Store',)), ('Name', (2, 19), 'c', ('Load',)), [], 1)]))], [], None)]), +('Module', [('AsyncFunctionDef', (1, 0), 'f', ('arguments', [], None, [], [], None, []), [('Expr', (2, 1), ('ListComp', (2, 1), ('Name', (2, 2), 'i', ('Load',)), [('comprehension', ('Name', (2, 14), 'b', ('Store',)), ('Name', (2, 19), 'c', ('Load',)), [], 1)]))], [], None)]), ('Module', [('FunctionDef', (3, 0), 'f', ('arguments', [], None, [], [], None, []), [('Pass', (3, 9))], [('Name', (1, 1), 'deco1', ('Load',)), ('Call', (2, 0), ('Name', (2, 1), 'deco2', ('Load',)), [], [])], None)]), ('Module', [('AsyncFunctionDef', (3, 0), 'f', ('arguments', [], None, [], [], None, []), [('Pass', (3, 15))], [('Name', (1, 1), 'deco1', ('Load',)), ('Call', (2, 0), ('Name', (2, 1), 'deco2', ('Load',)), [], [])], None)]), ('Module', [('ClassDef', (3, 0), 'C', [], [], [('Pass', (3, 9))], [('Name', (1, 1), 'deco1', ('Load',)), ('Call', (2, 0), ('Name', (2, 1), 'deco2', ('Load',)), [], [])])]), +('Module', [('FunctionDef', (2, 0), 'f', ('arguments', [], None, [], [], None, []), [('Pass', (2, 9))], [('Call', (1, 1), ('Name', (1, 1), 'deco', ('Load',)), [('GeneratorExp', (1, 5), ('Name', (1, 6), 'a', ('Load',)), [('comprehension', ('Name', (1, 12), 'a', ('Store',)), ('Name', (1, 17), 'b', ('Load',)), [], 0)])], [])], None)]), ] single_results = [ ('Interactive', [('Expr', (1, 0), ('BinOp', (1, 0), ('Constant', (1, 0), 1), ('Add',), ('Constant', (1, 2), 2)))]), @@ -1315,10 +1334,20 @@ def main(): ('Expression', ('Dict', (1, 0), [], [])), ('Expression', ('Set', (1, 0), [('Constant', (1, 1), None)])), ('Expression', ('Dict', (1, 0), [('Constant', (2, 6), 1)], [('Constant', (4, 10), 2)])), -('Expression', ('ListComp', (1, 1), ('Name', (1, 1), 'a', ('Load',)), [('comprehension', ('Name', (1, 7), 'b', ('Store',)), ('Name', (1, 12), 'c', ('Load',)), [('Name', (1, 17), 'd', ('Load',))], 0)])), -('Expression', ('GeneratorExp', (1, 1), ('Name', (1, 1), 'a', ('Load',)), [('comprehension', ('Name', (1, 7), 'b', ('Store',)), ('Name', (1, 12), 'c', ('Load',)), [('Name', (1, 17), 'd', ('Load',))], 0)])), +('Expression', ('ListComp', (1, 0), ('Name', (1, 1), 'a', ('Load',)), [('comprehension', ('Name', (1, 7), 'b', ('Store',)), ('Name', (1, 12), 'c', ('Load',)), [('Name', (1, 17), 'd', ('Load',))], 0)])), +('Expression', ('GeneratorExp', (1, 0), ('Name', (1, 1), 'a', ('Load',)), [('comprehension', ('Name', (1, 7), 'b', ('Store',)), ('Name', (1, 12), 'c', ('Load',)), [('Name', (1, 17), 'd', ('Load',))], 0)])), +('Expression', ('ListComp', (1, 0), ('Tuple', (1, 1), [('Name', (1, 2), 'a', ('Load',)), ('Name', (1, 4), 'b', ('Load',))], ('Load',)), [('comprehension', ('Tuple', (1, 11), [('Name', (1, 11), 'a', ('Store',)), ('Name', (1, 13), 'b', ('Store',))], ('Store',)), ('Name', (1, 18), 'c', ('Load',)), [], 0)])), +('Expression', ('ListComp', (1, 0), ('Tuple', (1, 1), [('Name', (1, 2), 'a', ('Load',)), ('Name', (1, 4), 'b', ('Load',))], ('Load',)), [('comprehension', ('Tuple', (1, 11), [('Name', (1, 12), 'a', ('Store',)), ('Name', (1, 14), 'b', ('Store',))], ('Store',)), ('Name', (1, 20), 'c', ('Load',)), [], 0)])), +('Expression', ('ListComp', (1, 0), ('Tuple', (1, 1), [('Name', (1, 2), 'a', ('Load',)), ('Name', (1, 4), 'b', ('Load',))], ('Load',)), [('comprehension', ('List', (1, 11), [('Name', (1, 12), 'a', ('Store',)), ('Name', (1, 14), 'b', ('Store',))], ('Store',)), ('Name', (1, 20), 'c', ('Load',)), [], 0)])), +('Expression', ('SetComp', (1, 0), ('Tuple', (1, 1), [('Name', (1, 2), 'a', ('Load',)), ('Name', (1, 4), 'b', ('Load',))], ('Load',)), [('comprehension', ('Tuple', (1, 11), [('Name', (1, 11), 'a', ('Store',)), ('Name', (1, 13), 'b', ('Store',))], ('Store',)), ('Name', (1, 18), 'c', ('Load',)), [], 0)])), +('Expression', ('SetComp', (1, 0), ('Tuple', (1, 1), [('Name', (1, 2), 'a', ('Load',)), ('Name', (1, 4), 'b', ('Load',))], ('Load',)), [('comprehension', ('Tuple', (1, 11), [('Name', (1, 12), 'a', ('Store',)), ('Name', (1, 14), 'b', ('Store',))], ('Store',)), ('Name', (1, 20), 'c', ('Load',)), [], 0)])), +('Expression', ('SetComp', (1, 0), ('Tuple', (1, 1), [('Name', (1, 2), 'a', ('Load',)), ('Name', (1, 4), 'b', ('Load',))], ('Load',)), [('comprehension', ('List', (1, 11), [('Name', (1, 12), 'a', ('Store',)), ('Name', (1, 14), 'b', ('Store',))], ('Store',)), ('Name', (1, 20), 'c', ('Load',)), [], 0)])), +('Expression', ('GeneratorExp', (1, 0), ('Tuple', (1, 1), [('Name', (1, 2), 'a', ('Load',)), ('Name', (1, 4), 'b', ('Load',))], ('Load',)), [('comprehension', ('Tuple', (1, 11), [('Name', (1, 11), 'a', ('Store',)), ('Name', (1, 13), 'b', ('Store',))], ('Store',)), ('Name', (1, 18), 'c', ('Load',)), [], 0)])), +('Expression', ('GeneratorExp', (1, 0), ('Tuple', (1, 1), [('Name', (1, 2), 'a', ('Load',)), ('Name', (1, 4), 'b', ('Load',))], ('Load',)), [('comprehension', ('Tuple', (1, 11), [('Name', (1, 12), 'a', ('Store',)), ('Name', (1, 14), 'b', ('Store',))], ('Store',)), ('Name', (1, 20), 'c', ('Load',)), [], 0)])), +('Expression', ('GeneratorExp', (1, 0), ('Tuple', (1, 1), [('Name', (1, 2), 'a', ('Load',)), ('Name', (1, 4), 'b', ('Load',))], ('Load',)), [('comprehension', ('List', (1, 11), [('Name', (1, 12), 'a', ('Store',)), ('Name', (1, 14), 'b', ('Store',))], ('Store',)), ('Name', (1, 20), 'c', ('Load',)), [], 0)])), ('Expression', ('Compare', (1, 0), ('Constant', (1, 0), 1), [('Lt',), ('Lt',)], [('Constant', (1, 4), 2), ('Constant', (1, 8), 3)])), ('Expression', ('Call', (1, 0), ('Name', (1, 0), 'f', ('Load',)), [('Constant', (1, 2), 1), ('Constant', (1, 4), 2), ('Starred', (1, 10), ('Name', (1, 11), 'd', ('Load',)), ('Load',))], [('keyword', 'c', ('Constant', (1, 8), 3)), ('keyword', None, ('Name', (1, 15), 'e', ('Load',)))])), +('Expression', ('Call', (1, 0), ('Name', (1, 0), 'f', ('Load',)), [('GeneratorExp', (1, 1), ('Name', (1, 2), 'a', ('Load',)), [('comprehension', ('Name', (1, 8), 'a', ('Store',)), ('Name', (1, 13), 'b', ('Load',)), [], 0)])], [])), ('Expression', ('Constant', (1, 0), 10)), ('Expression', ('Constant', (1, 0), 'string')), ('Expression', ('Attribute', (1, 0), ('Name', (1, 0), 'a', ('Load',)), 'b', ('Load',))), @@ -1327,7 +1356,7 @@ def main(): ('Expression', ('List', (1, 0), [('Constant', (1, 1), 1), ('Constant', (1, 3), 2), ('Constant', (1, 5), 3)], ('Load',))), ('Expression', ('List', (1, 0), [], ('Load',))), ('Expression', ('Tuple', (1, 0), [('Constant', (1, 0), 1), ('Constant', (1, 2), 2), ('Constant', (1, 4), 3)], ('Load',))), -('Expression', ('Tuple', (1, 1), [('Constant', (1, 1), 1), ('Constant', (1, 3), 2), ('Constant', (1, 5), 3)], ('Load',))), +('Expression', ('Tuple', (1, 0), [('Constant', (1, 1), 1), ('Constant', (1, 3), 2), ('Constant', (1, 5), 3)], ('Load',))), ('Expression', ('Tuple', (1, 0), [], ('Load',))), ('Expression', ('Call', (1, 0), ('Attribute', (1, 0), ('Attribute', (1, 0), ('Attribute', (1, 0), ('Name', (1, 0), 'a', ('Load',)), 'b', ('Load',)), 'c', ('Load',)), 'd', ('Load',)), [('Subscript', (1, 8), ('Attribute', (1, 8), ('Name', (1, 8), 'a', ('Load',)), 'b', ('Load',)), ('Slice', ('Constant', (1, 12), 1), ('Constant', (1, 14), 2), None), ('Load',))], [])), ] diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py index 535324880089..6ef529e2b015 100644 --- a/Lib/test/test_exceptions.py +++ b/Lib/test/test_exceptions.py @@ -204,7 +204,7 @@ def check(src, lineno, offset): check('x = 0o9', 1, 6) # Errors thrown by symtable.c - check('x = [(yield i) for i in range(3)]', 1, 6) + check('x = [(yield i) for i in range(3)]', 1, 5) check('def f():\n from _ import *', 1, 1) check('def f(x, x):\n pass', 1, 1) check('def f(x):\n nonlocal x', 2, 3) diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-11-21-14-05-51.bpo-31241.Kin10-.rst b/Misc/NEWS.d/next/Core and Builtins/2018-11-21-14-05-51.bpo-31241.Kin10-.rst new file mode 100644 index 000000000000..a859a9b0d68e --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-11-21-14-05-51.bpo-31241.Kin10-.rst @@ -0,0 +1,4 @@ +The *lineno* and *col_offset* attributes of AST nodes for list comprehensions, +generator expressions and tuples are now point to the opening parenthesis or +square brace. For tuples without parenthesis they point to the position of +the first item. diff --git a/Python/ast.c b/Python/ast.c index 0d78cc511641..24d5843aabd2 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -577,7 +577,8 @@ static stmt_ty ast_for_with_stmt(struct compiling *, const node *, bool); static stmt_ty ast_for_for_stmt(struct compiling *, const node *, bool); /* Note different signature for ast_for_call */ -static expr_ty ast_for_call(struct compiling *, const node *, expr_ty, bool); +static expr_ty ast_for_call(struct compiling *, const node *, expr_ty, + const node *); static PyObject *parsenumber(struct compiling *, const char *); static expr_ty parsestrplus(struct compiling *, const node *n); @@ -931,6 +932,16 @@ forbidden_name(struct compiling *c, identifier name, const node *n, return 0; } +static expr_ty +copy_location(expr_ty e, const node *n) +{ + if (e) { + e->lineno = LINENO(n); + e->col_offset = n->n_col_offset; + } + return e; +} + /* Set the context ctx for expr_ty e, recursively traversing e. Only sets context for expr kinds that "can appear in assignment context" @@ -1519,7 +1530,7 @@ ast_for_decorator(struct compiling *c, const node *n) name_expr = NULL; } else { - d = ast_for_call(c, CHILD(n, 3), name_expr, true); + d = ast_for_call(c, CHILD(n, 3), name_expr, CHILD(n, 2)); if (!d) return NULL; name_expr = NULL; @@ -2129,10 +2140,16 @@ ast_for_atom(struct compiling *c, const node *n) return ast_for_expr(c, ch); /* testlist_comp: test ( comp_for | (',' test)* [','] ) */ - if ((NCH(ch) > 1) && (TYPE(CHILD(ch, 1)) == comp_for)) - return ast_for_genexp(c, ch); + if (NCH(ch) == 1) { + return ast_for_testlist(c, ch); + } - return ast_for_testlist(c, ch); + if (TYPE(CHILD(ch, 1)) == comp_for) { + return copy_location(ast_for_genexp(c, ch), n); + } + else { + return copy_location(ast_for_testlist(c, ch), n); + } case LSQB: /* list (or list comprehension) */ ch = CHILD(n, 1); @@ -2147,8 +2164,9 @@ ast_for_atom(struct compiling *c, const node *n) return List(elts, Load, LINENO(n), n->n_col_offset, c->c_arena); } - else - return ast_for_listcomp(c, ch); + else { + return copy_location(ast_for_listcomp(c, ch), n); + } case LBRACE: { /* dictorsetmaker: ( ((test ':' test | '**' test) * (comp_for | (',' (test ':' test | '**' test))* [','])) | @@ -2187,11 +2205,7 @@ ast_for_atom(struct compiling *c, const node *n) /* It's a dictionary display. */ res = ast_for_dictdisplay(c, ch); } - if (res) { - res->lineno = LINENO(n); - res->col_offset = n->n_col_offset; - } - return res; + return copy_location(res, n); } } default: @@ -2330,7 +2344,7 @@ ast_for_trailer(struct compiling *c, const node *n, expr_ty left_expr) return Call(left_expr, NULL, NULL, LINENO(n), n->n_col_offset, c->c_arena); else - return ast_for_call(c, CHILD(n, 1), left_expr, true); + return ast_for_call(c, CHILD(n, 1), left_expr, CHILD(n, 0)); } else if (TYPE(CHILD(n, 0)) == DOT) { PyObject *attr_id = NEW_IDENTIFIER(CHILD(n, 1)); @@ -2667,7 +2681,8 @@ ast_for_expr(struct compiling *c, const node *n) } static expr_ty -ast_for_call(struct compiling *c, const node *n, expr_ty func, bool allowgen) +ast_for_call(struct compiling *c, const node *n, expr_ty func, + const node *maybegenbeg) { /* arglist: argument (',' argument)* [','] @@ -2690,7 +2705,7 @@ ast_for_call(struct compiling *c, const node *n, expr_ty func, bool allowgen) nargs++; else if (TYPE(CHILD(ch, 1)) == comp_for) { nargs++; - if (!allowgen) { + if (!maybegenbeg) { ast_error(c, ch, "invalid syntax"); return NULL; } @@ -2775,7 +2790,7 @@ ast_for_call(struct compiling *c, const node *n, expr_ty func, bool allowgen) } else if (TYPE(CHILD(ch, 1)) == comp_for) { /* the lone generator expression */ - e = ast_for_genexp(c, ch); + e = copy_location(ast_for_genexp(c, ch), maybegenbeg); if (!e) return NULL; asdl_seq_SET(args, nargs++, e); @@ -3935,7 +3950,7 @@ ast_for_classdef(struct compiling *c, const node *n, asdl_seq *decorator_seq) if (!dummy_name) return NULL; dummy = Name(dummy_name, Load, LINENO(n), n->n_col_offset, c->c_arena); - call = ast_for_call(c, CHILD(n, 3), dummy, false); + call = ast_for_call(c, CHILD(n, 3), dummy, NULL); if (!call) return NULL; } diff --git a/Python/importlib_zipimport.h b/Python/importlib_zipimport.h index 2d6868ec80cf..e00010c11fc9 100644 --- a/Python/importlib_zipimport.h +++ b/Python/importlib_zipimport.h @@ -869,207 +869,207 @@ const unsigned char _Py_M__zipimport[] = { 132,0,0,0,90,6,109,107,116,105,109,101,41,2,218,1, 100,114,139,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,139,2,0,0,115,24,0,0,0,0,1, + 115,116,105,109,101,139,2,0,0,115,22,0,0,0,0,1, 4,1,10,1,10,1,6,1,6,1,10,1,10,1,2,0, - 2,0,2,250,2,255,114,170,0,0,0,99,2,0,0,0, - 0,0,0,0,6,0,0,0,10,0,0,0,67,0,0,0, - 115,116,0,0,0,122,82,124,1,100,1,100,0,133,2,25, - 0,100,2,107,6,115,22,116,0,130,1,124,1,100,0,100, - 1,133,2,25,0,125,1,124,0,106,1,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,2,124,4,124,3,131, - 2,124,5,102,2,87,0,83,0,4,0,116,3,116,4,116, - 5,102,3,107,10,114,110,1,0,1,0,1,0,89,0,100, - 6,83,0,88,0,100,0,83,0,41,7,78,114,14,0,0, - 0,169,2,218,1,99,218,1,111,114,164,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,6,218,14,65,115,115,101,114,116,105,111, - 110,69,114,114,111,114,114,28,0,0,0,114,170,0,0,0, - 114,26,0,0,0,218,10,73,110,100,101,120,69,114,114,111, - 114,114,155,0,0,0,41,6,114,32,0,0,0,114,13,0, - 0,0,114,54,0,0,0,114,132,0,0,0,114,133,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,152,0,0,0,152,2,0,0,115,20,0,0, - 0,0,1,2,2,20,1,12,1,10,3,8,1,8,1,8, - 1,16,1,20,1,114,152,0,0,0,99,2,0,0,0,0, - 0,0,0,3,0,0,0,8,0,0,0,67,0,0,0,115, - 86,0,0,0,124,1,100,1,100,0,133,2,25,0,100,2, - 107,6,115,20,116,0,130,1,124,1,100,0,100,1,133,2, - 25,0,125,1,122,14,124,0,106,1,124,1,25,0,125,2, - 87,0,110,22,4,0,116,2,107,10,114,68,1,0,1,0, - 1,0,89,0,100,0,83,0,88,0,116,3,124,0,106,4, - 124,2,131,2,83,0,100,0,83,0,41,3,78,114,14,0, - 0,0,114,171,0,0,0,41,5,114,176,0,0,0,114,28, - 0,0,0,114,26,0,0,0,114,52,0,0,0,114,29,0, - 0,0,41,3,114,32,0,0,0,114,13,0,0,0,114,54, - 0,0,0,114,9,0,0,0,114,9,0,0,0,114,10,0, - 0,0,114,150,0,0,0,171,2,0,0,115,14,0,0,0, - 0,2,20,1,12,2,2,1,14,1,14,1,8,2,114,150, - 0,0,0,99,2,0,0,0,0,0,0,0,11,0,0,0, - 9,0,0,0,67,0,0,0,115,198,0,0,0,116,0,124, - 0,124,1,131,2,125,2,116,1,68,0,93,160,92,3,125, - 3,125,4,125,5,124,2,124,3,23,0,125,6,116,2,106, - 3,100,1,124,0,106,4,116,5,124,6,100,2,100,3,141, - 5,1,0,122,14,124,0,106,6,124,6,25,0,125,7,87, - 0,110,20,4,0,116,7,107,10,114,88,1,0,1,0,1, - 0,89,0,113,14,88,0,124,7,100,4,25,0,125,8,116, - 8,124,0,106,4,124,7,131,2,125,9,124,4,114,132,116, - 9,124,0,124,8,124,6,124,1,124,9,131,5,125,10,110, - 10,116,10,124,8,124,9,131,2,125,10,124,10,100,0,107, - 8,114,152,113,14,124,7,100,4,25,0,125,8,124,10,124, - 5,124,8,102,3,2,0,1,0,83,0,113,14,116,11,100, - 5,124,1,155,2,157,2,124,1,100,6,141,2,130,1,100, - 0,83,0,41,7,78,122,13,116,114,121,105,110,103,32,123, - 125,123,125,123,125,114,86,0,0,0,41,1,90,9,118,101, - 114,98,111,115,105,116,121,114,0,0,0,0,114,57,0,0, - 0,114,58,0,0,0,41,12,114,36,0,0,0,114,89,0, - 0,0,114,76,0,0,0,114,77,0,0,0,114,29,0,0, - 0,114,20,0,0,0,114,28,0,0,0,114,26,0,0,0, - 114,52,0,0,0,114,156,0,0,0,114,162,0,0,0,114, - 3,0,0,0,41,11,114,32,0,0,0,114,38,0,0,0, - 114,13,0,0,0,114,90,0,0,0,114,91,0,0,0,114, - 47,0,0,0,114,63,0,0,0,114,54,0,0,0,114,40, - 0,0,0,114,127,0,0,0,114,46,0,0,0,114,9,0, - 0,0,114,9,0,0,0,114,10,0,0,0,114,44,0,0, - 0,186,2,0,0,115,36,0,0,0,0,1,10,1,14,1, - 8,1,22,1,2,1,14,1,14,1,6,2,8,1,12,1, - 4,1,18,2,10,1,8,3,2,1,8,1,16,2,114,44, - 0,0,0,99,0,0,0,0,0,0,0,0,0,0,0,0, - 2,0,0,0,64,0,0,0,115,60,0,0,0,101,0,90, - 1,100,0,90,2,100,1,90,3,100,2,90,4,100,3,100, - 4,132,0,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,83,0,41,14,114,80,0,0,0, - 122,165,80,114,105,118,97,116,101,32,99,108,97,115,115,32, - 117,115,101,100,32,116,111,32,115,117,112,112,111,114,116,32, - 90,105,112,73,109,112,111,114,116,46,103,101,116,95,114,101, - 115,111,117,114,99,101,95,114,101,97,100,101,114,40,41,46, - 10,10,32,32,32,32,84,104,105,115,32,99,108,97,115,115, - 32,105,115,32,97,108,108,111,119,101,100,32,116,111,32,114, - 101,102,101,114,101,110,99,101,32,97,108,108,32,116,104,101, - 32,105,110,110,97,114,100,115,32,97,110,100,32,112,114,105, - 118,97,116,101,32,112,97,114,116,115,32,111,102,10,32,32, - 32,32,116,104,101,32,122,105,112,105,109,112,111,114,116,101, - 114,46,10,32,32,32,32,70,99,3,0,0,0,0,0,0, - 0,3,0,0,0,2,0,0,0,67,0,0,0,115,16,0, - 0,0,124,1,124,0,95,0,124,2,124,0,95,1,100,0, - 83,0,114,88,0,0,0,41,2,114,4,0,0,0,114,38, - 0,0,0,41,3,114,32,0,0,0,114,4,0,0,0,114, - 38,0,0,0,114,9,0,0,0,114,9,0,0,0,114,10, - 0,0,0,114,34,0,0,0,220,2,0,0,115,4,0,0, - 0,0,1,6,1,122,33,95,90,105,112,73,109,112,111,114, - 116,82,101,115,111,117,114,99,101,82,101,97,100,101,114,46, - 95,95,105,110,105,116,95,95,99,2,0,0,0,0,0,0, - 0,5,0,0,0,8,0,0,0,67,0,0,0,115,92,0, - 0,0,124,0,106,0,160,1,100,1,100,2,161,2,125,2, - 124,2,155,0,100,2,124,1,155,0,157,3,125,3,100,3, - 100,4,108,2,109,3,125,4,1,0,122,18,124,4,124,0, - 106,4,160,5,124,3,161,1,131,1,87,0,83,0,4,0, - 116,6,107,10,114,86,1,0,1,0,1,0,116,7,124,3, - 131,1,130,1,89,0,110,2,88,0,100,0,83,0,41,5, - 78,114,85,0,0,0,114,110,0,0,0,114,0,0,0,0, - 41,1,218,7,66,121,116,101,115,73,79,41,8,114,38,0, - 0,0,114,19,0,0,0,90,2,105,111,114,178,0,0,0, - 114,4,0,0,0,114,55,0,0,0,114,22,0,0,0,218, - 17,70,105,108,101,78,111,116,70,111,117,110,100,69,114,114, - 111,114,41,5,114,32,0,0,0,218,8,114,101,115,111,117, - 114,99,101,218,16,102,117,108,108,110,97,109,101,95,97,115, - 95,112,97,116,104,114,13,0,0,0,114,178,0,0,0,114, - 9,0,0,0,114,9,0,0,0,114,10,0,0,0,218,13, - 111,112,101,110,95,114,101,115,111,117,114,99,101,224,2,0, - 0,115,14,0,0,0,0,1,14,1,14,1,12,1,2,1, - 18,1,14,1,122,38,95,90,105,112,73,109,112,111,114,116, - 82,101,115,111,117,114,99,101,82,101,97,100,101,114,46,111, - 112,101,110,95,114,101,115,111,117,114,99,101,99,2,0,0, - 0,0,0,0,0,2,0,0,0,1,0,0,0,67,0,0, - 0,115,8,0,0,0,116,0,130,1,100,0,83,0,114,88, - 0,0,0,41,1,114,179,0,0,0,41,2,114,32,0,0, - 0,114,180,0,0,0,114,9,0,0,0,114,9,0,0,0, - 114,10,0,0,0,218,13,114,101,115,111,117,114,99,101,95, - 112,97,116,104,233,2,0,0,115,2,0,0,0,0,4,122, - 38,95,90,105,112,73,109,112,111,114,116,82,101,115,111,117, - 114,99,101,82,101,97,100,101,114,46,114,101,115,111,117,114, - 99,101,95,112,97,116,104,99,2,0,0,0,0,0,0,0, - 4,0,0,0,8,0,0,0,67,0,0,0,115,72,0,0, - 0,124,0,106,0,160,1,100,1,100,2,161,2,125,2,124, - 2,155,0,100,2,124,1,155,0,157,3,125,3,122,16,124, - 0,106,2,160,3,124,3,161,1,1,0,87,0,110,22,4, - 0,116,4,107,10,114,66,1,0,1,0,1,0,89,0,100, - 3,83,0,88,0,100,4,83,0,41,5,78,114,85,0,0, - 0,114,110,0,0,0,70,84,41,5,114,38,0,0,0,114, - 19,0,0,0,114,4,0,0,0,114,55,0,0,0,114,22, - 0,0,0,41,4,114,32,0,0,0,114,59,0,0,0,114, - 181,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,105,115,95,114,101,115, - 111,117,114,99,101,239,2,0,0,115,14,0,0,0,0,3, - 14,1,14,1,2,1,16,1,14,1,8,1,122,36,95,90, - 105,112,73,109,112,111,114,116,82,101,115,111,117,114,99,101, - 82,101,97,100,101,114,46,105,115,95,114,101,115,111,117,114, - 99,101,99,1,0,0,0,0,0,0,0,9,0,0,0,9, - 0,0,0,99,0,0,0,115,186,0,0,0,100,1,100,2, - 108,0,109,1,125,1,1,0,124,1,124,0,106,2,160,3, - 124,0,106,4,161,1,131,1,125,2,124,2,160,5,124,0, - 106,2,106,6,161,1,125,3,124,3,106,7,100,3,107,2, - 115,58,116,8,130,1,124,3,106,9,125,4,116,10,131,0, - 125,5,124,0,106,2,106,11,68,0,93,102,125,6,122,18, - 124,1,124,6,131,1,160,5,124,4,161,1,125,7,87,0, - 110,24,4,0,116,12,107,10,114,124,1,0,1,0,1,0, - 89,0,113,78,89,0,110,2,88,0,124,7,106,9,106,7, - 125,8,116,13,124,8,131,1,100,1,107,2,114,156,124,7, - 106,7,86,0,1,0,113,78,124,8,124,5,107,7,114,78, - 124,5,160,14,124,8,161,1,1,0,124,8,86,0,1,0, - 113,78,100,0,83,0,41,4,78,114,0,0,0,0,41,1, - 218,4,80,97,116,104,114,60,0,0,0,41,15,90,7,112, - 97,116,104,108,105,98,114,185,0,0,0,114,4,0,0,0, - 114,56,0,0,0,114,38,0,0,0,90,11,114,101,108,97, - 116,105,118,101,95,116,111,114,29,0,0,0,114,59,0,0, - 0,114,176,0,0,0,90,6,112,97,114,101,110,116,218,3, - 115,101,116,114,28,0,0,0,114,23,0,0,0,114,51,0, - 0,0,218,3,97,100,100,41,9,114,32,0,0,0,114,185, - 0,0,0,90,13,102,117,108,108,110,97,109,101,95,112,97, - 116,104,90,13,114,101,108,97,116,105,118,101,95,112,97,116, - 104,90,12,112,97,99,107,97,103,101,95,112,97,116,104,90, - 12,115,117,98,100,105,114,115,95,115,101,101,110,218,8,102, - 105,108,101,110,97,109,101,90,8,114,101,108,97,116,105,118, - 101,90,11,112,97,114,101,110,116,95,110,97,109,101,114,9, - 0,0,0,114,9,0,0,0,114,10,0,0,0,218,8,99, - 111,110,116,101,110,116,115,250,2,0,0,115,34,0,0,0, - 0,8,12,1,18,1,14,3,14,1,6,1,6,1,12,1, - 2,1,18,1,14,1,10,5,8,1,12,1,10,1,8,1, - 10,1,122,33,95,90,105,112,73,109,112,111,114,116,82,101, - 115,111,117,114,99,101,82,101,97,100,101,114,46,99,111,110, - 116,101,110,116,115,78,41,10,114,6,0,0,0,114,7,0, - 0,0,114,8,0,0,0,114,84,0,0,0,114,81,0,0, - 0,114,34,0,0,0,114,182,0,0,0,114,183,0,0,0, - 114,184,0,0,0,114,189,0,0,0,114,9,0,0,0,114, - 9,0,0,0,114,9,0,0,0,114,10,0,0,0,114,80, - 0,0,0,212,2,0,0,115,14,0,0,0,8,5,4,1, - 4,2,8,4,8,9,8,6,8,11,114,80,0,0,0,41, - 45,114,84,0,0,0,90,26,95,102,114,111,122,101,110,95, - 105,109,112,111,114,116,108,105,98,95,101,120,116,101,114,110, - 97,108,114,21,0,0,0,114,1,0,0,0,114,2,0,0, - 0,90,17,95,102,114,111,122,101,110,95,105,109,112,111,114, - 116,108,105,98,114,76,0,0,0,114,149,0,0,0,114,111, - 0,0,0,114,153,0,0,0,114,67,0,0,0,114,132,0, - 0,0,90,7,95,95,97,108,108,95,95,114,20,0,0,0, - 90,15,112,97,116,104,95,115,101,112,97,114,97,116,111,114, - 115,114,18,0,0,0,114,75,0,0,0,114,3,0,0,0, - 114,25,0,0,0,218,4,116,121,112,101,114,70,0,0,0, - 114,114,0,0,0,114,116,0,0,0,114,118,0,0,0,114, - 4,0,0,0,114,89,0,0,0,114,36,0,0,0,114,37, - 0,0,0,114,35,0,0,0,114,27,0,0,0,114,123,0, - 0,0,114,143,0,0,0,114,145,0,0,0,114,52,0,0, - 0,114,148,0,0,0,114,156,0,0,0,218,8,95,95,99, - 111,100,101,95,95,114,154,0,0,0,114,160,0,0,0,114, - 162,0,0,0,114,170,0,0,0,114,152,0,0,0,114,150, - 0,0,0,114,44,0,0,0,114,80,0,0,0,114,9,0, + 2,0,2,249,114,170,0,0,0,99,2,0,0,0,0,0, + 0,0,6,0,0,0,10,0,0,0,67,0,0,0,115,116, + 0,0,0,122,82,124,1,100,1,100,0,133,2,25,0,100, + 2,107,6,115,22,116,0,130,1,124,1,100,0,100,1,133, + 2,25,0,125,1,124,0,106,1,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,2,124,4,124,3,131,2,124, + 5,102,2,87,0,83,0,4,0,116,3,116,4,116,5,102, + 3,107,10,114,110,1,0,1,0,1,0,89,0,100,6,83, + 0,88,0,100,0,83,0,41,7,78,114,14,0,0,0,169, + 2,218,1,99,218,1,111,114,164,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,6,218,14,65,115,115,101,114,116,105,111,110,69, + 114,114,111,114,114,28,0,0,0,114,170,0,0,0,114,26, + 0,0,0,218,10,73,110,100,101,120,69,114,114,111,114,114, + 155,0,0,0,41,6,114,32,0,0,0,114,13,0,0,0, + 114,54,0,0,0,114,132,0,0,0,114,133,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,152,0,0,0,152,2,0,0,115,20,0,0,0,0, + 1,2,2,20,1,12,1,10,3,8,1,8,1,8,1,16, + 1,20,1,114,152,0,0,0,99,2,0,0,0,0,0,0, + 0,3,0,0,0,8,0,0,0,67,0,0,0,115,86,0, + 0,0,124,1,100,1,100,0,133,2,25,0,100,2,107,6, + 115,20,116,0,130,1,124,1,100,0,100,1,133,2,25,0, + 125,1,122,14,124,0,106,1,124,1,25,0,125,2,87,0, + 110,22,4,0,116,2,107,10,114,68,1,0,1,0,1,0, + 89,0,100,0,83,0,88,0,116,3,124,0,106,4,124,2, + 131,2,83,0,100,0,83,0,41,3,78,114,14,0,0,0, + 114,171,0,0,0,41,5,114,176,0,0,0,114,28,0,0, + 0,114,26,0,0,0,114,52,0,0,0,114,29,0,0,0, + 41,3,114,32,0,0,0,114,13,0,0,0,114,54,0,0, + 0,114,9,0,0,0,114,9,0,0,0,114,10,0,0,0, + 114,150,0,0,0,171,2,0,0,115,14,0,0,0,0,2, + 20,1,12,2,2,1,14,1,14,1,8,2,114,150,0,0, + 0,99,2,0,0,0,0,0,0,0,11,0,0,0,9,0, + 0,0,67,0,0,0,115,198,0,0,0,116,0,124,0,124, + 1,131,2,125,2,116,1,68,0,93,160,92,3,125,3,125, + 4,125,5,124,2,124,3,23,0,125,6,116,2,106,3,100, + 1,124,0,106,4,116,5,124,6,100,2,100,3,141,5,1, + 0,122,14,124,0,106,6,124,6,25,0,125,7,87,0,110, + 20,4,0,116,7,107,10,114,88,1,0,1,0,1,0,89, + 0,113,14,88,0,124,7,100,4,25,0,125,8,116,8,124, + 0,106,4,124,7,131,2,125,9,124,4,114,132,116,9,124, + 0,124,8,124,6,124,1,124,9,131,5,125,10,110,10,116, + 10,124,8,124,9,131,2,125,10,124,10,100,0,107,8,114, + 152,113,14,124,7,100,4,25,0,125,8,124,10,124,5,124, + 8,102,3,2,0,1,0,83,0,113,14,116,11,100,5,124, + 1,155,2,157,2,124,1,100,6,141,2,130,1,100,0,83, + 0,41,7,78,122,13,116,114,121,105,110,103,32,123,125,123, + 125,123,125,114,86,0,0,0,41,1,90,9,118,101,114,98, + 111,115,105,116,121,114,0,0,0,0,114,57,0,0,0,114, + 58,0,0,0,41,12,114,36,0,0,0,114,89,0,0,0, + 114,76,0,0,0,114,77,0,0,0,114,29,0,0,0,114, + 20,0,0,0,114,28,0,0,0,114,26,0,0,0,114,52, + 0,0,0,114,156,0,0,0,114,162,0,0,0,114,3,0, + 0,0,41,11,114,32,0,0,0,114,38,0,0,0,114,13, + 0,0,0,114,90,0,0,0,114,91,0,0,0,114,47,0, + 0,0,114,63,0,0,0,114,54,0,0,0,114,40,0,0, + 0,114,127,0,0,0,114,46,0,0,0,114,9,0,0,0, + 114,9,0,0,0,114,10,0,0,0,114,44,0,0,0,186, + 2,0,0,115,36,0,0,0,0,1,10,1,14,1,8,1, + 22,1,2,1,14,1,14,1,6,2,8,1,12,1,4,1, + 18,2,10,1,8,3,2,1,8,1,16,2,114,44,0,0, + 0,99,0,0,0,0,0,0,0,0,0,0,0,0,2,0, + 0,0,64,0,0,0,115,60,0,0,0,101,0,90,1,100, + 0,90,2,100,1,90,3,100,2,90,4,100,3,100,4,132, + 0,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,83,0,41,14,114,80,0,0,0,122,165, + 80,114,105,118,97,116,101,32,99,108,97,115,115,32,117,115, + 101,100,32,116,111,32,115,117,112,112,111,114,116,32,90,105, + 112,73,109,112,111,114,116,46,103,101,116,95,114,101,115,111, + 117,114,99,101,95,114,101,97,100,101,114,40,41,46,10,10, + 32,32,32,32,84,104,105,115,32,99,108,97,115,115,32,105, + 115,32,97,108,108,111,119,101,100,32,116,111,32,114,101,102, + 101,114,101,110,99,101,32,97,108,108,32,116,104,101,32,105, + 110,110,97,114,100,115,32,97,110,100,32,112,114,105,118,97, + 116,101,32,112,97,114,116,115,32,111,102,10,32,32,32,32, + 116,104,101,32,122,105,112,105,109,112,111,114,116,101,114,46, + 10,32,32,32,32,70,99,3,0,0,0,0,0,0,0,3, + 0,0,0,2,0,0,0,67,0,0,0,115,16,0,0,0, + 124,1,124,0,95,0,124,2,124,0,95,1,100,0,83,0, + 114,88,0,0,0,41,2,114,4,0,0,0,114,38,0,0, + 0,41,3,114,32,0,0,0,114,4,0,0,0,114,38,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,13,0,0,0,115, - 90,0,0,0,4,4,8,1,16,1,8,1,8,1,8,1, - 8,1,8,1,8,2,8,3,6,1,14,3,16,4,4,2, - 8,2,4,1,4,1,4,2,14,127,0,127,0,1,12,1, - 12,1,2,1,2,253,2,255,2,9,8,4,8,9,8,31, - 8,126,2,254,2,29,4,5,8,21,8,46,8,10,8,46, - 10,5,8,7,8,6,8,13,8,19,8,15,8,26, + 0,114,34,0,0,0,220,2,0,0,115,4,0,0,0,0, + 1,6,1,122,33,95,90,105,112,73,109,112,111,114,116,82, + 101,115,111,117,114,99,101,82,101,97,100,101,114,46,95,95, + 105,110,105,116,95,95,99,2,0,0,0,0,0,0,0,5, + 0,0,0,8,0,0,0,67,0,0,0,115,92,0,0,0, + 124,0,106,0,160,1,100,1,100,2,161,2,125,2,124,2, + 155,0,100,2,124,1,155,0,157,3,125,3,100,3,100,4, + 108,2,109,3,125,4,1,0,122,18,124,4,124,0,106,4, + 160,5,124,3,161,1,131,1,87,0,83,0,4,0,116,6, + 107,10,114,86,1,0,1,0,1,0,116,7,124,3,131,1, + 130,1,89,0,110,2,88,0,100,0,83,0,41,5,78,114, + 85,0,0,0,114,110,0,0,0,114,0,0,0,0,41,1, + 218,7,66,121,116,101,115,73,79,41,8,114,38,0,0,0, + 114,19,0,0,0,90,2,105,111,114,178,0,0,0,114,4, + 0,0,0,114,55,0,0,0,114,22,0,0,0,218,17,70, + 105,108,101,78,111,116,70,111,117,110,100,69,114,114,111,114, + 41,5,114,32,0,0,0,218,8,114,101,115,111,117,114,99, + 101,218,16,102,117,108,108,110,97,109,101,95,97,115,95,112, + 97,116,104,114,13,0,0,0,114,178,0,0,0,114,9,0, + 0,0,114,9,0,0,0,114,10,0,0,0,218,13,111,112, + 101,110,95,114,101,115,111,117,114,99,101,224,2,0,0,115, + 14,0,0,0,0,1,14,1,14,1,12,1,2,1,18,1, + 14,1,122,38,95,90,105,112,73,109,112,111,114,116,82,101, + 115,111,117,114,99,101,82,101,97,100,101,114,46,111,112,101, + 110,95,114,101,115,111,117,114,99,101,99,2,0,0,0,0, + 0,0,0,2,0,0,0,1,0,0,0,67,0,0,0,115, + 8,0,0,0,116,0,130,1,100,0,83,0,114,88,0,0, + 0,41,1,114,179,0,0,0,41,2,114,32,0,0,0,114, + 180,0,0,0,114,9,0,0,0,114,9,0,0,0,114,10, + 0,0,0,218,13,114,101,115,111,117,114,99,101,95,112,97, + 116,104,233,2,0,0,115,2,0,0,0,0,4,122,38,95, + 90,105,112,73,109,112,111,114,116,82,101,115,111,117,114,99, + 101,82,101,97,100,101,114,46,114,101,115,111,117,114,99,101, + 95,112,97,116,104,99,2,0,0,0,0,0,0,0,4,0, + 0,0,8,0,0,0,67,0,0,0,115,72,0,0,0,124, + 0,106,0,160,1,100,1,100,2,161,2,125,2,124,2,155, + 0,100,2,124,1,155,0,157,3,125,3,122,16,124,0,106, + 2,160,3,124,3,161,1,1,0,87,0,110,22,4,0,116, + 4,107,10,114,66,1,0,1,0,1,0,89,0,100,3,83, + 0,88,0,100,4,83,0,41,5,78,114,85,0,0,0,114, + 110,0,0,0,70,84,41,5,114,38,0,0,0,114,19,0, + 0,0,114,4,0,0,0,114,55,0,0,0,114,22,0,0, + 0,41,4,114,32,0,0,0,114,59,0,0,0,114,181,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,105,115,95,114,101,115,111,117, + 114,99,101,239,2,0,0,115,14,0,0,0,0,3,14,1, + 14,1,2,1,16,1,14,1,8,1,122,36,95,90,105,112, + 73,109,112,111,114,116,82,101,115,111,117,114,99,101,82,101, + 97,100,101,114,46,105,115,95,114,101,115,111,117,114,99,101, + 99,1,0,0,0,0,0,0,0,9,0,0,0,9,0,0, + 0,99,0,0,0,115,186,0,0,0,100,1,100,2,108,0, + 109,1,125,1,1,0,124,1,124,0,106,2,160,3,124,0, + 106,4,161,1,131,1,125,2,124,2,160,5,124,0,106,2, + 106,6,161,1,125,3,124,3,106,7,100,3,107,2,115,58, + 116,8,130,1,124,3,106,9,125,4,116,10,131,0,125,5, + 124,0,106,2,106,11,68,0,93,102,125,6,122,18,124,1, + 124,6,131,1,160,5,124,4,161,1,125,7,87,0,110,24, + 4,0,116,12,107,10,114,124,1,0,1,0,1,0,89,0, + 113,78,89,0,110,2,88,0,124,7,106,9,106,7,125,8, + 116,13,124,8,131,1,100,1,107,2,114,156,124,7,106,7, + 86,0,1,0,113,78,124,8,124,5,107,7,114,78,124,5, + 160,14,124,8,161,1,1,0,124,8,86,0,1,0,113,78, + 100,0,83,0,41,4,78,114,0,0,0,0,41,1,218,4, + 80,97,116,104,114,60,0,0,0,41,15,90,7,112,97,116, + 104,108,105,98,114,185,0,0,0,114,4,0,0,0,114,56, + 0,0,0,114,38,0,0,0,90,11,114,101,108,97,116,105, + 118,101,95,116,111,114,29,0,0,0,114,59,0,0,0,114, + 176,0,0,0,90,6,112,97,114,101,110,116,218,3,115,101, + 116,114,28,0,0,0,114,23,0,0,0,114,51,0,0,0, + 218,3,97,100,100,41,9,114,32,0,0,0,114,185,0,0, + 0,90,13,102,117,108,108,110,97,109,101,95,112,97,116,104, + 90,13,114,101,108,97,116,105,118,101,95,112,97,116,104,90, + 12,112,97,99,107,97,103,101,95,112,97,116,104,90,12,115, + 117,98,100,105,114,115,95,115,101,101,110,218,8,102,105,108, + 101,110,97,109,101,90,8,114,101,108,97,116,105,118,101,90, + 11,112,97,114,101,110,116,95,110,97,109,101,114,9,0,0, + 0,114,9,0,0,0,114,10,0,0,0,218,8,99,111,110, + 116,101,110,116,115,250,2,0,0,115,34,0,0,0,0,8, + 12,1,18,1,14,3,14,1,6,1,6,1,12,1,2,1, + 18,1,14,1,10,5,8,1,12,1,10,1,8,1,10,1, + 122,33,95,90,105,112,73,109,112,111,114,116,82,101,115,111, + 117,114,99,101,82,101,97,100,101,114,46,99,111,110,116,101, + 110,116,115,78,41,10,114,6,0,0,0,114,7,0,0,0, + 114,8,0,0,0,114,84,0,0,0,114,81,0,0,0,114, + 34,0,0,0,114,182,0,0,0,114,183,0,0,0,114,184, + 0,0,0,114,189,0,0,0,114,9,0,0,0,114,9,0, + 0,0,114,9,0,0,0,114,10,0,0,0,114,80,0,0, + 0,212,2,0,0,115,14,0,0,0,8,5,4,1,4,2, + 8,4,8,9,8,6,8,11,114,80,0,0,0,41,45,114, + 84,0,0,0,90,26,95,102,114,111,122,101,110,95,105,109, + 112,111,114,116,108,105,98,95,101,120,116,101,114,110,97,108, + 114,21,0,0,0,114,1,0,0,0,114,2,0,0,0,90, + 17,95,102,114,111,122,101,110,95,105,109,112,111,114,116,108, + 105,98,114,76,0,0,0,114,149,0,0,0,114,111,0,0, + 0,114,153,0,0,0,114,67,0,0,0,114,132,0,0,0, + 90,7,95,95,97,108,108,95,95,114,20,0,0,0,90,15, + 112,97,116,104,95,115,101,112,97,114,97,116,111,114,115,114, + 18,0,0,0,114,75,0,0,0,114,3,0,0,0,114,25, + 0,0,0,218,4,116,121,112,101,114,70,0,0,0,114,114, + 0,0,0,114,116,0,0,0,114,118,0,0,0,114,4,0, + 0,0,114,89,0,0,0,114,36,0,0,0,114,37,0,0, + 0,114,35,0,0,0,114,27,0,0,0,114,123,0,0,0, + 114,143,0,0,0,114,145,0,0,0,114,52,0,0,0,114, + 148,0,0,0,114,156,0,0,0,218,8,95,95,99,111,100, + 101,95,95,114,154,0,0,0,114,160,0,0,0,114,162,0, + 0,0,114,170,0,0,0,114,152,0,0,0,114,150,0,0, + 0,114,44,0,0,0,114,80,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,13,0,0,0,115,88,0, + 0,0,4,4,8,1,16,1,8,1,8,1,8,1,8,1, + 8,1,8,2,8,3,6,1,14,3,16,4,4,2,8,2, + 4,1,4,1,4,2,14,127,0,127,0,1,12,1,12,1, + 2,1,2,252,4,9,8,4,8,9,8,31,8,126,2,254, + 2,29,4,5,8,21,8,46,8,10,8,46,10,5,8,7, + 8,6,8,13,8,19,8,15,8,26, }; From solipsis at pitrou.net Tue Nov 27 04:09:30 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Tue, 27 Nov 2018 09:09:30 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=3 Message-ID: <20181127090930.1.3475B34A3167081C@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [7, -7, 1] memory blocks, sum=1 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_fork leaked [0, 0, -2] memory blocks, sum=-2 test_multiprocessing_forkserver leaked [2, 0, -2] memory blocks, sum=0 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogcGo_H8', '--timeout', '7200'] From webhook-mailer at python.org Tue Nov 27 04:27:41 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Tue, 27 Nov 2018 09:27:41 -0000 Subject: [Python-checkins] bpo-33012: Fix invalid function cast warnings with gcc 8 in Argument Clinic. (GH-6748) Message-ID: https://github.com/python/cpython/commit/4a934d490fac779d8954a8292369c4506bab23fa commit: 4a934d490fac779d8954a8292369c4506bab23fa branch: master author: Serhiy Storchaka committer: GitHub date: 2018-11-27T11:27:36+02:00 summary: bpo-33012: Fix invalid function cast warnings with gcc 8 in Argument Clinic. (GH-6748) Fix invalid function cast warnings with gcc 8 for method conventions different from METH_NOARGS, METH_O and METH_VARARGS in Argument Clinic generated code. files: A Modules/clinic/zipimport.c.h M Modules/_io/clinic/_iomodule.c.h M Modules/_io/clinic/bufferedio.c.h M Modules/_io/clinic/bytesio.c.h M Modules/_io/clinic/fileio.c.h M Modules/_io/clinic/iobase.c.h M Modules/_io/clinic/stringio.c.h M Modules/_io/clinic/textio.c.h M Modules/_io/clinic/winconsoleio.c.h M Modules/cjkcodecs/clinic/multibytecodec.c.h M Modules/clinic/_abc.c.h M Modules/clinic/_asynciomodule.c.h M Modules/clinic/_bz2module.c.h M Modules/clinic/_codecsmodule.c.h M Modules/clinic/_cryptmodule.c.h M Modules/clinic/_curses_panel.c.h M Modules/clinic/_cursesmodule.c.h M Modules/clinic/_datetimemodule.c.h M Modules/clinic/_dbmmodule.c.h M Modules/clinic/_elementtree.c.h M Modules/clinic/_gdbmmodule.c.h M Modules/clinic/_hashopenssl.c.h M Modules/clinic/_heapqmodule.c.h M Modules/clinic/_lzmamodule.c.h M Modules/clinic/_opcode.c.h M Modules/clinic/_operator.c.h M Modules/clinic/_pickle.c.h M Modules/clinic/_queuemodule.c.h M Modules/clinic/_sre.c.h M Modules/clinic/_ssl.c.h M Modules/clinic/_struct.c.h M Modules/clinic/_tkinter.c.h M Modules/clinic/_tracemalloc.c.h M Modules/clinic/_weakref.c.h M Modules/clinic/_winapi.c.h M Modules/clinic/arraymodule.c.h M Modules/clinic/audioop.c.h M Modules/clinic/binascii.c.h M Modules/clinic/cmathmodule.c.h M Modules/clinic/fcntlmodule.c.h M Modules/clinic/gcmodule.c.h M Modules/clinic/grpmodule.c.h M Modules/clinic/itertoolsmodule.c.h M Modules/clinic/mathmodule.c.h M Modules/clinic/md5module.c.h M Modules/clinic/posixmodule.c.h M Modules/clinic/pyexpat.c.h M Modules/clinic/resource.c.h M Modules/clinic/selectmodule.c.h M Modules/clinic/sha1module.c.h M Modules/clinic/sha256module.c.h M Modules/clinic/sha512module.c.h M Modules/clinic/signalmodule.c.h M Modules/clinic/symtablemodule.c.h M Modules/clinic/unicodedata.c.h M Modules/clinic/zlibmodule.c.h M Objects/clinic/bytearrayobject.c.h M Objects/clinic/bytesobject.c.h M Objects/clinic/dictobject.c.h M Objects/clinic/floatobject.c.h M Objects/clinic/listobject.c.h M Objects/clinic/longobject.c.h M Objects/clinic/odictobject.c.h M Objects/clinic/tupleobject.c.h M Objects/clinic/unicodeobject.c.h M Objects/stringlib/clinic/transmogrify.h.h M PC/clinic/_testconsole.c.h M PC/clinic/msvcrtmodule.c.h M PC/clinic/winreg.c.h M PC/clinic/winsound.c.h M Python/clinic/_warnings.c.h M Python/clinic/bltinmodule.c.h M Python/clinic/context.c.h M Python/clinic/import.c.h M Python/clinic/marshal.c.h M Python/clinic/sysmodule.c.h M Tools/clinic/clinic.py diff --git a/Modules/_io/clinic/_iomodule.c.h b/Modules/_io/clinic/_iomodule.c.h index b8ae2ce34eb9..f03e84e4318a 100644 --- a/Modules/_io/clinic/_iomodule.c.h +++ b/Modules/_io/clinic/_iomodule.c.h @@ -127,7 +127,7 @@ PyDoc_STRVAR(_io_open__doc__, "opened in a binary mode."); #define _IO_OPEN_METHODDEF \ - {"open", (PyCFunction)_io_open, METH_FASTCALL|METH_KEYWORDS, _io_open__doc__}, + {"open", (PyCFunction)(void(*)(void))_io_open, METH_FASTCALL|METH_KEYWORDS, _io_open__doc__}, static PyObject * _io_open_impl(PyObject *module, PyObject *file, const char *mode, @@ -158,4 +158,4 @@ _io_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw exit: return return_value; } -/*[clinic end generated code: output=a9de1ae79c960e81 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a2c1af38d943ccec input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/bufferedio.c.h b/Modules/_io/clinic/bufferedio.c.h index 7b93929675f5..e78ca20ad5c4 100644 --- a/Modules/_io/clinic/bufferedio.c.h +++ b/Modules/_io/clinic/bufferedio.c.h @@ -91,7 +91,7 @@ PyDoc_STRVAR(_io__Buffered_peek__doc__, "\n"); #define _IO__BUFFERED_PEEK_METHODDEF \ - {"peek", (PyCFunction)_io__Buffered_peek, METH_FASTCALL, _io__Buffered_peek__doc__}, + {"peek", (PyCFunction)(void(*)(void))_io__Buffered_peek, METH_FASTCALL, _io__Buffered_peek__doc__}, static PyObject * _io__Buffered_peek_impl(buffered *self, Py_ssize_t size); @@ -118,7 +118,7 @@ PyDoc_STRVAR(_io__Buffered_read__doc__, "\n"); #define _IO__BUFFERED_READ_METHODDEF \ - {"read", (PyCFunction)_io__Buffered_read, METH_FASTCALL, _io__Buffered_read__doc__}, + {"read", (PyCFunction)(void(*)(void))_io__Buffered_read, METH_FASTCALL, _io__Buffered_read__doc__}, static PyObject * _io__Buffered_read_impl(buffered *self, Py_ssize_t n); @@ -145,7 +145,7 @@ PyDoc_STRVAR(_io__Buffered_read1__doc__, "\n"); #define _IO__BUFFERED_READ1_METHODDEF \ - {"read1", (PyCFunction)_io__Buffered_read1, METH_FASTCALL, _io__Buffered_read1__doc__}, + {"read1", (PyCFunction)(void(*)(void))_io__Buffered_read1, METH_FASTCALL, _io__Buffered_read1__doc__}, static PyObject * _io__Buffered_read1_impl(buffered *self, Py_ssize_t n); @@ -234,7 +234,7 @@ PyDoc_STRVAR(_io__Buffered_readline__doc__, "\n"); #define _IO__BUFFERED_READLINE_METHODDEF \ - {"readline", (PyCFunction)_io__Buffered_readline, METH_FASTCALL, _io__Buffered_readline__doc__}, + {"readline", (PyCFunction)(void(*)(void))_io__Buffered_readline, METH_FASTCALL, _io__Buffered_readline__doc__}, static PyObject * _io__Buffered_readline_impl(buffered *self, Py_ssize_t size); @@ -261,7 +261,7 @@ PyDoc_STRVAR(_io__Buffered_seek__doc__, "\n"); #define _IO__BUFFERED_SEEK_METHODDEF \ - {"seek", (PyCFunction)_io__Buffered_seek, METH_FASTCALL, _io__Buffered_seek__doc__}, + {"seek", (PyCFunction)(void(*)(void))_io__Buffered_seek, METH_FASTCALL, _io__Buffered_seek__doc__}, static PyObject * _io__Buffered_seek_impl(buffered *self, PyObject *targetobj, int whence); @@ -289,7 +289,7 @@ PyDoc_STRVAR(_io__Buffered_truncate__doc__, "\n"); #define _IO__BUFFERED_TRUNCATE_METHODDEF \ - {"truncate", (PyCFunction)_io__Buffered_truncate, METH_FASTCALL, _io__Buffered_truncate__doc__}, + {"truncate", (PyCFunction)(void(*)(void))_io__Buffered_truncate, METH_FASTCALL, _io__Buffered_truncate__doc__}, static PyObject * _io__Buffered_truncate_impl(buffered *self, PyObject *pos); @@ -476,4 +476,4 @@ _io_BufferedRandom___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=9a20dd4eaabb5d58 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=cb4bf8d50533953b input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/bytesio.c.h b/Modules/_io/clinic/bytesio.c.h index 5c155cb3066e..536f75383799 100644 --- a/Modules/_io/clinic/bytesio.c.h +++ b/Modules/_io/clinic/bytesio.c.h @@ -158,7 +158,7 @@ PyDoc_STRVAR(_io_BytesIO_read__doc__, "Return an empty bytes object at EOF."); #define _IO_BYTESIO_READ_METHODDEF \ - {"read", (PyCFunction)_io_BytesIO_read, METH_FASTCALL, _io_BytesIO_read__doc__}, + {"read", (PyCFunction)(void(*)(void))_io_BytesIO_read, METH_FASTCALL, _io_BytesIO_read__doc__}, static PyObject * _io_BytesIO_read_impl(bytesio *self, Py_ssize_t size); @@ -189,7 +189,7 @@ PyDoc_STRVAR(_io_BytesIO_read1__doc__, "Return an empty bytes object at EOF."); #define _IO_BYTESIO_READ1_METHODDEF \ - {"read1", (PyCFunction)_io_BytesIO_read1, METH_FASTCALL, _io_BytesIO_read1__doc__}, + {"read1", (PyCFunction)(void(*)(void))_io_BytesIO_read1, METH_FASTCALL, _io_BytesIO_read1__doc__}, static PyObject * _io_BytesIO_read1_impl(bytesio *self, Py_ssize_t size); @@ -221,7 +221,7 @@ PyDoc_STRVAR(_io_BytesIO_readline__doc__, "Return an empty bytes object at EOF."); #define _IO_BYTESIO_READLINE_METHODDEF \ - {"readline", (PyCFunction)_io_BytesIO_readline, METH_FASTCALL, _io_BytesIO_readline__doc__}, + {"readline", (PyCFunction)(void(*)(void))_io_BytesIO_readline, METH_FASTCALL, _io_BytesIO_readline__doc__}, static PyObject * _io_BytesIO_readline_impl(bytesio *self, Py_ssize_t size); @@ -253,7 +253,7 @@ PyDoc_STRVAR(_io_BytesIO_readlines__doc__, "total number of bytes in the lines returned."); #define _IO_BYTESIO_READLINES_METHODDEF \ - {"readlines", (PyCFunction)_io_BytesIO_readlines, METH_FASTCALL, _io_BytesIO_readlines__doc__}, + {"readlines", (PyCFunction)(void(*)(void))_io_BytesIO_readlines, METH_FASTCALL, _io_BytesIO_readlines__doc__}, static PyObject * _io_BytesIO_readlines_impl(bytesio *self, PyObject *arg); @@ -320,7 +320,7 @@ PyDoc_STRVAR(_io_BytesIO_truncate__doc__, "The current file position is unchanged. Returns the new size."); #define _IO_BYTESIO_TRUNCATE_METHODDEF \ - {"truncate", (PyCFunction)_io_BytesIO_truncate, METH_FASTCALL, _io_BytesIO_truncate__doc__}, + {"truncate", (PyCFunction)(void(*)(void))_io_BytesIO_truncate, METH_FASTCALL, _io_BytesIO_truncate__doc__}, static PyObject * _io_BytesIO_truncate_impl(bytesio *self, Py_ssize_t size); @@ -354,7 +354,7 @@ PyDoc_STRVAR(_io_BytesIO_seek__doc__, "Returns the new absolute position."); #define _IO_BYTESIO_SEEK_METHODDEF \ - {"seek", (PyCFunction)_io_BytesIO_seek, METH_FASTCALL, _io_BytesIO_seek__doc__}, + {"seek", (PyCFunction)(void(*)(void))_io_BytesIO_seek, METH_FASTCALL, _io_BytesIO_seek__doc__}, static PyObject * _io_BytesIO_seek_impl(bytesio *self, Py_ssize_t pos, int whence); @@ -444,4 +444,4 @@ _io_BytesIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=9ba9a68c8c5669e7 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=89538a941ae1267a input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/fileio.c.h b/Modules/_io/clinic/fileio.c.h index 8a9958aaecf0..a66fc991a6fd 100644 --- a/Modules/_io/clinic/fileio.c.h +++ b/Modules/_io/clinic/fileio.c.h @@ -202,7 +202,7 @@ PyDoc_STRVAR(_io_FileIO_read__doc__, "Return an empty bytes object at EOF."); #define _IO_FILEIO_READ_METHODDEF \ - {"read", (PyCFunction)_io_FileIO_read, METH_FASTCALL, _io_FileIO_read__doc__}, + {"read", (PyCFunction)(void(*)(void))_io_FileIO_read, METH_FASTCALL, _io_FileIO_read__doc__}, static PyObject * _io_FileIO_read_impl(fileio *self, Py_ssize_t size); @@ -274,7 +274,7 @@ PyDoc_STRVAR(_io_FileIO_seek__doc__, "Note that not all file objects are seekable."); #define _IO_FILEIO_SEEK_METHODDEF \ - {"seek", (PyCFunction)_io_FileIO_seek, METH_FASTCALL, _io_FileIO_seek__doc__}, + {"seek", (PyCFunction)(void(*)(void))_io_FileIO_seek, METH_FASTCALL, _io_FileIO_seek__doc__}, static PyObject * _io_FileIO_seek_impl(fileio *self, PyObject *pos, int whence); @@ -328,7 +328,7 @@ PyDoc_STRVAR(_io_FileIO_truncate__doc__, "The current file position is changed to the value of size."); #define _IO_FILEIO_TRUNCATE_METHODDEF \ - {"truncate", (PyCFunction)_io_FileIO_truncate, METH_FASTCALL, _io_FileIO_truncate__doc__}, + {"truncate", (PyCFunction)(void(*)(void))_io_FileIO_truncate, METH_FASTCALL, _io_FileIO_truncate__doc__}, static PyObject * _io_FileIO_truncate_impl(fileio *self, PyObject *posobj); @@ -373,4 +373,4 @@ _io_FileIO_isatty(fileio *self, PyObject *Py_UNUSED(ignored)) #ifndef _IO_FILEIO_TRUNCATE_METHODDEF #define _IO_FILEIO_TRUNCATE_METHODDEF #endif /* !defined(_IO_FILEIO_TRUNCATE_METHODDEF) */ -/*[clinic end generated code: output=a8796438c8b7c49a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=9d44e7035bce105d input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/iobase.c.h b/Modules/_io/clinic/iobase.c.h index e6f72cd5ff9e..68eaaddce22d 100644 --- a/Modules/_io/clinic/iobase.c.h +++ b/Modules/_io/clinic/iobase.c.h @@ -174,7 +174,7 @@ PyDoc_STRVAR(_io__IOBase_readline__doc__, "terminator(s) recognized."); #define _IO__IOBASE_READLINE_METHODDEF \ - {"readline", (PyCFunction)_io__IOBase_readline, METH_FASTCALL, _io__IOBase_readline__doc__}, + {"readline", (PyCFunction)(void(*)(void))_io__IOBase_readline, METH_FASTCALL, _io__IOBase_readline__doc__}, static PyObject * _io__IOBase_readline_impl(PyObject *self, Py_ssize_t limit); @@ -206,7 +206,7 @@ PyDoc_STRVAR(_io__IOBase_readlines__doc__, "lines so far exceeds hint."); #define _IO__IOBASE_READLINES_METHODDEF \ - {"readlines", (PyCFunction)_io__IOBase_readlines, METH_FASTCALL, _io__IOBase_readlines__doc__}, + {"readlines", (PyCFunction)(void(*)(void))_io__IOBase_readlines, METH_FASTCALL, _io__IOBase_readlines__doc__}, static PyObject * _io__IOBase_readlines_impl(PyObject *self, Py_ssize_t hint); @@ -241,7 +241,7 @@ PyDoc_STRVAR(_io__RawIOBase_read__doc__, "\n"); #define _IO__RAWIOBASE_READ_METHODDEF \ - {"read", (PyCFunction)_io__RawIOBase_read, METH_FASTCALL, _io__RawIOBase_read__doc__}, + {"read", (PyCFunction)(void(*)(void))_io__RawIOBase_read, METH_FASTCALL, _io__RawIOBase_read__doc__}, static PyObject * _io__RawIOBase_read_impl(PyObject *self, Py_ssize_t n); @@ -279,4 +279,4 @@ _io__RawIOBase_readall(PyObject *self, PyObject *Py_UNUSED(ignored)) { return _io__RawIOBase_readall_impl(self); } -/*[clinic end generated code: output=64989ec3dbf44a7c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=cde4b0e96a4e69e3 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/stringio.c.h b/Modules/_io/clinic/stringio.c.h index 72b2540d47aa..3181688f109f 100644 --- a/Modules/_io/clinic/stringio.c.h +++ b/Modules/_io/clinic/stringio.c.h @@ -48,7 +48,7 @@ PyDoc_STRVAR(_io_StringIO_read__doc__, "is reached. Return an empty string at EOF."); #define _IO_STRINGIO_READ_METHODDEF \ - {"read", (PyCFunction)_io_StringIO_read, METH_FASTCALL, _io_StringIO_read__doc__}, + {"read", (PyCFunction)(void(*)(void))_io_StringIO_read, METH_FASTCALL, _io_StringIO_read__doc__}, static PyObject * _io_StringIO_read_impl(stringio *self, Py_ssize_t size); @@ -78,7 +78,7 @@ PyDoc_STRVAR(_io_StringIO_readline__doc__, "Returns an empty string if EOF is hit immediately."); #define _IO_STRINGIO_READLINE_METHODDEF \ - {"readline", (PyCFunction)_io_StringIO_readline, METH_FASTCALL, _io_StringIO_readline__doc__}, + {"readline", (PyCFunction)(void(*)(void))_io_StringIO_readline, METH_FASTCALL, _io_StringIO_readline__doc__}, static PyObject * _io_StringIO_readline_impl(stringio *self, Py_ssize_t size); @@ -110,7 +110,7 @@ PyDoc_STRVAR(_io_StringIO_truncate__doc__, "Returns the new absolute position."); #define _IO_STRINGIO_TRUNCATE_METHODDEF \ - {"truncate", (PyCFunction)_io_StringIO_truncate, METH_FASTCALL, _io_StringIO_truncate__doc__}, + {"truncate", (PyCFunction)(void(*)(void))_io_StringIO_truncate, METH_FASTCALL, _io_StringIO_truncate__doc__}, static PyObject * _io_StringIO_truncate_impl(stringio *self, Py_ssize_t size); @@ -144,7 +144,7 @@ PyDoc_STRVAR(_io_StringIO_seek__doc__, "Returns the new absolute position."); #define _IO_STRINGIO_SEEK_METHODDEF \ - {"seek", (PyCFunction)_io_StringIO_seek, METH_FASTCALL, _io_StringIO_seek__doc__}, + {"seek", (PyCFunction)(void(*)(void))_io_StringIO_seek, METH_FASTCALL, _io_StringIO_seek__doc__}, static PyObject * _io_StringIO_seek_impl(stringio *self, Py_ssize_t pos, int whence); @@ -286,4 +286,4 @@ _io_StringIO_seekable(stringio *self, PyObject *Py_UNUSED(ignored)) { return _io_StringIO_seekable_impl(self); } -/*[clinic end generated code: output=73c4d6e5cc3b1a58 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=00c3c7a1c6ea6773 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/textio.c.h b/Modules/_io/clinic/textio.c.h index 60f5dab75c72..3ad3d67b112f 100644 --- a/Modules/_io/clinic/textio.c.h +++ b/Modules/_io/clinic/textio.c.h @@ -46,7 +46,7 @@ PyDoc_STRVAR(_io_IncrementalNewlineDecoder_decode__doc__, "\n"); #define _IO_INCREMENTALNEWLINEDECODER_DECODE_METHODDEF \ - {"decode", (PyCFunction)_io_IncrementalNewlineDecoder_decode, METH_FASTCALL|METH_KEYWORDS, _io_IncrementalNewlineDecoder_decode__doc__}, + {"decode", (PyCFunction)(void(*)(void))_io_IncrementalNewlineDecoder_decode, METH_FASTCALL|METH_KEYWORDS, _io_IncrementalNewlineDecoder_decode__doc__}, static PyObject * _io_IncrementalNewlineDecoder_decode_impl(nldecoder_object *self, @@ -186,7 +186,7 @@ PyDoc_STRVAR(_io_TextIOWrapper_reconfigure__doc__, "This also does an implicit stream flush."); #define _IO_TEXTIOWRAPPER_RECONFIGURE_METHODDEF \ - {"reconfigure", (PyCFunction)_io_TextIOWrapper_reconfigure, METH_FASTCALL|METH_KEYWORDS, _io_TextIOWrapper_reconfigure__doc__}, + {"reconfigure", (PyCFunction)(void(*)(void))_io_TextIOWrapper_reconfigure, METH_FASTCALL|METH_KEYWORDS, _io_TextIOWrapper_reconfigure__doc__}, static PyObject * _io_TextIOWrapper_reconfigure_impl(textio *self, PyObject *encoding, @@ -265,7 +265,7 @@ PyDoc_STRVAR(_io_TextIOWrapper_read__doc__, "\n"); #define _IO_TEXTIOWRAPPER_READ_METHODDEF \ - {"read", (PyCFunction)_io_TextIOWrapper_read, METH_FASTCALL, _io_TextIOWrapper_read__doc__}, + {"read", (PyCFunction)(void(*)(void))_io_TextIOWrapper_read, METH_FASTCALL, _io_TextIOWrapper_read__doc__}, static PyObject * _io_TextIOWrapper_read_impl(textio *self, Py_ssize_t n); @@ -292,7 +292,7 @@ PyDoc_STRVAR(_io_TextIOWrapper_readline__doc__, "\n"); #define _IO_TEXTIOWRAPPER_READLINE_METHODDEF \ - {"readline", (PyCFunction)_io_TextIOWrapper_readline, METH_FASTCALL, _io_TextIOWrapper_readline__doc__}, + {"readline", (PyCFunction)(void(*)(void))_io_TextIOWrapper_readline, METH_FASTCALL, _io_TextIOWrapper_readline__doc__}, static PyObject * _io_TextIOWrapper_readline_impl(textio *self, Py_ssize_t size); @@ -319,7 +319,7 @@ PyDoc_STRVAR(_io_TextIOWrapper_seek__doc__, "\n"); #define _IO_TEXTIOWRAPPER_SEEK_METHODDEF \ - {"seek", (PyCFunction)_io_TextIOWrapper_seek, METH_FASTCALL, _io_TextIOWrapper_seek__doc__}, + {"seek", (PyCFunction)(void(*)(void))_io_TextIOWrapper_seek, METH_FASTCALL, _io_TextIOWrapper_seek__doc__}, static PyObject * _io_TextIOWrapper_seek_impl(textio *self, PyObject *cookieObj, int whence); @@ -364,7 +364,7 @@ PyDoc_STRVAR(_io_TextIOWrapper_truncate__doc__, "\n"); #define _IO_TEXTIOWRAPPER_TRUNCATE_METHODDEF \ - {"truncate", (PyCFunction)_io_TextIOWrapper_truncate, METH_FASTCALL, _io_TextIOWrapper_truncate__doc__}, + {"truncate", (PyCFunction)(void(*)(void))_io_TextIOWrapper_truncate, METH_FASTCALL, _io_TextIOWrapper_truncate__doc__}, static PyObject * _io_TextIOWrapper_truncate_impl(textio *self, PyObject *pos); @@ -504,4 +504,4 @@ _io_TextIOWrapper_close(textio *self, PyObject *Py_UNUSED(ignored)) { return _io_TextIOWrapper_close_impl(self); } -/*[clinic end generated code: output=b5be870b0039d577 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a811badd76bfe92e input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/winconsoleio.c.h b/Modules/_io/clinic/winconsoleio.c.h index 2291225ead3d..6e72da11dda4 100644 --- a/Modules/_io/clinic/winconsoleio.c.h +++ b/Modules/_io/clinic/winconsoleio.c.h @@ -209,7 +209,7 @@ PyDoc_STRVAR(_io__WindowsConsoleIO_read__doc__, "Return an empty bytes object at EOF."); #define _IO__WINDOWSCONSOLEIO_READ_METHODDEF \ - {"read", (PyCFunction)_io__WindowsConsoleIO_read, METH_FASTCALL, _io__WindowsConsoleIO_read__doc__}, + {"read", (PyCFunction)(void(*)(void))_io__WindowsConsoleIO_read, METH_FASTCALL, _io__WindowsConsoleIO_read__doc__}, static PyObject * _io__WindowsConsoleIO_read_impl(winconsoleio *self, Py_ssize_t size); @@ -328,4 +328,4 @@ _io__WindowsConsoleIO_isatty(winconsoleio *self, PyObject *Py_UNUSED(ignored)) #ifndef _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF #define _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF #endif /* !defined(_IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF) */ -/*[clinic end generated code: output=6d351a8200a8e848 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=080af41338394b49 input=a9049054013a1b77]*/ diff --git a/Modules/cjkcodecs/clinic/multibytecodec.c.h b/Modules/cjkcodecs/clinic/multibytecodec.c.h index a58bb646a411..74e45bd0b58d 100644 --- a/Modules/cjkcodecs/clinic/multibytecodec.c.h +++ b/Modules/cjkcodecs/clinic/multibytecodec.c.h @@ -14,7 +14,7 @@ PyDoc_STRVAR(_multibytecodec_MultibyteCodec_encode__doc__, "registered with codecs.register_error that can handle UnicodeEncodeErrors."); #define _MULTIBYTECODEC_MULTIBYTECODEC_ENCODE_METHODDEF \ - {"encode", (PyCFunction)_multibytecodec_MultibyteCodec_encode, METH_FASTCALL|METH_KEYWORDS, _multibytecodec_MultibyteCodec_encode__doc__}, + {"encode", (PyCFunction)(void(*)(void))_multibytecodec_MultibyteCodec_encode, METH_FASTCALL|METH_KEYWORDS, _multibytecodec_MultibyteCodec_encode__doc__}, static PyObject * _multibytecodec_MultibyteCodec_encode_impl(MultibyteCodecObject *self, @@ -52,7 +52,7 @@ PyDoc_STRVAR(_multibytecodec_MultibyteCodec_decode__doc__, "codecs.register_error that is able to handle UnicodeDecodeErrors.\""); #define _MULTIBYTECODEC_MULTIBYTECODEC_DECODE_METHODDEF \ - {"decode", (PyCFunction)_multibytecodec_MultibyteCodec_decode, METH_FASTCALL|METH_KEYWORDS, _multibytecodec_MultibyteCodec_decode__doc__}, + {"decode", (PyCFunction)(void(*)(void))_multibytecodec_MultibyteCodec_decode, METH_FASTCALL|METH_KEYWORDS, _multibytecodec_MultibyteCodec_decode__doc__}, static PyObject * _multibytecodec_MultibyteCodec_decode_impl(MultibyteCodecObject *self, @@ -89,7 +89,7 @@ PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalEncoder_encode__doc__, "\n"); #define _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_ENCODE_METHODDEF \ - {"encode", (PyCFunction)_multibytecodec_MultibyteIncrementalEncoder_encode, METH_FASTCALL|METH_KEYWORDS, _multibytecodec_MultibyteIncrementalEncoder_encode__doc__}, + {"encode", (PyCFunction)(void(*)(void))_multibytecodec_MultibyteIncrementalEncoder_encode, METH_FASTCALL|METH_KEYWORDS, _multibytecodec_MultibyteIncrementalEncoder_encode__doc__}, static PyObject * _multibytecodec_MultibyteIncrementalEncoder_encode_impl(MultibyteIncrementalEncoderObject *self, @@ -182,7 +182,7 @@ PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_decode__doc__, "\n"); #define _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_DECODE_METHODDEF \ - {"decode", (PyCFunction)_multibytecodec_MultibyteIncrementalDecoder_decode, METH_FASTCALL|METH_KEYWORDS, _multibytecodec_MultibyteIncrementalDecoder_decode__doc__}, + {"decode", (PyCFunction)(void(*)(void))_multibytecodec_MultibyteIncrementalDecoder_decode, METH_FASTCALL|METH_KEYWORDS, _multibytecodec_MultibyteIncrementalDecoder_decode__doc__}, static PyObject * _multibytecodec_MultibyteIncrementalDecoder_decode_impl(MultibyteIncrementalDecoderObject *self, @@ -280,7 +280,7 @@ PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_read__doc__, "\n"); #define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_READ_METHODDEF \ - {"read", (PyCFunction)_multibytecodec_MultibyteStreamReader_read, METH_FASTCALL, _multibytecodec_MultibyteStreamReader_read__doc__}, + {"read", (PyCFunction)(void(*)(void))_multibytecodec_MultibyteStreamReader_read, METH_FASTCALL, _multibytecodec_MultibyteStreamReader_read__doc__}, static PyObject * _multibytecodec_MultibyteStreamReader_read_impl(MultibyteStreamReaderObject *self, @@ -309,7 +309,7 @@ PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_readline__doc__, "\n"); #define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_READLINE_METHODDEF \ - {"readline", (PyCFunction)_multibytecodec_MultibyteStreamReader_readline, METH_FASTCALL, _multibytecodec_MultibyteStreamReader_readline__doc__}, + {"readline", (PyCFunction)(void(*)(void))_multibytecodec_MultibyteStreamReader_readline, METH_FASTCALL, _multibytecodec_MultibyteStreamReader_readline__doc__}, static PyObject * _multibytecodec_MultibyteStreamReader_readline_impl(MultibyteStreamReaderObject *self, @@ -338,7 +338,7 @@ PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_readlines__doc__, "\n"); #define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_READLINES_METHODDEF \ - {"readlines", (PyCFunction)_multibytecodec_MultibyteStreamReader_readlines, METH_FASTCALL, _multibytecodec_MultibyteStreamReader_readlines__doc__}, + {"readlines", (PyCFunction)(void(*)(void))_multibytecodec_MultibyteStreamReader_readlines, METH_FASTCALL, _multibytecodec_MultibyteStreamReader_readlines__doc__}, static PyObject * _multibytecodec_MultibyteStreamReader_readlines_impl(MultibyteStreamReaderObject *self, @@ -418,4 +418,4 @@ PyDoc_STRVAR(_multibytecodec___create_codec__doc__, #define _MULTIBYTECODEC___CREATE_CODEC_METHODDEF \ {"__create_codec", (PyCFunction)_multibytecodec___create_codec, METH_O, _multibytecodec___create_codec__doc__}, -/*[clinic end generated code: output=2fa0a38494716b97 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=4c1dc8015ee5abb4 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_abc.c.h b/Modules/clinic/_abc.c.h index b1ec371d1551..22ddb6c100fb 100644 --- a/Modules/clinic/_abc.c.h +++ b/Modules/clinic/_abc.c.h @@ -53,7 +53,7 @@ PyDoc_STRVAR(_abc__abc_register__doc__, "Internal ABC helper for subclasss registration. Should be never used outside abc module."); #define _ABC__ABC_REGISTER_METHODDEF \ - {"_abc_register", (PyCFunction)_abc__abc_register, METH_FASTCALL, _abc__abc_register__doc__}, + {"_abc_register", (PyCFunction)(void(*)(void))_abc__abc_register, METH_FASTCALL, _abc__abc_register__doc__}, static PyObject * _abc__abc_register_impl(PyObject *module, PyObject *self, PyObject *subclass); @@ -83,7 +83,7 @@ PyDoc_STRVAR(_abc__abc_instancecheck__doc__, "Internal ABC helper for instance checks. Should be never used outside abc module."); #define _ABC__ABC_INSTANCECHECK_METHODDEF \ - {"_abc_instancecheck", (PyCFunction)_abc__abc_instancecheck, METH_FASTCALL, _abc__abc_instancecheck__doc__}, + {"_abc_instancecheck", (PyCFunction)(void(*)(void))_abc__abc_instancecheck, METH_FASTCALL, _abc__abc_instancecheck__doc__}, static PyObject * _abc__abc_instancecheck_impl(PyObject *module, PyObject *self, @@ -114,7 +114,7 @@ PyDoc_STRVAR(_abc__abc_subclasscheck__doc__, "Internal ABC helper for subclasss checks. Should be never used outside abc module."); #define _ABC__ABC_SUBCLASSCHECK_METHODDEF \ - {"_abc_subclasscheck", (PyCFunction)_abc__abc_subclasscheck, METH_FASTCALL, _abc__abc_subclasscheck__doc__}, + {"_abc_subclasscheck", (PyCFunction)(void(*)(void))_abc__abc_subclasscheck, METH_FASTCALL, _abc__abc_subclasscheck__doc__}, static PyObject * _abc__abc_subclasscheck_impl(PyObject *module, PyObject *self, @@ -159,4 +159,4 @@ _abc_get_cache_token(PyObject *module, PyObject *Py_UNUSED(ignored)) { return _abc_get_cache_token_impl(module); } -/*[clinic end generated code: output=9d6f861a8f45bc6f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=606db3cb658d9240 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_asynciomodule.c.h b/Modules/clinic/_asynciomodule.c.h index 4f5326fd9e7c..860b57f9ee38 100644 --- a/Modules/clinic/_asynciomodule.c.h +++ b/Modules/clinic/_asynciomodule.c.h @@ -120,7 +120,7 @@ PyDoc_STRVAR(_asyncio_Future_add_done_callback__doc__, "scheduled with call_soon."); #define _ASYNCIO_FUTURE_ADD_DONE_CALLBACK_METHODDEF \ - {"add_done_callback", (PyCFunction)_asyncio_Future_add_done_callback, METH_FASTCALL|METH_KEYWORDS, _asyncio_Future_add_done_callback__doc__}, + {"add_done_callback", (PyCFunction)(void(*)(void))_asyncio_Future_add_done_callback, METH_FASTCALL|METH_KEYWORDS, _asyncio_Future_add_done_callback__doc__}, static PyObject * _asyncio_Future_add_done_callback_impl(FutureObj *self, PyObject *fn, @@ -293,7 +293,7 @@ PyDoc_STRVAR(_asyncio_Task_current_task__doc__, "None is returned when called not in the context of a Task."); #define _ASYNCIO_TASK_CURRENT_TASK_METHODDEF \ - {"current_task", (PyCFunction)_asyncio_Task_current_task, METH_FASTCALL|METH_KEYWORDS|METH_CLASS, _asyncio_Task_current_task__doc__}, + {"current_task", (PyCFunction)(void(*)(void))_asyncio_Task_current_task, METH_FASTCALL|METH_KEYWORDS|METH_CLASS, _asyncio_Task_current_task__doc__}, static PyObject * _asyncio_Task_current_task_impl(PyTypeObject *type, PyObject *loop); @@ -325,7 +325,7 @@ PyDoc_STRVAR(_asyncio_Task_all_tasks__doc__, "By default all tasks for the current event loop are returned."); #define _ASYNCIO_TASK_ALL_TASKS_METHODDEF \ - {"all_tasks", (PyCFunction)_asyncio_Task_all_tasks, METH_FASTCALL|METH_KEYWORDS|METH_CLASS, _asyncio_Task_all_tasks__doc__}, + {"all_tasks", (PyCFunction)(void(*)(void))_asyncio_Task_all_tasks, METH_FASTCALL|METH_KEYWORDS|METH_CLASS, _asyncio_Task_all_tasks__doc__}, static PyObject * _asyncio_Task_all_tasks_impl(PyTypeObject *type, PyObject *loop); @@ -425,7 +425,7 @@ PyDoc_STRVAR(_asyncio_Task_get_stack__doc__, "returned for a suspended coroutine."); #define _ASYNCIO_TASK_GET_STACK_METHODDEF \ - {"get_stack", (PyCFunction)_asyncio_Task_get_stack, METH_FASTCALL|METH_KEYWORDS, _asyncio_Task_get_stack__doc__}, + {"get_stack", (PyCFunction)(void(*)(void))_asyncio_Task_get_stack, METH_FASTCALL|METH_KEYWORDS, _asyncio_Task_get_stack__doc__}, static PyObject * _asyncio_Task_get_stack_impl(TaskObj *self, PyObject *limit); @@ -461,7 +461,7 @@ PyDoc_STRVAR(_asyncio_Task_print_stack__doc__, "to sys.stderr."); #define _ASYNCIO_TASK_PRINT_STACK_METHODDEF \ - {"print_stack", (PyCFunction)_asyncio_Task_print_stack, METH_FASTCALL|METH_KEYWORDS, _asyncio_Task_print_stack__doc__}, + {"print_stack", (PyCFunction)(void(*)(void))_asyncio_Task_print_stack, METH_FASTCALL|METH_KEYWORDS, _asyncio_Task_print_stack__doc__}, static PyObject * _asyncio_Task_print_stack_impl(TaskObj *self, PyObject *limit, @@ -614,7 +614,7 @@ PyDoc_STRVAR(_asyncio__register_task__doc__, "Returns None."); #define _ASYNCIO__REGISTER_TASK_METHODDEF \ - {"_register_task", (PyCFunction)_asyncio__register_task, METH_FASTCALL|METH_KEYWORDS, _asyncio__register_task__doc__}, + {"_register_task", (PyCFunction)(void(*)(void))_asyncio__register_task, METH_FASTCALL|METH_KEYWORDS, _asyncio__register_task__doc__}, static PyObject * _asyncio__register_task_impl(PyObject *module, PyObject *task); @@ -646,7 +646,7 @@ PyDoc_STRVAR(_asyncio__unregister_task__doc__, "Returns None."); #define _ASYNCIO__UNREGISTER_TASK_METHODDEF \ - {"_unregister_task", (PyCFunction)_asyncio__unregister_task, METH_FASTCALL|METH_KEYWORDS, _asyncio__unregister_task__doc__}, + {"_unregister_task", (PyCFunction)(void(*)(void))_asyncio__unregister_task, METH_FASTCALL|METH_KEYWORDS, _asyncio__unregister_task__doc__}, static PyObject * _asyncio__unregister_task_impl(PyObject *module, PyObject *task); @@ -680,7 +680,7 @@ PyDoc_STRVAR(_asyncio__enter_task__doc__, "Returns None."); #define _ASYNCIO__ENTER_TASK_METHODDEF \ - {"_enter_task", (PyCFunction)_asyncio__enter_task, METH_FASTCALL|METH_KEYWORDS, _asyncio__enter_task__doc__}, + {"_enter_task", (PyCFunction)(void(*)(void))_asyncio__enter_task, METH_FASTCALL|METH_KEYWORDS, _asyncio__enter_task__doc__}, static PyObject * _asyncio__enter_task_impl(PyObject *module, PyObject *loop, PyObject *task); @@ -715,7 +715,7 @@ PyDoc_STRVAR(_asyncio__leave_task__doc__, "Returns None."); #define _ASYNCIO__LEAVE_TASK_METHODDEF \ - {"_leave_task", (PyCFunction)_asyncio__leave_task, METH_FASTCALL|METH_KEYWORDS, _asyncio__leave_task__doc__}, + {"_leave_task", (PyCFunction)(void(*)(void))_asyncio__leave_task, METH_FASTCALL|METH_KEYWORDS, _asyncio__leave_task__doc__}, static PyObject * _asyncio__leave_task_impl(PyObject *module, PyObject *loop, PyObject *task); @@ -738,4 +738,4 @@ _asyncio__leave_task(PyObject *module, PyObject *const *args, Py_ssize_t nargs, exit: return return_value; } -/*[clinic end generated code: output=67da879c9f841505 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=fd474bdc8f03d5ae input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_bz2module.c.h b/Modules/clinic/_bz2module.c.h index 601bcc690d95..f538719efc95 100644 --- a/Modules/clinic/_bz2module.c.h +++ b/Modules/clinic/_bz2module.c.h @@ -115,7 +115,7 @@ PyDoc_STRVAR(_bz2_BZ2Decompressor_decompress__doc__, "the unused_data attribute."); #define _BZ2_BZ2DECOMPRESSOR_DECOMPRESS_METHODDEF \ - {"decompress", (PyCFunction)_bz2_BZ2Decompressor_decompress, METH_FASTCALL|METH_KEYWORDS, _bz2_BZ2Decompressor_decompress__doc__}, + {"decompress", (PyCFunction)(void(*)(void))_bz2_BZ2Decompressor_decompress, METH_FASTCALL|METH_KEYWORDS, _bz2_BZ2Decompressor_decompress__doc__}, static PyObject * _bz2_BZ2Decompressor_decompress_impl(BZ2Decompressor *self, Py_buffer *data, @@ -174,4 +174,4 @@ _bz2_BZ2Decompressor___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=564a0313177fff63 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e47f4255d265b07d input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_codecsmodule.c.h b/Modules/clinic/_codecsmodule.c.h index 2f660fd3b4db..06f0572201ae 100644 --- a/Modules/clinic/_codecsmodule.c.h +++ b/Modules/clinic/_codecsmodule.c.h @@ -55,7 +55,7 @@ PyDoc_STRVAR(_codecs_encode__doc__, "codecs.register_error that can handle ValueErrors."); #define _CODECS_ENCODE_METHODDEF \ - {"encode", (PyCFunction)_codecs_encode, METH_FASTCALL|METH_KEYWORDS, _codecs_encode__doc__}, + {"encode", (PyCFunction)(void(*)(void))_codecs_encode, METH_FASTCALL|METH_KEYWORDS, _codecs_encode__doc__}, static PyObject * _codecs_encode_impl(PyObject *module, PyObject *obj, const char *encoding, @@ -94,7 +94,7 @@ PyDoc_STRVAR(_codecs_decode__doc__, "codecs.register_error that can handle ValueErrors."); #define _CODECS_DECODE_METHODDEF \ - {"decode", (PyCFunction)_codecs_decode, METH_FASTCALL|METH_KEYWORDS, _codecs_decode__doc__}, + {"decode", (PyCFunction)(void(*)(void))_codecs_decode, METH_FASTCALL|METH_KEYWORDS, _codecs_decode__doc__}, static PyObject * _codecs_decode_impl(PyObject *module, PyObject *obj, const char *encoding, @@ -153,7 +153,7 @@ PyDoc_STRVAR(_codecs_escape_decode__doc__, "\n"); #define _CODECS_ESCAPE_DECODE_METHODDEF \ - {"escape_decode", (PyCFunction)_codecs_escape_decode, METH_FASTCALL, _codecs_escape_decode__doc__}, + {"escape_decode", (PyCFunction)(void(*)(void))_codecs_escape_decode, METH_FASTCALL, _codecs_escape_decode__doc__}, static PyObject * _codecs_escape_decode_impl(PyObject *module, Py_buffer *data, @@ -187,7 +187,7 @@ PyDoc_STRVAR(_codecs_escape_encode__doc__, "\n"); #define _CODECS_ESCAPE_ENCODE_METHODDEF \ - {"escape_encode", (PyCFunction)_codecs_escape_encode, METH_FASTCALL, _codecs_escape_encode__doc__}, + {"escape_encode", (PyCFunction)(void(*)(void))_codecs_escape_encode, METH_FASTCALL, _codecs_escape_encode__doc__}, static PyObject * _codecs_escape_encode_impl(PyObject *module, PyObject *data, @@ -216,7 +216,7 @@ PyDoc_STRVAR(_codecs_unicode_internal_decode__doc__, "\n"); #define _CODECS_UNICODE_INTERNAL_DECODE_METHODDEF \ - {"unicode_internal_decode", (PyCFunction)_codecs_unicode_internal_decode, METH_FASTCALL, _codecs_unicode_internal_decode__doc__}, + {"unicode_internal_decode", (PyCFunction)(void(*)(void))_codecs_unicode_internal_decode, METH_FASTCALL, _codecs_unicode_internal_decode__doc__}, static PyObject * _codecs_unicode_internal_decode_impl(PyObject *module, PyObject *obj, @@ -245,7 +245,7 @@ PyDoc_STRVAR(_codecs_utf_7_decode__doc__, "\n"); #define _CODECS_UTF_7_DECODE_METHODDEF \ - {"utf_7_decode", (PyCFunction)_codecs_utf_7_decode, METH_FASTCALL, _codecs_utf_7_decode__doc__}, + {"utf_7_decode", (PyCFunction)(void(*)(void))_codecs_utf_7_decode, METH_FASTCALL, _codecs_utf_7_decode__doc__}, static PyObject * _codecs_utf_7_decode_impl(PyObject *module, Py_buffer *data, @@ -280,7 +280,7 @@ PyDoc_STRVAR(_codecs_utf_8_decode__doc__, "\n"); #define _CODECS_UTF_8_DECODE_METHODDEF \ - {"utf_8_decode", (PyCFunction)_codecs_utf_8_decode, METH_FASTCALL, _codecs_utf_8_decode__doc__}, + {"utf_8_decode", (PyCFunction)(void(*)(void))_codecs_utf_8_decode, METH_FASTCALL, _codecs_utf_8_decode__doc__}, static PyObject * _codecs_utf_8_decode_impl(PyObject *module, Py_buffer *data, @@ -315,7 +315,7 @@ PyDoc_STRVAR(_codecs_utf_16_decode__doc__, "\n"); #define _CODECS_UTF_16_DECODE_METHODDEF \ - {"utf_16_decode", (PyCFunction)_codecs_utf_16_decode, METH_FASTCALL, _codecs_utf_16_decode__doc__}, + {"utf_16_decode", (PyCFunction)(void(*)(void))_codecs_utf_16_decode, METH_FASTCALL, _codecs_utf_16_decode__doc__}, static PyObject * _codecs_utf_16_decode_impl(PyObject *module, Py_buffer *data, @@ -350,7 +350,7 @@ PyDoc_STRVAR(_codecs_utf_16_le_decode__doc__, "\n"); #define _CODECS_UTF_16_LE_DECODE_METHODDEF \ - {"utf_16_le_decode", (PyCFunction)_codecs_utf_16_le_decode, METH_FASTCALL, _codecs_utf_16_le_decode__doc__}, + {"utf_16_le_decode", (PyCFunction)(void(*)(void))_codecs_utf_16_le_decode, METH_FASTCALL, _codecs_utf_16_le_decode__doc__}, static PyObject * _codecs_utf_16_le_decode_impl(PyObject *module, Py_buffer *data, @@ -385,7 +385,7 @@ PyDoc_STRVAR(_codecs_utf_16_be_decode__doc__, "\n"); #define _CODECS_UTF_16_BE_DECODE_METHODDEF \ - {"utf_16_be_decode", (PyCFunction)_codecs_utf_16_be_decode, METH_FASTCALL, _codecs_utf_16_be_decode__doc__}, + {"utf_16_be_decode", (PyCFunction)(void(*)(void))_codecs_utf_16_be_decode, METH_FASTCALL, _codecs_utf_16_be_decode__doc__}, static PyObject * _codecs_utf_16_be_decode_impl(PyObject *module, Py_buffer *data, @@ -421,7 +421,7 @@ PyDoc_STRVAR(_codecs_utf_16_ex_decode__doc__, "\n"); #define _CODECS_UTF_16_EX_DECODE_METHODDEF \ - {"utf_16_ex_decode", (PyCFunction)_codecs_utf_16_ex_decode, METH_FASTCALL, _codecs_utf_16_ex_decode__doc__}, + {"utf_16_ex_decode", (PyCFunction)(void(*)(void))_codecs_utf_16_ex_decode, METH_FASTCALL, _codecs_utf_16_ex_decode__doc__}, static PyObject * _codecs_utf_16_ex_decode_impl(PyObject *module, Py_buffer *data, @@ -457,7 +457,7 @@ PyDoc_STRVAR(_codecs_utf_32_decode__doc__, "\n"); #define _CODECS_UTF_32_DECODE_METHODDEF \ - {"utf_32_decode", (PyCFunction)_codecs_utf_32_decode, METH_FASTCALL, _codecs_utf_32_decode__doc__}, + {"utf_32_decode", (PyCFunction)(void(*)(void))_codecs_utf_32_decode, METH_FASTCALL, _codecs_utf_32_decode__doc__}, static PyObject * _codecs_utf_32_decode_impl(PyObject *module, Py_buffer *data, @@ -492,7 +492,7 @@ PyDoc_STRVAR(_codecs_utf_32_le_decode__doc__, "\n"); #define _CODECS_UTF_32_LE_DECODE_METHODDEF \ - {"utf_32_le_decode", (PyCFunction)_codecs_utf_32_le_decode, METH_FASTCALL, _codecs_utf_32_le_decode__doc__}, + {"utf_32_le_decode", (PyCFunction)(void(*)(void))_codecs_utf_32_le_decode, METH_FASTCALL, _codecs_utf_32_le_decode__doc__}, static PyObject * _codecs_utf_32_le_decode_impl(PyObject *module, Py_buffer *data, @@ -527,7 +527,7 @@ PyDoc_STRVAR(_codecs_utf_32_be_decode__doc__, "\n"); #define _CODECS_UTF_32_BE_DECODE_METHODDEF \ - {"utf_32_be_decode", (PyCFunction)_codecs_utf_32_be_decode, METH_FASTCALL, _codecs_utf_32_be_decode__doc__}, + {"utf_32_be_decode", (PyCFunction)(void(*)(void))_codecs_utf_32_be_decode, METH_FASTCALL, _codecs_utf_32_be_decode__doc__}, static PyObject * _codecs_utf_32_be_decode_impl(PyObject *module, Py_buffer *data, @@ -563,7 +563,7 @@ PyDoc_STRVAR(_codecs_utf_32_ex_decode__doc__, "\n"); #define _CODECS_UTF_32_EX_DECODE_METHODDEF \ - {"utf_32_ex_decode", (PyCFunction)_codecs_utf_32_ex_decode, METH_FASTCALL, _codecs_utf_32_ex_decode__doc__}, + {"utf_32_ex_decode", (PyCFunction)(void(*)(void))_codecs_utf_32_ex_decode, METH_FASTCALL, _codecs_utf_32_ex_decode__doc__}, static PyObject * _codecs_utf_32_ex_decode_impl(PyObject *module, Py_buffer *data, @@ -599,7 +599,7 @@ PyDoc_STRVAR(_codecs_unicode_escape_decode__doc__, "\n"); #define _CODECS_UNICODE_ESCAPE_DECODE_METHODDEF \ - {"unicode_escape_decode", (PyCFunction)_codecs_unicode_escape_decode, METH_FASTCALL, _codecs_unicode_escape_decode__doc__}, + {"unicode_escape_decode", (PyCFunction)(void(*)(void))_codecs_unicode_escape_decode, METH_FASTCALL, _codecs_unicode_escape_decode__doc__}, static PyObject * _codecs_unicode_escape_decode_impl(PyObject *module, Py_buffer *data, @@ -633,7 +633,7 @@ PyDoc_STRVAR(_codecs_raw_unicode_escape_decode__doc__, "\n"); #define _CODECS_RAW_UNICODE_ESCAPE_DECODE_METHODDEF \ - {"raw_unicode_escape_decode", (PyCFunction)_codecs_raw_unicode_escape_decode, METH_FASTCALL, _codecs_raw_unicode_escape_decode__doc__}, + {"raw_unicode_escape_decode", (PyCFunction)(void(*)(void))_codecs_raw_unicode_escape_decode, METH_FASTCALL, _codecs_raw_unicode_escape_decode__doc__}, static PyObject * _codecs_raw_unicode_escape_decode_impl(PyObject *module, Py_buffer *data, @@ -667,7 +667,7 @@ PyDoc_STRVAR(_codecs_latin_1_decode__doc__, "\n"); #define _CODECS_LATIN_1_DECODE_METHODDEF \ - {"latin_1_decode", (PyCFunction)_codecs_latin_1_decode, METH_FASTCALL, _codecs_latin_1_decode__doc__}, + {"latin_1_decode", (PyCFunction)(void(*)(void))_codecs_latin_1_decode, METH_FASTCALL, _codecs_latin_1_decode__doc__}, static PyObject * _codecs_latin_1_decode_impl(PyObject *module, Py_buffer *data, @@ -701,7 +701,7 @@ PyDoc_STRVAR(_codecs_ascii_decode__doc__, "\n"); #define _CODECS_ASCII_DECODE_METHODDEF \ - {"ascii_decode", (PyCFunction)_codecs_ascii_decode, METH_FASTCALL, _codecs_ascii_decode__doc__}, + {"ascii_decode", (PyCFunction)(void(*)(void))_codecs_ascii_decode, METH_FASTCALL, _codecs_ascii_decode__doc__}, static PyObject * _codecs_ascii_decode_impl(PyObject *module, Py_buffer *data, @@ -735,7 +735,7 @@ PyDoc_STRVAR(_codecs_charmap_decode__doc__, "\n"); #define _CODECS_CHARMAP_DECODE_METHODDEF \ - {"charmap_decode", (PyCFunction)_codecs_charmap_decode, METH_FASTCALL, _codecs_charmap_decode__doc__}, + {"charmap_decode", (PyCFunction)(void(*)(void))_codecs_charmap_decode, METH_FASTCALL, _codecs_charmap_decode__doc__}, static PyObject * _codecs_charmap_decode_impl(PyObject *module, Py_buffer *data, @@ -772,7 +772,7 @@ PyDoc_STRVAR(_codecs_mbcs_decode__doc__, "\n"); #define _CODECS_MBCS_DECODE_METHODDEF \ - {"mbcs_decode", (PyCFunction)_codecs_mbcs_decode, METH_FASTCALL, _codecs_mbcs_decode__doc__}, + {"mbcs_decode", (PyCFunction)(void(*)(void))_codecs_mbcs_decode, METH_FASTCALL, _codecs_mbcs_decode__doc__}, static PyObject * _codecs_mbcs_decode_impl(PyObject *module, Py_buffer *data, @@ -811,7 +811,7 @@ PyDoc_STRVAR(_codecs_oem_decode__doc__, "\n"); #define _CODECS_OEM_DECODE_METHODDEF \ - {"oem_decode", (PyCFunction)_codecs_oem_decode, METH_FASTCALL, _codecs_oem_decode__doc__}, + {"oem_decode", (PyCFunction)(void(*)(void))_codecs_oem_decode, METH_FASTCALL, _codecs_oem_decode__doc__}, static PyObject * _codecs_oem_decode_impl(PyObject *module, Py_buffer *data, @@ -850,7 +850,7 @@ PyDoc_STRVAR(_codecs_code_page_decode__doc__, "\n"); #define _CODECS_CODE_PAGE_DECODE_METHODDEF \ - {"code_page_decode", (PyCFunction)_codecs_code_page_decode, METH_FASTCALL, _codecs_code_page_decode__doc__}, + {"code_page_decode", (PyCFunction)(void(*)(void))_codecs_code_page_decode, METH_FASTCALL, _codecs_code_page_decode__doc__}, static PyObject * _codecs_code_page_decode_impl(PyObject *module, int codepage, @@ -888,7 +888,7 @@ PyDoc_STRVAR(_codecs_readbuffer_encode__doc__, "\n"); #define _CODECS_READBUFFER_ENCODE_METHODDEF \ - {"readbuffer_encode", (PyCFunction)_codecs_readbuffer_encode, METH_FASTCALL, _codecs_readbuffer_encode__doc__}, + {"readbuffer_encode", (PyCFunction)(void(*)(void))_codecs_readbuffer_encode, METH_FASTCALL, _codecs_readbuffer_encode__doc__}, static PyObject * _codecs_readbuffer_encode_impl(PyObject *module, Py_buffer *data, @@ -922,7 +922,7 @@ PyDoc_STRVAR(_codecs_unicode_internal_encode__doc__, "\n"); #define _CODECS_UNICODE_INTERNAL_ENCODE_METHODDEF \ - {"unicode_internal_encode", (PyCFunction)_codecs_unicode_internal_encode, METH_FASTCALL, _codecs_unicode_internal_encode__doc__}, + {"unicode_internal_encode", (PyCFunction)(void(*)(void))_codecs_unicode_internal_encode, METH_FASTCALL, _codecs_unicode_internal_encode__doc__}, static PyObject * _codecs_unicode_internal_encode_impl(PyObject *module, PyObject *obj, @@ -951,7 +951,7 @@ PyDoc_STRVAR(_codecs_utf_7_encode__doc__, "\n"); #define _CODECS_UTF_7_ENCODE_METHODDEF \ - {"utf_7_encode", (PyCFunction)_codecs_utf_7_encode, METH_FASTCALL, _codecs_utf_7_encode__doc__}, + {"utf_7_encode", (PyCFunction)(void(*)(void))_codecs_utf_7_encode, METH_FASTCALL, _codecs_utf_7_encode__doc__}, static PyObject * _codecs_utf_7_encode_impl(PyObject *module, PyObject *str, @@ -980,7 +980,7 @@ PyDoc_STRVAR(_codecs_utf_8_encode__doc__, "\n"); #define _CODECS_UTF_8_ENCODE_METHODDEF \ - {"utf_8_encode", (PyCFunction)_codecs_utf_8_encode, METH_FASTCALL, _codecs_utf_8_encode__doc__}, + {"utf_8_encode", (PyCFunction)(void(*)(void))_codecs_utf_8_encode, METH_FASTCALL, _codecs_utf_8_encode__doc__}, static PyObject * _codecs_utf_8_encode_impl(PyObject *module, PyObject *str, @@ -1009,7 +1009,7 @@ PyDoc_STRVAR(_codecs_utf_16_encode__doc__, "\n"); #define _CODECS_UTF_16_ENCODE_METHODDEF \ - {"utf_16_encode", (PyCFunction)_codecs_utf_16_encode, METH_FASTCALL, _codecs_utf_16_encode__doc__}, + {"utf_16_encode", (PyCFunction)(void(*)(void))_codecs_utf_16_encode, METH_FASTCALL, _codecs_utf_16_encode__doc__}, static PyObject * _codecs_utf_16_encode_impl(PyObject *module, PyObject *str, @@ -1039,7 +1039,7 @@ PyDoc_STRVAR(_codecs_utf_16_le_encode__doc__, "\n"); #define _CODECS_UTF_16_LE_ENCODE_METHODDEF \ - {"utf_16_le_encode", (PyCFunction)_codecs_utf_16_le_encode, METH_FASTCALL, _codecs_utf_16_le_encode__doc__}, + {"utf_16_le_encode", (PyCFunction)(void(*)(void))_codecs_utf_16_le_encode, METH_FASTCALL, _codecs_utf_16_le_encode__doc__}, static PyObject * _codecs_utf_16_le_encode_impl(PyObject *module, PyObject *str, @@ -1068,7 +1068,7 @@ PyDoc_STRVAR(_codecs_utf_16_be_encode__doc__, "\n"); #define _CODECS_UTF_16_BE_ENCODE_METHODDEF \ - {"utf_16_be_encode", (PyCFunction)_codecs_utf_16_be_encode, METH_FASTCALL, _codecs_utf_16_be_encode__doc__}, + {"utf_16_be_encode", (PyCFunction)(void(*)(void))_codecs_utf_16_be_encode, METH_FASTCALL, _codecs_utf_16_be_encode__doc__}, static PyObject * _codecs_utf_16_be_encode_impl(PyObject *module, PyObject *str, @@ -1097,7 +1097,7 @@ PyDoc_STRVAR(_codecs_utf_32_encode__doc__, "\n"); #define _CODECS_UTF_32_ENCODE_METHODDEF \ - {"utf_32_encode", (PyCFunction)_codecs_utf_32_encode, METH_FASTCALL, _codecs_utf_32_encode__doc__}, + {"utf_32_encode", (PyCFunction)(void(*)(void))_codecs_utf_32_encode, METH_FASTCALL, _codecs_utf_32_encode__doc__}, static PyObject * _codecs_utf_32_encode_impl(PyObject *module, PyObject *str, @@ -1127,7 +1127,7 @@ PyDoc_STRVAR(_codecs_utf_32_le_encode__doc__, "\n"); #define _CODECS_UTF_32_LE_ENCODE_METHODDEF \ - {"utf_32_le_encode", (PyCFunction)_codecs_utf_32_le_encode, METH_FASTCALL, _codecs_utf_32_le_encode__doc__}, + {"utf_32_le_encode", (PyCFunction)(void(*)(void))_codecs_utf_32_le_encode, METH_FASTCALL, _codecs_utf_32_le_encode__doc__}, static PyObject * _codecs_utf_32_le_encode_impl(PyObject *module, PyObject *str, @@ -1156,7 +1156,7 @@ PyDoc_STRVAR(_codecs_utf_32_be_encode__doc__, "\n"); #define _CODECS_UTF_32_BE_ENCODE_METHODDEF \ - {"utf_32_be_encode", (PyCFunction)_codecs_utf_32_be_encode, METH_FASTCALL, _codecs_utf_32_be_encode__doc__}, + {"utf_32_be_encode", (PyCFunction)(void(*)(void))_codecs_utf_32_be_encode, METH_FASTCALL, _codecs_utf_32_be_encode__doc__}, static PyObject * _codecs_utf_32_be_encode_impl(PyObject *module, PyObject *str, @@ -1185,7 +1185,7 @@ PyDoc_STRVAR(_codecs_unicode_escape_encode__doc__, "\n"); #define _CODECS_UNICODE_ESCAPE_ENCODE_METHODDEF \ - {"unicode_escape_encode", (PyCFunction)_codecs_unicode_escape_encode, METH_FASTCALL, _codecs_unicode_escape_encode__doc__}, + {"unicode_escape_encode", (PyCFunction)(void(*)(void))_codecs_unicode_escape_encode, METH_FASTCALL, _codecs_unicode_escape_encode__doc__}, static PyObject * _codecs_unicode_escape_encode_impl(PyObject *module, PyObject *str, @@ -1214,7 +1214,7 @@ PyDoc_STRVAR(_codecs_raw_unicode_escape_encode__doc__, "\n"); #define _CODECS_RAW_UNICODE_ESCAPE_ENCODE_METHODDEF \ - {"raw_unicode_escape_encode", (PyCFunction)_codecs_raw_unicode_escape_encode, METH_FASTCALL, _codecs_raw_unicode_escape_encode__doc__}, + {"raw_unicode_escape_encode", (PyCFunction)(void(*)(void))_codecs_raw_unicode_escape_encode, METH_FASTCALL, _codecs_raw_unicode_escape_encode__doc__}, static PyObject * _codecs_raw_unicode_escape_encode_impl(PyObject *module, PyObject *str, @@ -1243,7 +1243,7 @@ PyDoc_STRVAR(_codecs_latin_1_encode__doc__, "\n"); #define _CODECS_LATIN_1_ENCODE_METHODDEF \ - {"latin_1_encode", (PyCFunction)_codecs_latin_1_encode, METH_FASTCALL, _codecs_latin_1_encode__doc__}, + {"latin_1_encode", (PyCFunction)(void(*)(void))_codecs_latin_1_encode, METH_FASTCALL, _codecs_latin_1_encode__doc__}, static PyObject * _codecs_latin_1_encode_impl(PyObject *module, PyObject *str, @@ -1272,7 +1272,7 @@ PyDoc_STRVAR(_codecs_ascii_encode__doc__, "\n"); #define _CODECS_ASCII_ENCODE_METHODDEF \ - {"ascii_encode", (PyCFunction)_codecs_ascii_encode, METH_FASTCALL, _codecs_ascii_encode__doc__}, + {"ascii_encode", (PyCFunction)(void(*)(void))_codecs_ascii_encode, METH_FASTCALL, _codecs_ascii_encode__doc__}, static PyObject * _codecs_ascii_encode_impl(PyObject *module, PyObject *str, @@ -1301,7 +1301,7 @@ PyDoc_STRVAR(_codecs_charmap_encode__doc__, "\n"); #define _CODECS_CHARMAP_ENCODE_METHODDEF \ - {"charmap_encode", (PyCFunction)_codecs_charmap_encode, METH_FASTCALL, _codecs_charmap_encode__doc__}, + {"charmap_encode", (PyCFunction)(void(*)(void))_codecs_charmap_encode, METH_FASTCALL, _codecs_charmap_encode__doc__}, static PyObject * _codecs_charmap_encode_impl(PyObject *module, PyObject *str, @@ -1359,7 +1359,7 @@ PyDoc_STRVAR(_codecs_mbcs_encode__doc__, "\n"); #define _CODECS_MBCS_ENCODE_METHODDEF \ - {"mbcs_encode", (PyCFunction)_codecs_mbcs_encode, METH_FASTCALL, _codecs_mbcs_encode__doc__}, + {"mbcs_encode", (PyCFunction)(void(*)(void))_codecs_mbcs_encode, METH_FASTCALL, _codecs_mbcs_encode__doc__}, static PyObject * _codecs_mbcs_encode_impl(PyObject *module, PyObject *str, const char *errors); @@ -1391,7 +1391,7 @@ PyDoc_STRVAR(_codecs_oem_encode__doc__, "\n"); #define _CODECS_OEM_ENCODE_METHODDEF \ - {"oem_encode", (PyCFunction)_codecs_oem_encode, METH_FASTCALL, _codecs_oem_encode__doc__}, + {"oem_encode", (PyCFunction)(void(*)(void))_codecs_oem_encode, METH_FASTCALL, _codecs_oem_encode__doc__}, static PyObject * _codecs_oem_encode_impl(PyObject *module, PyObject *str, const char *errors); @@ -1423,7 +1423,7 @@ PyDoc_STRVAR(_codecs_code_page_encode__doc__, "\n"); #define _CODECS_CODE_PAGE_ENCODE_METHODDEF \ - {"code_page_encode", (PyCFunction)_codecs_code_page_encode, METH_FASTCALL, _codecs_code_page_encode__doc__}, + {"code_page_encode", (PyCFunction)(void(*)(void))_codecs_code_page_encode, METH_FASTCALL, _codecs_code_page_encode__doc__}, static PyObject * _codecs_code_page_encode_impl(PyObject *module, int code_page, PyObject *str, @@ -1460,7 +1460,7 @@ PyDoc_STRVAR(_codecs_register_error__doc__, "error and must return a (replacement, new position) tuple."); #define _CODECS_REGISTER_ERROR_METHODDEF \ - {"register_error", (PyCFunction)_codecs_register_error, METH_FASTCALL, _codecs_register_error__doc__}, + {"register_error", (PyCFunction)(void(*)(void))_codecs_register_error, METH_FASTCALL, _codecs_register_error__doc__}, static PyObject * _codecs_register_error_impl(PyObject *module, const char *errors, @@ -1536,4 +1536,4 @@ _codecs_lookup_error(PyObject *module, PyObject *arg) #ifndef _CODECS_CODE_PAGE_ENCODE_METHODDEF #define _CODECS_CODE_PAGE_ENCODE_METHODDEF #endif /* !defined(_CODECS_CODE_PAGE_ENCODE_METHODDEF) */ -/*[clinic end generated code: output=06fa0d6803103c62 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d29fe7c0cb206812 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_cryptmodule.c.h b/Modules/clinic/_cryptmodule.c.h index 71eb53cd5e6c..baa31e2d2fbe 100644 --- a/Modules/clinic/_cryptmodule.c.h +++ b/Modules/clinic/_cryptmodule.c.h @@ -14,7 +14,7 @@ PyDoc_STRVAR(crypt_crypt__doc__, "results for a given *word*."); #define CRYPT_CRYPT_METHODDEF \ - {"crypt", (PyCFunction)crypt_crypt, METH_FASTCALL, crypt_crypt__doc__}, + {"crypt", (PyCFunction)(void(*)(void))crypt_crypt, METH_FASTCALL, crypt_crypt__doc__}, static PyObject * crypt_crypt_impl(PyObject *module, const char *word, const char *salt); @@ -35,4 +35,4 @@ crypt_crypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=8d803e53466b1cd3 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=79001dbfdd623ff9 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_curses_panel.c.h b/Modules/clinic/_curses_panel.c.h index e11c68d864a6..4f3f593ba3ca 100644 --- a/Modules/clinic/_curses_panel.c.h +++ b/Modules/clinic/_curses_panel.c.h @@ -137,7 +137,7 @@ PyDoc_STRVAR(_curses_panel_panel_move__doc__, "Move the panel to the screen coordinates (y, x)."); #define _CURSES_PANEL_PANEL_MOVE_METHODDEF \ - {"move", (PyCFunction)_curses_panel_panel_move, METH_FASTCALL, _curses_panel_panel_move__doc__}, + {"move", (PyCFunction)(void(*)(void))_curses_panel_panel_move, METH_FASTCALL, _curses_panel_panel_move__doc__}, static PyObject * _curses_panel_panel_move_impl(PyCursesPanelObject *self, int y, int x); @@ -314,4 +314,4 @@ _curses_panel_update_panels(PyObject *module, PyObject *Py_UNUSED(ignored)) { return _curses_panel_update_panels_impl(module); } -/*[clinic end generated code: output=96f627ca0b08b96d input=a9049054013a1b77]*/ +/*[clinic end generated code: output=66e49cb9726a638f input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_cursesmodule.c.h b/Modules/clinic/_cursesmodule.c.h index b32797fc74ee..ac921d5761f8 100644 --- a/Modules/clinic/_cursesmodule.c.h +++ b/Modules/clinic/_cursesmodule.c.h @@ -233,7 +233,7 @@ PyDoc_STRVAR(_curses_window_bkgd__doc__, " Background attributes."); #define _CURSES_WINDOW_BKGD_METHODDEF \ - {"bkgd", (PyCFunction)_curses_window_bkgd, METH_FASTCALL, _curses_window_bkgd__doc__}, + {"bkgd", (PyCFunction)(void(*)(void))_curses_window_bkgd, METH_FASTCALL, _curses_window_bkgd__doc__}, static PyObject * _curses_window_bkgd_impl(PyCursesWindowObject *self, PyObject *ch, long attr); @@ -348,7 +348,7 @@ PyDoc_STRVAR(_curses_window_bkgdset__doc__, " Background attributes."); #define _CURSES_WINDOW_BKGDSET_METHODDEF \ - {"bkgdset", (PyCFunction)_curses_window_bkgdset, METH_FASTCALL, _curses_window_bkgdset__doc__}, + {"bkgdset", (PyCFunction)(void(*)(void))_curses_window_bkgdset, METH_FASTCALL, _curses_window_bkgdset__doc__}, static PyObject * _curses_window_bkgdset_impl(PyCursesWindowObject *self, PyObject *ch, @@ -403,7 +403,7 @@ PyDoc_STRVAR(_curses_window_border__doc__, "used for that parameter."); #define _CURSES_WINDOW_BORDER_METHODDEF \ - {"border", (PyCFunction)_curses_window_border, METH_FASTCALL, _curses_window_border__doc__}, + {"border", (PyCFunction)(void(*)(void))_curses_window_border, METH_FASTCALL, _curses_window_border__doc__}, static PyObject * _curses_window_border_impl(PyCursesWindowObject *self, PyObject *ls, @@ -592,7 +592,7 @@ PyDoc_STRVAR(_curses_window_echochar__doc__, " Attributes for the character."); #define _CURSES_WINDOW_ECHOCHAR_METHODDEF \ - {"echochar", (PyCFunction)_curses_window_echochar, METH_FASTCALL, _curses_window_echochar__doc__}, + {"echochar", (PyCFunction)(void(*)(void))_curses_window_echochar, METH_FASTCALL, _curses_window_echochar__doc__}, static PyObject * _curses_window_echochar_impl(PyCursesWindowObject *self, PyObject *ch, @@ -629,7 +629,7 @@ PyDoc_STRVAR(_curses_window_enclose__doc__, " X-coordinate."); #define _CURSES_WINDOW_ENCLOSE_METHODDEF \ - {"enclose", (PyCFunction)_curses_window_enclose, METH_FASTCALL, _curses_window_enclose__doc__}, + {"enclose", (PyCFunction)(void(*)(void))_curses_window_enclose, METH_FASTCALL, _curses_window_enclose__doc__}, static long _curses_window_enclose_impl(PyCursesWindowObject *self, int y, int x); @@ -1426,7 +1426,7 @@ PyDoc_STRVAR(_curses_window_redrawln__doc__, "They should be completely redrawn on the next refresh() call."); #define _CURSES_WINDOW_REDRAWLN_METHODDEF \ - {"redrawln", (PyCFunction)_curses_window_redrawln, METH_FASTCALL, _curses_window_redrawln__doc__}, + {"redrawln", (PyCFunction)(void(*)(void))_curses_window_redrawln, METH_FASTCALL, _curses_window_redrawln__doc__}, static PyObject * _curses_window_redrawln_impl(PyCursesWindowObject *self, int beg, int num); @@ -1517,7 +1517,7 @@ PyDoc_STRVAR(_curses_window_setscrreg__doc__, "All scrolling actions will take place in this region."); #define _CURSES_WINDOW_SETSCRREG_METHODDEF \ - {"setscrreg", (PyCFunction)_curses_window_setscrreg, METH_FASTCALL, _curses_window_setscrreg__doc__}, + {"setscrreg", (PyCFunction)(void(*)(void))_curses_window_setscrreg, METH_FASTCALL, _curses_window_setscrreg__doc__}, static PyObject * _curses_window_setscrreg_impl(PyCursesWindowObject *self, int top, @@ -1843,7 +1843,7 @@ PyDoc_STRVAR(_curses_cbreak__doc__, "Calling first raw() then cbreak() leaves the terminal in cbreak mode."); #define _CURSES_CBREAK_METHODDEF \ - {"cbreak", (PyCFunction)_curses_cbreak, METH_FASTCALL, _curses_cbreak__doc__}, + {"cbreak", (PyCFunction)(void(*)(void))_curses_cbreak, METH_FASTCALL, _curses_cbreak__doc__}, static PyObject * _curses_cbreak_impl(PyObject *module, int flag); @@ -2069,7 +2069,7 @@ PyDoc_STRVAR(_curses_echo__doc__, "In echo mode, each character input is echoed to the screen as it is entered."); #define _CURSES_ECHO_METHODDEF \ - {"echo", (PyCFunction)_curses_echo, METH_FASTCALL, _curses_echo__doc__}, + {"echo", (PyCFunction)(void(*)(void))_curses_echo, METH_FASTCALL, _curses_echo__doc__}, static PyObject * _curses_echo_impl(PyObject *module, int flag); @@ -2227,7 +2227,7 @@ PyDoc_STRVAR(_curses_ungetmouse__doc__, "The following getmouse() will return the given state data."); #define _CURSES_UNGETMOUSE_METHODDEF \ - {"ungetmouse", (PyCFunction)_curses_ungetmouse, METH_FASTCALL, _curses_ungetmouse__doc__}, + {"ungetmouse", (PyCFunction)(void(*)(void))_curses_ungetmouse, METH_FASTCALL, _curses_ungetmouse__doc__}, static PyObject * _curses_ungetmouse_impl(PyObject *module, short id, int x, int y, int z, @@ -2407,7 +2407,7 @@ PyDoc_STRVAR(_curses_init_color__doc__, "most terminals; it is active only if can_change_color() returns 1."); #define _CURSES_INIT_COLOR_METHODDEF \ - {"init_color", (PyCFunction)_curses_init_color, METH_FASTCALL, _curses_init_color__doc__}, + {"init_color", (PyCFunction)(void(*)(void))_curses_init_color, METH_FASTCALL, _curses_init_color__doc__}, static PyObject * _curses_init_color_impl(PyObject *module, short color_number, short r, @@ -2449,7 +2449,7 @@ PyDoc_STRVAR(_curses_init_pair__doc__, "all occurrences of that color-pair are changed to the new definition."); #define _CURSES_INIT_PAIR_METHODDEF \ - {"init_pair", (PyCFunction)_curses_init_pair, METH_FASTCALL, _curses_init_pair__doc__}, + {"init_pair", (PyCFunction)(void(*)(void))_curses_init_pair, METH_FASTCALL, _curses_init_pair__doc__}, static PyObject * _curses_init_pair_impl(PyObject *module, short pair_number, short fg, @@ -2507,7 +2507,7 @@ PyDoc_STRVAR(_curses_setupterm__doc__, " If not supplied, the file descriptor for sys.stdout will be used."); #define _CURSES_SETUPTERM_METHODDEF \ - {"setupterm", (PyCFunction)_curses_setupterm, METH_FASTCALL|METH_KEYWORDS, _curses_setupterm__doc__}, + {"setupterm", (PyCFunction)(void(*)(void))_curses_setupterm, METH_FASTCALL|METH_KEYWORDS, _curses_setupterm__doc__}, static PyObject * _curses_setupterm_impl(PyObject *module, const char *term, int fd); @@ -2589,7 +2589,7 @@ PyDoc_STRVAR(_curses_is_term_resized__doc__, " Width."); #define _CURSES_IS_TERM_RESIZED_METHODDEF \ - {"is_term_resized", (PyCFunction)_curses_is_term_resized, METH_FASTCALL, _curses_is_term_resized__doc__}, + {"is_term_resized", (PyCFunction)(void(*)(void))_curses_is_term_resized, METH_FASTCALL, _curses_is_term_resized__doc__}, static PyObject * _curses_is_term_resized_impl(PyObject *module, int nlines, int ncols); @@ -2828,7 +2828,7 @@ PyDoc_STRVAR(_curses_newpad__doc__, " Width."); #define _CURSES_NEWPAD_METHODDEF \ - {"newpad", (PyCFunction)_curses_newpad, METH_FASTCALL, _curses_newpad__doc__}, + {"newpad", (PyCFunction)(void(*)(void))_curses_newpad, METH_FASTCALL, _curses_newpad__doc__}, static PyObject * _curses_newpad_impl(PyObject *module, int nlines, int ncols); @@ -2918,7 +2918,7 @@ PyDoc_STRVAR(_curses_nl__doc__, "newline into return and line-feed on output. Newline mode is initially on."); #define _CURSES_NL_METHODDEF \ - {"nl", (PyCFunction)_curses_nl, METH_FASTCALL, _curses_nl__doc__}, + {"nl", (PyCFunction)(void(*)(void))_curses_nl, METH_FASTCALL, _curses_nl__doc__}, static PyObject * _curses_nl_impl(PyObject *module, int flag); @@ -3142,7 +3142,7 @@ PyDoc_STRVAR(_curses_qiflush__doc__, "will be flushed when the INTR, QUIT and SUSP characters are read."); #define _CURSES_QIFLUSH_METHODDEF \ - {"qiflush", (PyCFunction)_curses_qiflush, METH_FASTCALL, _curses_qiflush__doc__}, + {"qiflush", (PyCFunction)(void(*)(void))_curses_qiflush, METH_FASTCALL, _curses_qiflush__doc__}, static PyObject * _curses_qiflush_impl(PyObject *module, int flag); @@ -3208,7 +3208,7 @@ PyDoc_STRVAR(_curses_raw__doc__, "curses input functions one by one."); #define _CURSES_RAW_METHODDEF \ - {"raw", (PyCFunction)_curses_raw, METH_FASTCALL, _curses_raw__doc__}, + {"raw", (PyCFunction)(void(*)(void))_curses_raw, METH_FASTCALL, _curses_raw__doc__}, static PyObject * _curses_raw_impl(PyObject *module, int flag); @@ -3300,7 +3300,7 @@ PyDoc_STRVAR(_curses_resizeterm__doc__, "window dimensions (in particular the SIGWINCH handler)."); #define _CURSES_RESIZETERM_METHODDEF \ - {"resizeterm", (PyCFunction)_curses_resizeterm, METH_FASTCALL, _curses_resizeterm__doc__}, + {"resizeterm", (PyCFunction)(void(*)(void))_curses_resizeterm, METH_FASTCALL, _curses_resizeterm__doc__}, static PyObject * _curses_resizeterm_impl(PyObject *module, int nlines, int ncols); @@ -3344,7 +3344,7 @@ PyDoc_STRVAR(_curses_resize_term__doc__, "without additional interaction with the application."); #define _CURSES_RESIZE_TERM_METHODDEF \ - {"resize_term", (PyCFunction)_curses_resize_term, METH_FASTCALL, _curses_resize_term__doc__}, + {"resize_term", (PyCFunction)(void(*)(void))_curses_resize_term, METH_FASTCALL, _curses_resize_term__doc__}, static PyObject * _curses_resize_term_impl(PyObject *module, int nlines, int ncols); @@ -3402,7 +3402,7 @@ PyDoc_STRVAR(_curses_setsyx__doc__, "If y and x are both -1, then leaveok is set."); #define _CURSES_SETSYX_METHODDEF \ - {"setsyx", (PyCFunction)_curses_setsyx, METH_FASTCALL, _curses_setsyx__doc__}, + {"setsyx", (PyCFunction)(void(*)(void))_curses_setsyx, METH_FASTCALL, _curses_setsyx__doc__}, static PyObject * _curses_setsyx_impl(PyObject *module, int y, int x); @@ -3597,7 +3597,7 @@ PyDoc_STRVAR(_curses_tparm__doc__, " Parameterized byte string obtained from the terminfo database."); #define _CURSES_TPARM_METHODDEF \ - {"tparm", (PyCFunction)_curses_tparm, METH_FASTCALL, _curses_tparm__doc__}, + {"tparm", (PyCFunction)(void(*)(void))_curses_tparm, METH_FASTCALL, _curses_tparm__doc__}, static PyObject * _curses_tparm_impl(PyObject *module, const char *str, int i1, int i2, int i3, @@ -3838,4 +3838,4 @@ _curses_use_default_colors(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef _CURSES_USE_DEFAULT_COLORS_METHODDEF #define _CURSES_USE_DEFAULT_COLORS_METHODDEF #endif /* !defined(_CURSES_USE_DEFAULT_COLORS_METHODDEF) */ -/*[clinic end generated code: output=763ffe3abc3a97c7 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=177ad1d0b5586aaa input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_datetimemodule.c.h b/Modules/clinic/_datetimemodule.c.h index 0f917ddd2e18..36b4fcac47e5 100644 --- a/Modules/clinic/_datetimemodule.c.h +++ b/Modules/clinic/_datetimemodule.c.h @@ -26,7 +26,7 @@ PyDoc_STRVAR(datetime_datetime_now__doc__, "If no tz is specified, uses local timezone."); #define DATETIME_DATETIME_NOW_METHODDEF \ - {"now", (PyCFunction)datetime_datetime_now, METH_FASTCALL|METH_KEYWORDS|METH_CLASS, datetime_datetime_now__doc__}, + {"now", (PyCFunction)(void(*)(void))datetime_datetime_now, METH_FASTCALL|METH_KEYWORDS|METH_CLASS, datetime_datetime_now__doc__}, static PyObject * datetime_datetime_now_impl(PyTypeObject *type, PyObject *tz); @@ -48,4 +48,4 @@ datetime_datetime_now(PyTypeObject *type, PyObject *const *args, Py_ssize_t narg exit: return return_value; } -/*[clinic end generated code: output=7fd14bd67749da23 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b3d746843403a8ce input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_dbmmodule.c.h b/Modules/clinic/_dbmmodule.c.h index 574cc5ee174b..c0908623c973 100644 --- a/Modules/clinic/_dbmmodule.c.h +++ b/Modules/clinic/_dbmmodule.c.h @@ -45,7 +45,7 @@ PyDoc_STRVAR(_dbm_dbm_get__doc__, "Return the value for key if present, otherwise default."); #define _DBM_DBM_GET_METHODDEF \ - {"get", (PyCFunction)_dbm_dbm_get, METH_FASTCALL, _dbm_dbm_get__doc__}, + {"get", (PyCFunction)(void(*)(void))_dbm_dbm_get, METH_FASTCALL, _dbm_dbm_get__doc__}, static PyObject * _dbm_dbm_get_impl(dbmobject *self, const char *key, @@ -78,7 +78,7 @@ PyDoc_STRVAR(_dbm_dbm_setdefault__doc__, "If key is not in the database, it is inserted with default as the value."); #define _DBM_DBM_SETDEFAULT_METHODDEF \ - {"setdefault", (PyCFunction)_dbm_dbm_setdefault, METH_FASTCALL, _dbm_dbm_setdefault__doc__}, + {"setdefault", (PyCFunction)(void(*)(void))_dbm_dbm_setdefault, METH_FASTCALL, _dbm_dbm_setdefault__doc__}, static PyObject * _dbm_dbm_setdefault_impl(dbmobject *self, const char *key, @@ -118,7 +118,7 @@ PyDoc_STRVAR(dbmopen__doc__, " (e.g. os.O_RDWR)."); #define DBMOPEN_METHODDEF \ - {"open", (PyCFunction)dbmopen, METH_FASTCALL, dbmopen__doc__}, + {"open", (PyCFunction)(void(*)(void))dbmopen, METH_FASTCALL, dbmopen__doc__}, static PyObject * dbmopen_impl(PyObject *module, PyObject *filename, const char *flags, @@ -141,4 +141,4 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=1cba297bc8d7c2c2 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e4585e78f5821b5b input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_elementtree.c.h b/Modules/clinic/_elementtree.c.h index 78b9be89a3e6..f7dc12eacfad 100644 --- a/Modules/clinic/_elementtree.c.h +++ b/Modules/clinic/_elementtree.c.h @@ -154,7 +154,7 @@ PyDoc_STRVAR(_elementtree_Element_find__doc__, "\n"); #define _ELEMENTTREE_ELEMENT_FIND_METHODDEF \ - {"find", (PyCFunction)_elementtree_Element_find, METH_FASTCALL|METH_KEYWORDS, _elementtree_Element_find__doc__}, + {"find", (PyCFunction)(void(*)(void))_elementtree_Element_find, METH_FASTCALL|METH_KEYWORDS, _elementtree_Element_find__doc__}, static PyObject * _elementtree_Element_find_impl(ElementObject *self, PyObject *path, @@ -185,7 +185,7 @@ PyDoc_STRVAR(_elementtree_Element_findtext__doc__, "\n"); #define _ELEMENTTREE_ELEMENT_FINDTEXT_METHODDEF \ - {"findtext", (PyCFunction)_elementtree_Element_findtext, METH_FASTCALL|METH_KEYWORDS, _elementtree_Element_findtext__doc__}, + {"findtext", (PyCFunction)(void(*)(void))_elementtree_Element_findtext, METH_FASTCALL|METH_KEYWORDS, _elementtree_Element_findtext__doc__}, static PyObject * _elementtree_Element_findtext_impl(ElementObject *self, PyObject *path, @@ -218,7 +218,7 @@ PyDoc_STRVAR(_elementtree_Element_findall__doc__, "\n"); #define _ELEMENTTREE_ELEMENT_FINDALL_METHODDEF \ - {"findall", (PyCFunction)_elementtree_Element_findall, METH_FASTCALL|METH_KEYWORDS, _elementtree_Element_findall__doc__}, + {"findall", (PyCFunction)(void(*)(void))_elementtree_Element_findall, METH_FASTCALL|METH_KEYWORDS, _elementtree_Element_findall__doc__}, static PyObject * _elementtree_Element_findall_impl(ElementObject *self, PyObject *path, @@ -249,7 +249,7 @@ PyDoc_STRVAR(_elementtree_Element_iterfind__doc__, "\n"); #define _ELEMENTTREE_ELEMENT_ITERFIND_METHODDEF \ - {"iterfind", (PyCFunction)_elementtree_Element_iterfind, METH_FASTCALL|METH_KEYWORDS, _elementtree_Element_iterfind__doc__}, + {"iterfind", (PyCFunction)(void(*)(void))_elementtree_Element_iterfind, METH_FASTCALL|METH_KEYWORDS, _elementtree_Element_iterfind__doc__}, static PyObject * _elementtree_Element_iterfind_impl(ElementObject *self, PyObject *path, @@ -280,7 +280,7 @@ PyDoc_STRVAR(_elementtree_Element_get__doc__, "\n"); #define _ELEMENTTREE_ELEMENT_GET_METHODDEF \ - {"get", (PyCFunction)_elementtree_Element_get, METH_FASTCALL|METH_KEYWORDS, _elementtree_Element_get__doc__}, + {"get", (PyCFunction)(void(*)(void))_elementtree_Element_get, METH_FASTCALL|METH_KEYWORDS, _elementtree_Element_get__doc__}, static PyObject * _elementtree_Element_get_impl(ElementObject *self, PyObject *key, @@ -328,7 +328,7 @@ PyDoc_STRVAR(_elementtree_Element_iter__doc__, "\n"); #define _ELEMENTTREE_ELEMENT_ITER_METHODDEF \ - {"iter", (PyCFunction)_elementtree_Element_iter, METH_FASTCALL|METH_KEYWORDS, _elementtree_Element_iter__doc__}, + {"iter", (PyCFunction)(void(*)(void))_elementtree_Element_iter, METH_FASTCALL|METH_KEYWORDS, _elementtree_Element_iter__doc__}, static PyObject * _elementtree_Element_iter_impl(ElementObject *self, PyObject *tag); @@ -357,7 +357,7 @@ PyDoc_STRVAR(_elementtree_Element_getiterator__doc__, "\n"); #define _ELEMENTTREE_ELEMENT_GETITERATOR_METHODDEF \ - {"getiterator", (PyCFunction)_elementtree_Element_getiterator, METH_FASTCALL|METH_KEYWORDS, _elementtree_Element_getiterator__doc__}, + {"getiterator", (PyCFunction)(void(*)(void))_elementtree_Element_getiterator, METH_FASTCALL|METH_KEYWORDS, _elementtree_Element_getiterator__doc__}, static PyObject * _elementtree_Element_getiterator_impl(ElementObject *self, PyObject *tag); @@ -403,7 +403,7 @@ PyDoc_STRVAR(_elementtree_Element_insert__doc__, "\n"); #define _ELEMENTTREE_ELEMENT_INSERT_METHODDEF \ - {"insert", (PyCFunction)_elementtree_Element_insert, METH_FASTCALL, _elementtree_Element_insert__doc__}, + {"insert", (PyCFunction)(void(*)(void))_elementtree_Element_insert, METH_FASTCALL, _elementtree_Element_insert__doc__}, static PyObject * _elementtree_Element_insert_impl(ElementObject *self, Py_ssize_t index, @@ -466,7 +466,7 @@ PyDoc_STRVAR(_elementtree_Element_makeelement__doc__, "\n"); #define _ELEMENTTREE_ELEMENT_MAKEELEMENT_METHODDEF \ - {"makeelement", (PyCFunction)_elementtree_Element_makeelement, METH_FASTCALL, _elementtree_Element_makeelement__doc__}, + {"makeelement", (PyCFunction)(void(*)(void))_elementtree_Element_makeelement, METH_FASTCALL, _elementtree_Element_makeelement__doc__}, static PyObject * _elementtree_Element_makeelement_impl(ElementObject *self, PyObject *tag, @@ -522,7 +522,7 @@ PyDoc_STRVAR(_elementtree_Element_set__doc__, "\n"); #define _ELEMENTTREE_ELEMENT_SET_METHODDEF \ - {"set", (PyCFunction)_elementtree_Element_set, METH_FASTCALL, _elementtree_Element_set__doc__}, + {"set", (PyCFunction)(void(*)(void))_elementtree_Element_set, METH_FASTCALL, _elementtree_Element_set__doc__}, static PyObject * _elementtree_Element_set_impl(ElementObject *self, PyObject *key, @@ -607,7 +607,7 @@ PyDoc_STRVAR(_elementtree_TreeBuilder_start__doc__, "\n"); #define _ELEMENTTREE_TREEBUILDER_START_METHODDEF \ - {"start", (PyCFunction)_elementtree_TreeBuilder_start, METH_FASTCALL, _elementtree_TreeBuilder_start__doc__}, + {"start", (PyCFunction)(void(*)(void))_elementtree_TreeBuilder_start, METH_FASTCALL, _elementtree_TreeBuilder_start__doc__}, static PyObject * _elementtree_TreeBuilder_start_impl(TreeBuilderObject *self, PyObject *tag, @@ -693,7 +693,7 @@ PyDoc_STRVAR(_elementtree_XMLParser__setevents__doc__, "\n"); #define _ELEMENTTREE_XMLPARSER__SETEVENTS_METHODDEF \ - {"_setevents", (PyCFunction)_elementtree_XMLParser__setevents, METH_FASTCALL, _elementtree_XMLParser__setevents__doc__}, + {"_setevents", (PyCFunction)(void(*)(void))_elementtree_XMLParser__setevents, METH_FASTCALL, _elementtree_XMLParser__setevents__doc__}, static PyObject * _elementtree_XMLParser__setevents_impl(XMLParserObject *self, @@ -717,4 +717,4 @@ _elementtree_XMLParser__setevents(XMLParserObject *self, PyObject *const *args, exit: return return_value; } -/*[clinic end generated code: output=1bff22415aabb78b input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f1efdb511a5b027b input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_gdbmmodule.c.h b/Modules/clinic/_gdbmmodule.c.h index 7bdc4321df29..5edc440b181e 100644 --- a/Modules/clinic/_gdbmmodule.c.h +++ b/Modules/clinic/_gdbmmodule.c.h @@ -9,7 +9,7 @@ PyDoc_STRVAR(_gdbm_gdbm_get__doc__, "Get the value for key, or default if not present."); #define _GDBM_GDBM_GET_METHODDEF \ - {"get", (PyCFunction)_gdbm_gdbm_get, METH_FASTCALL, _gdbm_gdbm_get__doc__}, + {"get", (PyCFunction)(void(*)(void))_gdbm_gdbm_get, METH_FASTCALL, _gdbm_gdbm_get__doc__}, static PyObject * _gdbm_gdbm_get_impl(dbmobject *self, PyObject *key, PyObject *default_value); @@ -39,7 +39,7 @@ PyDoc_STRVAR(_gdbm_gdbm_setdefault__doc__, "Get value for key, or set it to default and return default if not present."); #define _GDBM_GDBM_SETDEFAULT_METHODDEF \ - {"setdefault", (PyCFunction)_gdbm_gdbm_setdefault, METH_FASTCALL, _gdbm_gdbm_setdefault__doc__}, + {"setdefault", (PyCFunction)(void(*)(void))_gdbm_gdbm_setdefault, METH_FASTCALL, _gdbm_gdbm_setdefault__doc__}, static PyObject * _gdbm_gdbm_setdefault_impl(dbmobject *self, PyObject *key, @@ -231,7 +231,7 @@ PyDoc_STRVAR(dbmopen__doc__, "when the database has to be created. It defaults to octal 0o666."); #define DBMOPEN_METHODDEF \ - {"open", (PyCFunction)dbmopen, METH_FASTCALL, dbmopen__doc__}, + {"open", (PyCFunction)(void(*)(void))dbmopen, METH_FASTCALL, dbmopen__doc__}, static PyObject * dbmopen_impl(PyObject *module, PyObject *filename, const char *flags, @@ -254,4 +254,4 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=dec05ff9c5aeaeae input=a9049054013a1b77]*/ +/*[clinic end generated code: output=5ca4361417bf96cb input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_hashopenssl.c.h b/Modules/clinic/_hashopenssl.c.h index 070f8290f26f..3dad45de6712 100644 --- a/Modules/clinic/_hashopenssl.c.h +++ b/Modules/clinic/_hashopenssl.c.h @@ -12,7 +12,7 @@ PyDoc_STRVAR(_hashlib_scrypt__doc__, "scrypt password-based key derivation function."); #define _HASHLIB_SCRYPT_METHODDEF \ - {"scrypt", (PyCFunction)_hashlib_scrypt, METH_FASTCALL|METH_KEYWORDS, _hashlib_scrypt__doc__}, + {"scrypt", (PyCFunction)(void(*)(void))_hashlib_scrypt, METH_FASTCALL|METH_KEYWORDS, _hashlib_scrypt__doc__}, static PyObject * _hashlib_scrypt_impl(PyObject *module, Py_buffer *password, Py_buffer *salt, @@ -61,7 +61,7 @@ PyDoc_STRVAR(_hashlib_hmac_digest__doc__, "Single-shot HMAC."); #define _HASHLIB_HMAC_DIGEST_METHODDEF \ - {"hmac_digest", (PyCFunction)_hashlib_hmac_digest, METH_FASTCALL|METH_KEYWORDS, _hashlib_hmac_digest__doc__}, + {"hmac_digest", (PyCFunction)(void(*)(void))_hashlib_hmac_digest, METH_FASTCALL|METH_KEYWORDS, _hashlib_hmac_digest__doc__}, static PyObject * _hashlib_hmac_digest_impl(PyObject *module, Py_buffer *key, Py_buffer *msg, @@ -99,4 +99,4 @@ _hashlib_hmac_digest(PyObject *module, PyObject *const *args, Py_ssize_t nargs, #ifndef _HASHLIB_SCRYPT_METHODDEF #define _HASHLIB_SCRYPT_METHODDEF #endif /* !defined(_HASHLIB_SCRYPT_METHODDEF) */ -/*[clinic end generated code: output=b129f1a6ec7b8503 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=acf668396f59f2b6 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_heapqmodule.c.h b/Modules/clinic/_heapqmodule.c.h index 5e346df241f0..0b5d0d7bbaba 100644 --- a/Modules/clinic/_heapqmodule.c.h +++ b/Modules/clinic/_heapqmodule.c.h @@ -9,7 +9,7 @@ PyDoc_STRVAR(_heapq_heappush__doc__, "Push item onto heap, maintaining the heap invariant."); #define _HEAPQ_HEAPPUSH_METHODDEF \ - {"heappush", (PyCFunction)_heapq_heappush, METH_FASTCALL, _heapq_heappush__doc__}, + {"heappush", (PyCFunction)(void(*)(void))_heapq_heappush, METH_FASTCALL, _heapq_heappush__doc__}, static PyObject * _heapq_heappush_impl(PyObject *module, PyObject *heap, PyObject *item); @@ -56,7 +56,7 @@ PyDoc_STRVAR(_heapq_heapreplace__doc__, " item = heapreplace(heap, item)"); #define _HEAPQ_HEAPREPLACE_METHODDEF \ - {"heapreplace", (PyCFunction)_heapq_heapreplace, METH_FASTCALL, _heapq_heapreplace__doc__}, + {"heapreplace", (PyCFunction)(void(*)(void))_heapq_heapreplace, METH_FASTCALL, _heapq_heapreplace__doc__}, static PyObject * _heapq_heapreplace_impl(PyObject *module, PyObject *heap, PyObject *item); @@ -89,7 +89,7 @@ PyDoc_STRVAR(_heapq_heappushpop__doc__, "a separate call to heappop()."); #define _HEAPQ_HEAPPUSHPOP_METHODDEF \ - {"heappushpop", (PyCFunction)_heapq_heappushpop, METH_FASTCALL, _heapq_heappushpop__doc__}, + {"heappushpop", (PyCFunction)(void(*)(void))_heapq_heappushpop, METH_FASTCALL, _heapq_heappushpop__doc__}, static PyObject * _heapq_heappushpop_impl(PyObject *module, PyObject *heap, PyObject *item); @@ -137,7 +137,7 @@ PyDoc_STRVAR(_heapq__heapreplace_max__doc__, "Maxheap variant of heapreplace."); #define _HEAPQ__HEAPREPLACE_MAX_METHODDEF \ - {"_heapreplace_max", (PyCFunction)_heapq__heapreplace_max, METH_FASTCALL, _heapq__heapreplace_max__doc__}, + {"_heapreplace_max", (PyCFunction)(void(*)(void))_heapq__heapreplace_max, METH_FASTCALL, _heapq__heapreplace_max__doc__}, static PyObject * _heapq__heapreplace_max_impl(PyObject *module, PyObject *heap, @@ -169,4 +169,4 @@ PyDoc_STRVAR(_heapq__heapify_max__doc__, #define _HEAPQ__HEAPIFY_MAX_METHODDEF \ {"_heapify_max", (PyCFunction)_heapq__heapify_max, METH_O, _heapq__heapify_max__doc__}, -/*[clinic end generated code: output=0bb0dd0df473ab14 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b73e874eeb9977b6 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_lzmamodule.c.h b/Modules/clinic/_lzmamodule.c.h index ed7eb5df0522..3e938c3cf1e2 100644 --- a/Modules/clinic/_lzmamodule.c.h +++ b/Modules/clinic/_lzmamodule.c.h @@ -81,7 +81,7 @@ PyDoc_STRVAR(_lzma_LZMADecompressor_decompress__doc__, "the unused_data attribute."); #define _LZMA_LZMADECOMPRESSOR_DECOMPRESS_METHODDEF \ - {"decompress", (PyCFunction)_lzma_LZMADecompressor_decompress, METH_FASTCALL|METH_KEYWORDS, _lzma_LZMADecompressor_decompress__doc__}, + {"decompress", (PyCFunction)(void(*)(void))_lzma_LZMADecompressor_decompress, METH_FASTCALL|METH_KEYWORDS, _lzma_LZMADecompressor_decompress__doc__}, static PyObject * _lzma_LZMADecompressor_decompress_impl(Decompressor *self, Py_buffer *data, @@ -229,7 +229,7 @@ PyDoc_STRVAR(_lzma__decode_filter_properties__doc__, "The result does not include the filter ID itself, only the options."); #define _LZMA__DECODE_FILTER_PROPERTIES_METHODDEF \ - {"_decode_filter_properties", (PyCFunction)_lzma__decode_filter_properties, METH_FASTCALL, _lzma__decode_filter_properties__doc__}, + {"_decode_filter_properties", (PyCFunction)(void(*)(void))_lzma__decode_filter_properties, METH_FASTCALL, _lzma__decode_filter_properties__doc__}, static PyObject * _lzma__decode_filter_properties_impl(PyObject *module, lzma_vli filter_id, @@ -256,4 +256,4 @@ _lzma__decode_filter_properties(PyObject *module, PyObject *const *args, Py_ssiz return return_value; } -/*[clinic end generated code: output=38c2d52362bf3712 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=2acfd7c4b68530a6 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_opcode.c.h b/Modules/clinic/_opcode.c.h index b162d84e5db4..2104a52915c4 100644 --- a/Modules/clinic/_opcode.c.h +++ b/Modules/clinic/_opcode.c.h @@ -9,7 +9,7 @@ PyDoc_STRVAR(_opcode_stack_effect__doc__, "Compute the stack effect of the opcode."); #define _OPCODE_STACK_EFFECT_METHODDEF \ - {"stack_effect", (PyCFunction)_opcode_stack_effect, METH_FASTCALL|METH_KEYWORDS, _opcode_stack_effect__doc__}, + {"stack_effect", (PyCFunction)(void(*)(void))_opcode_stack_effect, METH_FASTCALL|METH_KEYWORDS, _opcode_stack_effect__doc__}, static int _opcode_stack_effect_impl(PyObject *module, int opcode, PyObject *oparg, @@ -39,4 +39,4 @@ _opcode_stack_effect(PyObject *module, PyObject *const *args, Py_ssize_t nargs, exit: return return_value; } -/*[clinic end generated code: output=bbf6c4cfc91edc29 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=871941eea3d855c6 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_operator.c.h b/Modules/clinic/_operator.c.h index 9313f9524545..9d7b20c1cc0e 100644 --- a/Modules/clinic/_operator.c.h +++ b/Modules/clinic/_operator.c.h @@ -37,7 +37,7 @@ PyDoc_STRVAR(_operator_add__doc__, "Same as a + b."); #define _OPERATOR_ADD_METHODDEF \ - {"add", (PyCFunction)_operator_add, METH_FASTCALL, _operator_add__doc__}, + {"add", (PyCFunction)(void(*)(void))_operator_add, METH_FASTCALL, _operator_add__doc__}, static PyObject * _operator_add_impl(PyObject *module, PyObject *a, PyObject *b); @@ -67,7 +67,7 @@ PyDoc_STRVAR(_operator_sub__doc__, "Same as a - b."); #define _OPERATOR_SUB_METHODDEF \ - {"sub", (PyCFunction)_operator_sub, METH_FASTCALL, _operator_sub__doc__}, + {"sub", (PyCFunction)(void(*)(void))_operator_sub, METH_FASTCALL, _operator_sub__doc__}, static PyObject * _operator_sub_impl(PyObject *module, PyObject *a, PyObject *b); @@ -97,7 +97,7 @@ PyDoc_STRVAR(_operator_mul__doc__, "Same as a * b."); #define _OPERATOR_MUL_METHODDEF \ - {"mul", (PyCFunction)_operator_mul, METH_FASTCALL, _operator_mul__doc__}, + {"mul", (PyCFunction)(void(*)(void))_operator_mul, METH_FASTCALL, _operator_mul__doc__}, static PyObject * _operator_mul_impl(PyObject *module, PyObject *a, PyObject *b); @@ -127,7 +127,7 @@ PyDoc_STRVAR(_operator_matmul__doc__, "Same as a @ b."); #define _OPERATOR_MATMUL_METHODDEF \ - {"matmul", (PyCFunction)_operator_matmul, METH_FASTCALL, _operator_matmul__doc__}, + {"matmul", (PyCFunction)(void(*)(void))_operator_matmul, METH_FASTCALL, _operator_matmul__doc__}, static PyObject * _operator_matmul_impl(PyObject *module, PyObject *a, PyObject *b); @@ -157,7 +157,7 @@ PyDoc_STRVAR(_operator_floordiv__doc__, "Same as a // b."); #define _OPERATOR_FLOORDIV_METHODDEF \ - {"floordiv", (PyCFunction)_operator_floordiv, METH_FASTCALL, _operator_floordiv__doc__}, + {"floordiv", (PyCFunction)(void(*)(void))_operator_floordiv, METH_FASTCALL, _operator_floordiv__doc__}, static PyObject * _operator_floordiv_impl(PyObject *module, PyObject *a, PyObject *b); @@ -187,7 +187,7 @@ PyDoc_STRVAR(_operator_truediv__doc__, "Same as a / b."); #define _OPERATOR_TRUEDIV_METHODDEF \ - {"truediv", (PyCFunction)_operator_truediv, METH_FASTCALL, _operator_truediv__doc__}, + {"truediv", (PyCFunction)(void(*)(void))_operator_truediv, METH_FASTCALL, _operator_truediv__doc__}, static PyObject * _operator_truediv_impl(PyObject *module, PyObject *a, PyObject *b); @@ -217,7 +217,7 @@ PyDoc_STRVAR(_operator_mod__doc__, "Same as a % b."); #define _OPERATOR_MOD_METHODDEF \ - {"mod", (PyCFunction)_operator_mod, METH_FASTCALL, _operator_mod__doc__}, + {"mod", (PyCFunction)(void(*)(void))_operator_mod, METH_FASTCALL, _operator_mod__doc__}, static PyObject * _operator_mod_impl(PyObject *module, PyObject *a, PyObject *b); @@ -292,7 +292,7 @@ PyDoc_STRVAR(_operator_lshift__doc__, "Same as a << b."); #define _OPERATOR_LSHIFT_METHODDEF \ - {"lshift", (PyCFunction)_operator_lshift, METH_FASTCALL, _operator_lshift__doc__}, + {"lshift", (PyCFunction)(void(*)(void))_operator_lshift, METH_FASTCALL, _operator_lshift__doc__}, static PyObject * _operator_lshift_impl(PyObject *module, PyObject *a, PyObject *b); @@ -322,7 +322,7 @@ PyDoc_STRVAR(_operator_rshift__doc__, "Same as a >> b."); #define _OPERATOR_RSHIFT_METHODDEF \ - {"rshift", (PyCFunction)_operator_rshift, METH_FASTCALL, _operator_rshift__doc__}, + {"rshift", (PyCFunction)(void(*)(void))_operator_rshift, METH_FASTCALL, _operator_rshift__doc__}, static PyObject * _operator_rshift_impl(PyObject *module, PyObject *a, PyObject *b); @@ -380,7 +380,7 @@ PyDoc_STRVAR(_operator_and___doc__, "Same as a & b."); #define _OPERATOR_AND__METHODDEF \ - {"and_", (PyCFunction)_operator_and_, METH_FASTCALL, _operator_and___doc__}, + {"and_", (PyCFunction)(void(*)(void))_operator_and_, METH_FASTCALL, _operator_and___doc__}, static PyObject * _operator_and__impl(PyObject *module, PyObject *a, PyObject *b); @@ -410,7 +410,7 @@ PyDoc_STRVAR(_operator_xor__doc__, "Same as a ^ b."); #define _OPERATOR_XOR_METHODDEF \ - {"xor", (PyCFunction)_operator_xor, METH_FASTCALL, _operator_xor__doc__}, + {"xor", (PyCFunction)(void(*)(void))_operator_xor, METH_FASTCALL, _operator_xor__doc__}, static PyObject * _operator_xor_impl(PyObject *module, PyObject *a, PyObject *b); @@ -440,7 +440,7 @@ PyDoc_STRVAR(_operator_or___doc__, "Same as a | b."); #define _OPERATOR_OR__METHODDEF \ - {"or_", (PyCFunction)_operator_or_, METH_FASTCALL, _operator_or___doc__}, + {"or_", (PyCFunction)(void(*)(void))_operator_or_, METH_FASTCALL, _operator_or___doc__}, static PyObject * _operator_or__impl(PyObject *module, PyObject *a, PyObject *b); @@ -470,7 +470,7 @@ PyDoc_STRVAR(_operator_iadd__doc__, "Same as a += b."); #define _OPERATOR_IADD_METHODDEF \ - {"iadd", (PyCFunction)_operator_iadd, METH_FASTCALL, _operator_iadd__doc__}, + {"iadd", (PyCFunction)(void(*)(void))_operator_iadd, METH_FASTCALL, _operator_iadd__doc__}, static PyObject * _operator_iadd_impl(PyObject *module, PyObject *a, PyObject *b); @@ -500,7 +500,7 @@ PyDoc_STRVAR(_operator_isub__doc__, "Same as a -= b."); #define _OPERATOR_ISUB_METHODDEF \ - {"isub", (PyCFunction)_operator_isub, METH_FASTCALL, _operator_isub__doc__}, + {"isub", (PyCFunction)(void(*)(void))_operator_isub, METH_FASTCALL, _operator_isub__doc__}, static PyObject * _operator_isub_impl(PyObject *module, PyObject *a, PyObject *b); @@ -530,7 +530,7 @@ PyDoc_STRVAR(_operator_imul__doc__, "Same as a *= b."); #define _OPERATOR_IMUL_METHODDEF \ - {"imul", (PyCFunction)_operator_imul, METH_FASTCALL, _operator_imul__doc__}, + {"imul", (PyCFunction)(void(*)(void))_operator_imul, METH_FASTCALL, _operator_imul__doc__}, static PyObject * _operator_imul_impl(PyObject *module, PyObject *a, PyObject *b); @@ -560,7 +560,7 @@ PyDoc_STRVAR(_operator_imatmul__doc__, "Same as a @= b."); #define _OPERATOR_IMATMUL_METHODDEF \ - {"imatmul", (PyCFunction)_operator_imatmul, METH_FASTCALL, _operator_imatmul__doc__}, + {"imatmul", (PyCFunction)(void(*)(void))_operator_imatmul, METH_FASTCALL, _operator_imatmul__doc__}, static PyObject * _operator_imatmul_impl(PyObject *module, PyObject *a, PyObject *b); @@ -590,7 +590,7 @@ PyDoc_STRVAR(_operator_ifloordiv__doc__, "Same as a //= b."); #define _OPERATOR_IFLOORDIV_METHODDEF \ - {"ifloordiv", (PyCFunction)_operator_ifloordiv, METH_FASTCALL, _operator_ifloordiv__doc__}, + {"ifloordiv", (PyCFunction)(void(*)(void))_operator_ifloordiv, METH_FASTCALL, _operator_ifloordiv__doc__}, static PyObject * _operator_ifloordiv_impl(PyObject *module, PyObject *a, PyObject *b); @@ -620,7 +620,7 @@ PyDoc_STRVAR(_operator_itruediv__doc__, "Same as a /= b."); #define _OPERATOR_ITRUEDIV_METHODDEF \ - {"itruediv", (PyCFunction)_operator_itruediv, METH_FASTCALL, _operator_itruediv__doc__}, + {"itruediv", (PyCFunction)(void(*)(void))_operator_itruediv, METH_FASTCALL, _operator_itruediv__doc__}, static PyObject * _operator_itruediv_impl(PyObject *module, PyObject *a, PyObject *b); @@ -650,7 +650,7 @@ PyDoc_STRVAR(_operator_imod__doc__, "Same as a %= b."); #define _OPERATOR_IMOD_METHODDEF \ - {"imod", (PyCFunction)_operator_imod, METH_FASTCALL, _operator_imod__doc__}, + {"imod", (PyCFunction)(void(*)(void))_operator_imod, METH_FASTCALL, _operator_imod__doc__}, static PyObject * _operator_imod_impl(PyObject *module, PyObject *a, PyObject *b); @@ -680,7 +680,7 @@ PyDoc_STRVAR(_operator_ilshift__doc__, "Same as a <<= b."); #define _OPERATOR_ILSHIFT_METHODDEF \ - {"ilshift", (PyCFunction)_operator_ilshift, METH_FASTCALL, _operator_ilshift__doc__}, + {"ilshift", (PyCFunction)(void(*)(void))_operator_ilshift, METH_FASTCALL, _operator_ilshift__doc__}, static PyObject * _operator_ilshift_impl(PyObject *module, PyObject *a, PyObject *b); @@ -710,7 +710,7 @@ PyDoc_STRVAR(_operator_irshift__doc__, "Same as a >>= b."); #define _OPERATOR_IRSHIFT_METHODDEF \ - {"irshift", (PyCFunction)_operator_irshift, METH_FASTCALL, _operator_irshift__doc__}, + {"irshift", (PyCFunction)(void(*)(void))_operator_irshift, METH_FASTCALL, _operator_irshift__doc__}, static PyObject * _operator_irshift_impl(PyObject *module, PyObject *a, PyObject *b); @@ -740,7 +740,7 @@ PyDoc_STRVAR(_operator_iand__doc__, "Same as a &= b."); #define _OPERATOR_IAND_METHODDEF \ - {"iand", (PyCFunction)_operator_iand, METH_FASTCALL, _operator_iand__doc__}, + {"iand", (PyCFunction)(void(*)(void))_operator_iand, METH_FASTCALL, _operator_iand__doc__}, static PyObject * _operator_iand_impl(PyObject *module, PyObject *a, PyObject *b); @@ -770,7 +770,7 @@ PyDoc_STRVAR(_operator_ixor__doc__, "Same as a ^= b."); #define _OPERATOR_IXOR_METHODDEF \ - {"ixor", (PyCFunction)_operator_ixor, METH_FASTCALL, _operator_ixor__doc__}, + {"ixor", (PyCFunction)(void(*)(void))_operator_ixor, METH_FASTCALL, _operator_ixor__doc__}, static PyObject * _operator_ixor_impl(PyObject *module, PyObject *a, PyObject *b); @@ -800,7 +800,7 @@ PyDoc_STRVAR(_operator_ior__doc__, "Same as a |= b."); #define _OPERATOR_IOR_METHODDEF \ - {"ior", (PyCFunction)_operator_ior, METH_FASTCALL, _operator_ior__doc__}, + {"ior", (PyCFunction)(void(*)(void))_operator_ior, METH_FASTCALL, _operator_ior__doc__}, static PyObject * _operator_ior_impl(PyObject *module, PyObject *a, PyObject *b); @@ -830,7 +830,7 @@ PyDoc_STRVAR(_operator_concat__doc__, "Same as a + b, for a and b sequences."); #define _OPERATOR_CONCAT_METHODDEF \ - {"concat", (PyCFunction)_operator_concat, METH_FASTCALL, _operator_concat__doc__}, + {"concat", (PyCFunction)(void(*)(void))_operator_concat, METH_FASTCALL, _operator_concat__doc__}, static PyObject * _operator_concat_impl(PyObject *module, PyObject *a, PyObject *b); @@ -860,7 +860,7 @@ PyDoc_STRVAR(_operator_iconcat__doc__, "Same as a += b, for a and b sequences."); #define _OPERATOR_ICONCAT_METHODDEF \ - {"iconcat", (PyCFunction)_operator_iconcat, METH_FASTCALL, _operator_iconcat__doc__}, + {"iconcat", (PyCFunction)(void(*)(void))_operator_iconcat, METH_FASTCALL, _operator_iconcat__doc__}, static PyObject * _operator_iconcat_impl(PyObject *module, PyObject *a, PyObject *b); @@ -890,7 +890,7 @@ PyDoc_STRVAR(_operator_contains__doc__, "Same as b in a (note reversed operands)."); #define _OPERATOR_CONTAINS_METHODDEF \ - {"contains", (PyCFunction)_operator_contains, METH_FASTCALL, _operator_contains__doc__}, + {"contains", (PyCFunction)(void(*)(void))_operator_contains, METH_FASTCALL, _operator_contains__doc__}, static int _operator_contains_impl(PyObject *module, PyObject *a, PyObject *b); @@ -925,7 +925,7 @@ PyDoc_STRVAR(_operator_indexOf__doc__, "Return the first index of b in a."); #define _OPERATOR_INDEXOF_METHODDEF \ - {"indexOf", (PyCFunction)_operator_indexOf, METH_FASTCALL, _operator_indexOf__doc__}, + {"indexOf", (PyCFunction)(void(*)(void))_operator_indexOf, METH_FASTCALL, _operator_indexOf__doc__}, static Py_ssize_t _operator_indexOf_impl(PyObject *module, PyObject *a, PyObject *b); @@ -960,7 +960,7 @@ PyDoc_STRVAR(_operator_countOf__doc__, "Return the number of times b occurs in a."); #define _OPERATOR_COUNTOF_METHODDEF \ - {"countOf", (PyCFunction)_operator_countOf, METH_FASTCALL, _operator_countOf__doc__}, + {"countOf", (PyCFunction)(void(*)(void))_operator_countOf, METH_FASTCALL, _operator_countOf__doc__}, static Py_ssize_t _operator_countOf_impl(PyObject *module, PyObject *a, PyObject *b); @@ -995,7 +995,7 @@ PyDoc_STRVAR(_operator_getitem__doc__, "Same as a[b]."); #define _OPERATOR_GETITEM_METHODDEF \ - {"getitem", (PyCFunction)_operator_getitem, METH_FASTCALL, _operator_getitem__doc__}, + {"getitem", (PyCFunction)(void(*)(void))_operator_getitem, METH_FASTCALL, _operator_getitem__doc__}, static PyObject * _operator_getitem_impl(PyObject *module, PyObject *a, PyObject *b); @@ -1025,7 +1025,7 @@ PyDoc_STRVAR(_operator_setitem__doc__, "Same as a[b] = c."); #define _OPERATOR_SETITEM_METHODDEF \ - {"setitem", (PyCFunction)_operator_setitem, METH_FASTCALL, _operator_setitem__doc__}, + {"setitem", (PyCFunction)(void(*)(void))_operator_setitem, METH_FASTCALL, _operator_setitem__doc__}, static PyObject * _operator_setitem_impl(PyObject *module, PyObject *a, PyObject *b, @@ -1057,7 +1057,7 @@ PyDoc_STRVAR(_operator_delitem__doc__, "Same as del a[b]."); #define _OPERATOR_DELITEM_METHODDEF \ - {"delitem", (PyCFunction)_operator_delitem, METH_FASTCALL, _operator_delitem__doc__}, + {"delitem", (PyCFunction)(void(*)(void))_operator_delitem, METH_FASTCALL, _operator_delitem__doc__}, static PyObject * _operator_delitem_impl(PyObject *module, PyObject *a, PyObject *b); @@ -1087,7 +1087,7 @@ PyDoc_STRVAR(_operator_eq__doc__, "Same as a == b."); #define _OPERATOR_EQ_METHODDEF \ - {"eq", (PyCFunction)_operator_eq, METH_FASTCALL, _operator_eq__doc__}, + {"eq", (PyCFunction)(void(*)(void))_operator_eq, METH_FASTCALL, _operator_eq__doc__}, static PyObject * _operator_eq_impl(PyObject *module, PyObject *a, PyObject *b); @@ -1117,7 +1117,7 @@ PyDoc_STRVAR(_operator_ne__doc__, "Same as a != b."); #define _OPERATOR_NE_METHODDEF \ - {"ne", (PyCFunction)_operator_ne, METH_FASTCALL, _operator_ne__doc__}, + {"ne", (PyCFunction)(void(*)(void))_operator_ne, METH_FASTCALL, _operator_ne__doc__}, static PyObject * _operator_ne_impl(PyObject *module, PyObject *a, PyObject *b); @@ -1147,7 +1147,7 @@ PyDoc_STRVAR(_operator_lt__doc__, "Same as a < b."); #define _OPERATOR_LT_METHODDEF \ - {"lt", (PyCFunction)_operator_lt, METH_FASTCALL, _operator_lt__doc__}, + {"lt", (PyCFunction)(void(*)(void))_operator_lt, METH_FASTCALL, _operator_lt__doc__}, static PyObject * _operator_lt_impl(PyObject *module, PyObject *a, PyObject *b); @@ -1177,7 +1177,7 @@ PyDoc_STRVAR(_operator_le__doc__, "Same as a <= b."); #define _OPERATOR_LE_METHODDEF \ - {"le", (PyCFunction)_operator_le, METH_FASTCALL, _operator_le__doc__}, + {"le", (PyCFunction)(void(*)(void))_operator_le, METH_FASTCALL, _operator_le__doc__}, static PyObject * _operator_le_impl(PyObject *module, PyObject *a, PyObject *b); @@ -1207,7 +1207,7 @@ PyDoc_STRVAR(_operator_gt__doc__, "Same as a > b."); #define _OPERATOR_GT_METHODDEF \ - {"gt", (PyCFunction)_operator_gt, METH_FASTCALL, _operator_gt__doc__}, + {"gt", (PyCFunction)(void(*)(void))_operator_gt, METH_FASTCALL, _operator_gt__doc__}, static PyObject * _operator_gt_impl(PyObject *module, PyObject *a, PyObject *b); @@ -1237,7 +1237,7 @@ PyDoc_STRVAR(_operator_ge__doc__, "Same as a >= b."); #define _OPERATOR_GE_METHODDEF \ - {"ge", (PyCFunction)_operator_ge, METH_FASTCALL, _operator_ge__doc__}, + {"ge", (PyCFunction)(void(*)(void))_operator_ge, METH_FASTCALL, _operator_ge__doc__}, static PyObject * _operator_ge_impl(PyObject *module, PyObject *a, PyObject *b); @@ -1267,7 +1267,7 @@ PyDoc_STRVAR(_operator_pow__doc__, "Same as a ** b."); #define _OPERATOR_POW_METHODDEF \ - {"pow", (PyCFunction)_operator_pow, METH_FASTCALL, _operator_pow__doc__}, + {"pow", (PyCFunction)(void(*)(void))_operator_pow, METH_FASTCALL, _operator_pow__doc__}, static PyObject * _operator_pow_impl(PyObject *module, PyObject *a, PyObject *b); @@ -1297,7 +1297,7 @@ PyDoc_STRVAR(_operator_ipow__doc__, "Same as a **= b."); #define _OPERATOR_IPOW_METHODDEF \ - {"ipow", (PyCFunction)_operator_ipow, METH_FASTCALL, _operator_ipow__doc__}, + {"ipow", (PyCFunction)(void(*)(void))_operator_ipow, METH_FASTCALL, _operator_ipow__doc__}, static PyObject * _operator_ipow_impl(PyObject *module, PyObject *a, PyObject *b); @@ -1336,7 +1336,7 @@ PyDoc_STRVAR(_operator_is___doc__, "Same as a is b."); #define _OPERATOR_IS__METHODDEF \ - {"is_", (PyCFunction)_operator_is_, METH_FASTCALL, _operator_is___doc__}, + {"is_", (PyCFunction)(void(*)(void))_operator_is_, METH_FASTCALL, _operator_is___doc__}, static PyObject * _operator_is__impl(PyObject *module, PyObject *a, PyObject *b); @@ -1366,7 +1366,7 @@ PyDoc_STRVAR(_operator_is_not__doc__, "Same as a is not b."); #define _OPERATOR_IS_NOT_METHODDEF \ - {"is_not", (PyCFunction)_operator_is_not, METH_FASTCALL, _operator_is_not__doc__}, + {"is_not", (PyCFunction)(void(*)(void))_operator_is_not, METH_FASTCALL, _operator_is_not__doc__}, static PyObject * _operator_is_not_impl(PyObject *module, PyObject *a, PyObject *b); @@ -1402,7 +1402,7 @@ PyDoc_STRVAR(_operator_length_hint__doc__, "The result will be an integer >= 0."); #define _OPERATOR_LENGTH_HINT_METHODDEF \ - {"length_hint", (PyCFunction)_operator_length_hint, METH_FASTCALL, _operator_length_hint__doc__}, + {"length_hint", (PyCFunction)(void(*)(void))_operator_length_hint, METH_FASTCALL, _operator_length_hint__doc__}, static Py_ssize_t _operator_length_hint_impl(PyObject *module, PyObject *obj, @@ -1447,7 +1447,7 @@ PyDoc_STRVAR(_operator__compare_digest__doc__, "types and lengths of a and b--but not their values."); #define _OPERATOR__COMPARE_DIGEST_METHODDEF \ - {"_compare_digest", (PyCFunction)_operator__compare_digest, METH_FASTCALL, _operator__compare_digest__doc__}, + {"_compare_digest", (PyCFunction)(void(*)(void))_operator__compare_digest, METH_FASTCALL, _operator__compare_digest__doc__}, static PyObject * _operator__compare_digest_impl(PyObject *module, PyObject *a, PyObject *b); @@ -1469,4 +1469,4 @@ _operator__compare_digest(PyObject *module, PyObject *const *args, Py_ssize_t na exit: return return_value; } -/*[clinic end generated code: output=d840f7ea76af2372 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=424b884884ab20b7 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_pickle.c.h b/Modules/clinic/_pickle.c.h index 6d9072832cea..3f6be4bd8049 100644 --- a/Modules/clinic/_pickle.c.h +++ b/Modules/clinic/_pickle.c.h @@ -199,7 +199,7 @@ PyDoc_STRVAR(_pickle_Unpickler_find_class__doc__, "needed. Both arguments passed are str objects."); #define _PICKLE_UNPICKLER_FIND_CLASS_METHODDEF \ - {"find_class", (PyCFunction)_pickle_Unpickler_find_class, METH_FASTCALL, _pickle_Unpickler_find_class__doc__}, + {"find_class", (PyCFunction)(void(*)(void))_pickle_Unpickler_find_class, METH_FASTCALL, _pickle_Unpickler_find_class__doc__}, static PyObject * _pickle_Unpickler_find_class_impl(UnpicklerObject *self, @@ -385,7 +385,7 @@ PyDoc_STRVAR(_pickle_dump__doc__, "2, so that the pickle data stream is readable with Python 2."); #define _PICKLE_DUMP_METHODDEF \ - {"dump", (PyCFunction)_pickle_dump, METH_FASTCALL|METH_KEYWORDS, _pickle_dump__doc__}, + {"dump", (PyCFunction)(void(*)(void))_pickle_dump, METH_FASTCALL|METH_KEYWORDS, _pickle_dump__doc__}, static PyObject * _pickle_dump_impl(PyObject *module, PyObject *obj, PyObject *file, @@ -432,7 +432,7 @@ PyDoc_STRVAR(_pickle_dumps__doc__, "Python 2, so that the pickle data stream is readable with Python 2."); #define _PICKLE_DUMPS_METHODDEF \ - {"dumps", (PyCFunction)_pickle_dumps, METH_FASTCALL|METH_KEYWORDS, _pickle_dumps__doc__}, + {"dumps", (PyCFunction)(void(*)(void))_pickle_dumps, METH_FASTCALL|METH_KEYWORDS, _pickle_dumps__doc__}, static PyObject * _pickle_dumps_impl(PyObject *module, PyObject *obj, PyObject *protocol, @@ -488,7 +488,7 @@ PyDoc_STRVAR(_pickle_load__doc__, "string instances as bytes objects."); #define _PICKLE_LOAD_METHODDEF \ - {"load", (PyCFunction)_pickle_load, METH_FASTCALL|METH_KEYWORDS, _pickle_load__doc__}, + {"load", (PyCFunction)(void(*)(void))_pickle_load, METH_FASTCALL|METH_KEYWORDS, _pickle_load__doc__}, static PyObject * _pickle_load_impl(PyObject *module, PyObject *file, int fix_imports, @@ -536,7 +536,7 @@ PyDoc_STRVAR(_pickle_loads__doc__, "string instances as bytes objects."); #define _PICKLE_LOADS_METHODDEF \ - {"loads", (PyCFunction)_pickle_loads, METH_FASTCALL|METH_KEYWORDS, _pickle_loads__doc__}, + {"loads", (PyCFunction)(void(*)(void))_pickle_loads, METH_FASTCALL|METH_KEYWORDS, _pickle_loads__doc__}, static PyObject * _pickle_loads_impl(PyObject *module, PyObject *data, int fix_imports, @@ -562,4 +562,4 @@ _pickle_loads(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec exit: return return_value; } -/*[clinic end generated code: output=6fc104b8299c82dd input=a9049054013a1b77]*/ +/*[clinic end generated code: output=4b32d63ff58b64d8 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_queuemodule.c.h b/Modules/clinic/_queuemodule.c.h index 97247fd8a129..a19fe78e3a01 100644 --- a/Modules/clinic/_queuemodule.c.h +++ b/Modules/clinic/_queuemodule.c.h @@ -40,7 +40,7 @@ PyDoc_STRVAR(_queue_SimpleQueue_put__doc__, "never blocks. They are provided for compatibility with the Queue class."); #define _QUEUE_SIMPLEQUEUE_PUT_METHODDEF \ - {"put", (PyCFunction)_queue_SimpleQueue_put, METH_FASTCALL|METH_KEYWORDS, _queue_SimpleQueue_put__doc__}, + {"put", (PyCFunction)(void(*)(void))_queue_SimpleQueue_put, METH_FASTCALL|METH_KEYWORDS, _queue_SimpleQueue_put__doc__}, static PyObject * _queue_SimpleQueue_put_impl(simplequeueobject *self, PyObject *item, @@ -76,7 +76,7 @@ PyDoc_STRVAR(_queue_SimpleQueue_put_nowait__doc__, "for compatibility with the Queue class."); #define _QUEUE_SIMPLEQUEUE_PUT_NOWAIT_METHODDEF \ - {"put_nowait", (PyCFunction)_queue_SimpleQueue_put_nowait, METH_FASTCALL|METH_KEYWORDS, _queue_SimpleQueue_put_nowait__doc__}, + {"put_nowait", (PyCFunction)(void(*)(void))_queue_SimpleQueue_put_nowait, METH_FASTCALL|METH_KEYWORDS, _queue_SimpleQueue_put_nowait__doc__}, static PyObject * _queue_SimpleQueue_put_nowait_impl(simplequeueobject *self, PyObject *item); @@ -114,7 +114,7 @@ PyDoc_STRVAR(_queue_SimpleQueue_get__doc__, "in that case)."); #define _QUEUE_SIMPLEQUEUE_GET_METHODDEF \ - {"get", (PyCFunction)_queue_SimpleQueue_get, METH_FASTCALL|METH_KEYWORDS, _queue_SimpleQueue_get__doc__}, + {"get", (PyCFunction)(void(*)(void))_queue_SimpleQueue_get, METH_FASTCALL|METH_KEYWORDS, _queue_SimpleQueue_get__doc__}, static PyObject * _queue_SimpleQueue_get_impl(simplequeueobject *self, int block, @@ -215,4 +215,4 @@ _queue_SimpleQueue_qsize(simplequeueobject *self, PyObject *Py_UNUSED(ignored)) exit: return return_value; } -/*[clinic end generated code: output=8badc3bb85263689 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c12ce9050f153304 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_sre.c.h b/Modules/clinic/_sre.c.h index 2a7ca6bca1a0..fbc5ba44f0b9 100644 --- a/Modules/clinic/_sre.c.h +++ b/Modules/clinic/_sre.c.h @@ -160,7 +160,7 @@ PyDoc_STRVAR(_sre_SRE_Pattern_match__doc__, "Matches zero or more characters at the beginning of the string."); #define _SRE_SRE_PATTERN_MATCH_METHODDEF \ - {"match", (PyCFunction)_sre_SRE_Pattern_match, METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Pattern_match__doc__}, + {"match", (PyCFunction)(void(*)(void))_sre_SRE_Pattern_match, METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Pattern_match__doc__}, static PyObject * _sre_SRE_Pattern_match_impl(PatternObject *self, PyObject *string, @@ -193,7 +193,7 @@ PyDoc_STRVAR(_sre_SRE_Pattern_fullmatch__doc__, "Matches against all of the string."); #define _SRE_SRE_PATTERN_FULLMATCH_METHODDEF \ - {"fullmatch", (PyCFunction)_sre_SRE_Pattern_fullmatch, METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Pattern_fullmatch__doc__}, + {"fullmatch", (PyCFunction)(void(*)(void))_sre_SRE_Pattern_fullmatch, METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Pattern_fullmatch__doc__}, static PyObject * _sre_SRE_Pattern_fullmatch_impl(PatternObject *self, PyObject *string, @@ -228,7 +228,7 @@ PyDoc_STRVAR(_sre_SRE_Pattern_search__doc__, "Return None if no position in the string matches."); #define _SRE_SRE_PATTERN_SEARCH_METHODDEF \ - {"search", (PyCFunction)_sre_SRE_Pattern_search, METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Pattern_search__doc__}, + {"search", (PyCFunction)(void(*)(void))_sre_SRE_Pattern_search, METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Pattern_search__doc__}, static PyObject * _sre_SRE_Pattern_search_impl(PatternObject *self, PyObject *string, @@ -261,7 +261,7 @@ PyDoc_STRVAR(_sre_SRE_Pattern_findall__doc__, "Return a list of all non-overlapping matches of pattern in string."); #define _SRE_SRE_PATTERN_FINDALL_METHODDEF \ - {"findall", (PyCFunction)_sre_SRE_Pattern_findall, METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Pattern_findall__doc__}, + {"findall", (PyCFunction)(void(*)(void))_sre_SRE_Pattern_findall, METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Pattern_findall__doc__}, static PyObject * _sre_SRE_Pattern_findall_impl(PatternObject *self, PyObject *string, @@ -296,7 +296,7 @@ PyDoc_STRVAR(_sre_SRE_Pattern_finditer__doc__, "For each match, the iterator returns a match object."); #define _SRE_SRE_PATTERN_FINDITER_METHODDEF \ - {"finditer", (PyCFunction)_sre_SRE_Pattern_finditer, METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Pattern_finditer__doc__}, + {"finditer", (PyCFunction)(void(*)(void))_sre_SRE_Pattern_finditer, METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Pattern_finditer__doc__}, static PyObject * _sre_SRE_Pattern_finditer_impl(PatternObject *self, PyObject *string, @@ -328,7 +328,7 @@ PyDoc_STRVAR(_sre_SRE_Pattern_scanner__doc__, "\n"); #define _SRE_SRE_PATTERN_SCANNER_METHODDEF \ - {"scanner", (PyCFunction)_sre_SRE_Pattern_scanner, METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Pattern_scanner__doc__}, + {"scanner", (PyCFunction)(void(*)(void))_sre_SRE_Pattern_scanner, METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Pattern_scanner__doc__}, static PyObject * _sre_SRE_Pattern_scanner_impl(PatternObject *self, PyObject *string, @@ -361,7 +361,7 @@ PyDoc_STRVAR(_sre_SRE_Pattern_split__doc__, "Split string by the occurrences of pattern."); #define _SRE_SRE_PATTERN_SPLIT_METHODDEF \ - {"split", (PyCFunction)_sre_SRE_Pattern_split, METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Pattern_split__doc__}, + {"split", (PyCFunction)(void(*)(void))_sre_SRE_Pattern_split, METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Pattern_split__doc__}, static PyObject * _sre_SRE_Pattern_split_impl(PatternObject *self, PyObject *string, @@ -393,7 +393,7 @@ PyDoc_STRVAR(_sre_SRE_Pattern_sub__doc__, "Return the string obtained by replacing the leftmost non-overlapping occurrences of pattern in string by the replacement repl."); #define _SRE_SRE_PATTERN_SUB_METHODDEF \ - {"sub", (PyCFunction)_sre_SRE_Pattern_sub, METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Pattern_sub__doc__}, + {"sub", (PyCFunction)(void(*)(void))_sre_SRE_Pattern_sub, METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Pattern_sub__doc__}, static PyObject * _sre_SRE_Pattern_sub_impl(PatternObject *self, PyObject *repl, @@ -426,7 +426,7 @@ PyDoc_STRVAR(_sre_SRE_Pattern_subn__doc__, "Return the tuple (new_string, number_of_subs_made) found by replacing the leftmost non-overlapping occurrences of pattern with the replacement repl."); #define _SRE_SRE_PATTERN_SUBN_METHODDEF \ - {"subn", (PyCFunction)_sre_SRE_Pattern_subn, METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Pattern_subn__doc__}, + {"subn", (PyCFunction)(void(*)(void))_sre_SRE_Pattern_subn, METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Pattern_subn__doc__}, static PyObject * _sre_SRE_Pattern_subn_impl(PatternObject *self, PyObject *repl, @@ -484,7 +484,7 @@ PyDoc_STRVAR(_sre_compile__doc__, "\n"); #define _SRE_COMPILE_METHODDEF \ - {"compile", (PyCFunction)_sre_compile, METH_FASTCALL|METH_KEYWORDS, _sre_compile__doc__}, + {"compile", (PyCFunction)(void(*)(void))_sre_compile, METH_FASTCALL|METH_KEYWORDS, _sre_compile__doc__}, static PyObject * _sre_compile_impl(PyObject *module, PyObject *pattern, int flags, @@ -521,7 +521,7 @@ PyDoc_STRVAR(_sre_SRE_Match_expand__doc__, "Return the string obtained by doing backslash substitution on the string template, as done by the sub() method."); #define _SRE_SRE_MATCH_EXPAND_METHODDEF \ - {"expand", (PyCFunction)_sre_SRE_Match_expand, METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Match_expand__doc__}, + {"expand", (PyCFunction)(void(*)(void))_sre_SRE_Match_expand, METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Match_expand__doc__}, static PyObject * _sre_SRE_Match_expand_impl(MatchObject *self, PyObject *template); @@ -554,7 +554,7 @@ PyDoc_STRVAR(_sre_SRE_Match_groups__doc__, " Is used for groups that did not participate in the match."); #define _SRE_SRE_MATCH_GROUPS_METHODDEF \ - {"groups", (PyCFunction)_sre_SRE_Match_groups, METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Match_groups__doc__}, + {"groups", (PyCFunction)(void(*)(void))_sre_SRE_Match_groups, METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Match_groups__doc__}, static PyObject * _sre_SRE_Match_groups_impl(MatchObject *self, PyObject *default_value); @@ -587,7 +587,7 @@ PyDoc_STRVAR(_sre_SRE_Match_groupdict__doc__, " Is used for groups that did not participate in the match."); #define _SRE_SRE_MATCH_GROUPDICT_METHODDEF \ - {"groupdict", (PyCFunction)_sre_SRE_Match_groupdict, METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Match_groupdict__doc__}, + {"groupdict", (PyCFunction)(void(*)(void))_sre_SRE_Match_groupdict, METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Match_groupdict__doc__}, static PyObject * _sre_SRE_Match_groupdict_impl(MatchObject *self, PyObject *default_value); @@ -617,7 +617,7 @@ PyDoc_STRVAR(_sre_SRE_Match_start__doc__, "Return index of the start of the substring matched by group."); #define _SRE_SRE_MATCH_START_METHODDEF \ - {"start", (PyCFunction)_sre_SRE_Match_start, METH_FASTCALL, _sre_SRE_Match_start__doc__}, + {"start", (PyCFunction)(void(*)(void))_sre_SRE_Match_start, METH_FASTCALL, _sre_SRE_Match_start__doc__}, static Py_ssize_t _sre_SRE_Match_start_impl(MatchObject *self, PyObject *group); @@ -651,7 +651,7 @@ PyDoc_STRVAR(_sre_SRE_Match_end__doc__, "Return index of the end of the substring matched by group."); #define _SRE_SRE_MATCH_END_METHODDEF \ - {"end", (PyCFunction)_sre_SRE_Match_end, METH_FASTCALL, _sre_SRE_Match_end__doc__}, + {"end", (PyCFunction)(void(*)(void))_sre_SRE_Match_end, METH_FASTCALL, _sre_SRE_Match_end__doc__}, static Py_ssize_t _sre_SRE_Match_end_impl(MatchObject *self, PyObject *group); @@ -685,7 +685,7 @@ PyDoc_STRVAR(_sre_SRE_Match_span__doc__, "For match object m, return the 2-tuple (m.start(group), m.end(group))."); #define _SRE_SRE_MATCH_SPAN_METHODDEF \ - {"span", (PyCFunction)_sre_SRE_Match_span, METH_FASTCALL, _sre_SRE_Match_span__doc__}, + {"span", (PyCFunction)(void(*)(void))_sre_SRE_Match_span, METH_FASTCALL, _sre_SRE_Match_span__doc__}, static PyObject * _sre_SRE_Match_span_impl(MatchObject *self, PyObject *group); @@ -765,4 +765,4 @@ _sre_SRE_Scanner_search(ScannerObject *self, PyObject *Py_UNUSED(ignored)) { return _sre_SRE_Scanner_search_impl(self); } -/*[clinic end generated code: output=4b807104b65c1e0e input=a9049054013a1b77]*/ +/*[clinic end generated code: output=5edeca5ec36b5f34 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_ssl.c.h b/Modules/clinic/_ssl.c.h index 186e6432c2e3..82dc19781140 100644 --- a/Modules/clinic/_ssl.c.h +++ b/Modules/clinic/_ssl.c.h @@ -60,7 +60,7 @@ PyDoc_STRVAR(_ssl__SSLSocket_getpeercert__doc__, "return the certificate even if it wasn\'t validated."); #define _SSL__SSLSOCKET_GETPEERCERT_METHODDEF \ - {"getpeercert", (PyCFunction)_ssl__SSLSocket_getpeercert, METH_FASTCALL, _ssl__SSLSocket_getpeercert__doc__}, + {"getpeercert", (PyCFunction)(void(*)(void))_ssl__SSLSocket_getpeercert, METH_FASTCALL, _ssl__SSLSocket_getpeercert__doc__}, static PyObject * _ssl__SSLSocket_getpeercert_impl(PySSLSocket *self, int binary_mode); @@ -318,7 +318,7 @@ PyDoc_STRVAR(_ssl__SSLSocket_get_channel_binding__doc__, "Only \'tls-unique\' channel binding data from RFC 5929 is supported."); #define _SSL__SSLSOCKET_GET_CHANNEL_BINDING_METHODDEF \ - {"get_channel_binding", (PyCFunction)_ssl__SSLSocket_get_channel_binding, METH_FASTCALL|METH_KEYWORDS, _ssl__SSLSocket_get_channel_binding__doc__}, + {"get_channel_binding", (PyCFunction)(void(*)(void))_ssl__SSLSocket_get_channel_binding, METH_FASTCALL|METH_KEYWORDS, _ssl__SSLSocket_get_channel_binding__doc__}, static PyObject * _ssl__SSLSocket_get_channel_binding_impl(PySSLSocket *self, @@ -500,7 +500,7 @@ PyDoc_STRVAR(_ssl__SSLContext_load_cert_chain__doc__, "\n"); #define _SSL__SSLCONTEXT_LOAD_CERT_CHAIN_METHODDEF \ - {"load_cert_chain", (PyCFunction)_ssl__SSLContext_load_cert_chain, METH_FASTCALL|METH_KEYWORDS, _ssl__SSLContext_load_cert_chain__doc__}, + {"load_cert_chain", (PyCFunction)(void(*)(void))_ssl__SSLContext_load_cert_chain, METH_FASTCALL|METH_KEYWORDS, _ssl__SSLContext_load_cert_chain__doc__}, static PyObject * _ssl__SSLContext_load_cert_chain_impl(PySSLContext *self, PyObject *certfile, @@ -532,7 +532,7 @@ PyDoc_STRVAR(_ssl__SSLContext_load_verify_locations__doc__, "\n"); #define _SSL__SSLCONTEXT_LOAD_VERIFY_LOCATIONS_METHODDEF \ - {"load_verify_locations", (PyCFunction)_ssl__SSLContext_load_verify_locations, METH_FASTCALL|METH_KEYWORDS, _ssl__SSLContext_load_verify_locations__doc__}, + {"load_verify_locations", (PyCFunction)(void(*)(void))_ssl__SSLContext_load_verify_locations, METH_FASTCALL|METH_KEYWORDS, _ssl__SSLContext_load_verify_locations__doc__}, static PyObject * _ssl__SSLContext_load_verify_locations_impl(PySSLContext *self, @@ -575,7 +575,7 @@ PyDoc_STRVAR(_ssl__SSLContext__wrap_socket__doc__, "\n"); #define _SSL__SSLCONTEXT__WRAP_SOCKET_METHODDEF \ - {"_wrap_socket", (PyCFunction)_ssl__SSLContext__wrap_socket, METH_FASTCALL|METH_KEYWORDS, _ssl__SSLContext__wrap_socket__doc__}, + {"_wrap_socket", (PyCFunction)(void(*)(void))_ssl__SSLContext__wrap_socket, METH_FASTCALL|METH_KEYWORDS, _ssl__SSLContext__wrap_socket__doc__}, static PyObject * _ssl__SSLContext__wrap_socket_impl(PySSLContext *self, PyObject *sock, @@ -611,7 +611,7 @@ PyDoc_STRVAR(_ssl__SSLContext__wrap_bio__doc__, "\n"); #define _SSL__SSLCONTEXT__WRAP_BIO_METHODDEF \ - {"_wrap_bio", (PyCFunction)_ssl__SSLContext__wrap_bio, METH_FASTCALL|METH_KEYWORDS, _ssl__SSLContext__wrap_bio__doc__}, + {"_wrap_bio", (PyCFunction)(void(*)(void))_ssl__SSLContext__wrap_bio, METH_FASTCALL|METH_KEYWORDS, _ssl__SSLContext__wrap_bio__doc__}, static PyObject * _ssl__SSLContext__wrap_bio_impl(PySSLContext *self, PySSLMemoryBIO *incoming, @@ -725,7 +725,7 @@ PyDoc_STRVAR(_ssl__SSLContext_get_ca_certs__doc__, "been used at least once."); #define _SSL__SSLCONTEXT_GET_CA_CERTS_METHODDEF \ - {"get_ca_certs", (PyCFunction)_ssl__SSLContext_get_ca_certs, METH_FASTCALL|METH_KEYWORDS, _ssl__SSLContext_get_ca_certs__doc__}, + {"get_ca_certs", (PyCFunction)(void(*)(void))_ssl__SSLContext_get_ca_certs, METH_FASTCALL|METH_KEYWORDS, _ssl__SSLContext_get_ca_certs__doc__}, static PyObject * _ssl__SSLContext_get_ca_certs_impl(PySSLContext *self, int binary_form); @@ -782,7 +782,7 @@ PyDoc_STRVAR(_ssl_MemoryBIO_read__doc__, "distinguish between the two."); #define _SSL_MEMORYBIO_READ_METHODDEF \ - {"read", (PyCFunction)_ssl_MemoryBIO_read, METH_FASTCALL, _ssl_MemoryBIO_read__doc__}, + {"read", (PyCFunction)(void(*)(void))_ssl_MemoryBIO_read, METH_FASTCALL, _ssl_MemoryBIO_read__doc__}, static PyObject * _ssl_MemoryBIO_read_impl(PySSLMemoryBIO *self, int len); @@ -867,7 +867,7 @@ PyDoc_STRVAR(_ssl_RAND_add__doc__, "string. See RFC 4086."); #define _SSL_RAND_ADD_METHODDEF \ - {"RAND_add", (PyCFunction)_ssl_RAND_add, METH_FASTCALL, _ssl_RAND_add__doc__}, + {"RAND_add", (PyCFunction)(void(*)(void))_ssl_RAND_add, METH_FASTCALL, _ssl_RAND_add__doc__}, static PyObject * _ssl_RAND_add_impl(PyObject *module, Py_buffer *view, double entropy); @@ -1036,7 +1036,7 @@ PyDoc_STRVAR(_ssl_txt2obj__doc__, "long name are also matched."); #define _SSL_TXT2OBJ_METHODDEF \ - {"txt2obj", (PyCFunction)_ssl_txt2obj, METH_FASTCALL|METH_KEYWORDS, _ssl_txt2obj__doc__}, + {"txt2obj", (PyCFunction)(void(*)(void))_ssl_txt2obj, METH_FASTCALL|METH_KEYWORDS, _ssl_txt2obj__doc__}, static PyObject * _ssl_txt2obj_impl(PyObject *module, const char *txt, int name); @@ -1102,7 +1102,7 @@ PyDoc_STRVAR(_ssl_enum_certificates__doc__, "a set of OIDs or the boolean True."); #define _SSL_ENUM_CERTIFICATES_METHODDEF \ - {"enum_certificates", (PyCFunction)_ssl_enum_certificates, METH_FASTCALL|METH_KEYWORDS, _ssl_enum_certificates__doc__}, + {"enum_certificates", (PyCFunction)(void(*)(void))_ssl_enum_certificates, METH_FASTCALL|METH_KEYWORDS, _ssl_enum_certificates__doc__}, static PyObject * _ssl_enum_certificates_impl(PyObject *module, const char *store_name); @@ -1141,7 +1141,7 @@ PyDoc_STRVAR(_ssl_enum_crls__doc__, "X509_ASN_ENCODING or PKCS_7_ASN_ENCODING."); #define _SSL_ENUM_CRLS_METHODDEF \ - {"enum_crls", (PyCFunction)_ssl_enum_crls, METH_FASTCALL|METH_KEYWORDS, _ssl_enum_crls__doc__}, + {"enum_crls", (PyCFunction)(void(*)(void))_ssl_enum_crls, METH_FASTCALL|METH_KEYWORDS, _ssl_enum_crls__doc__}, static PyObject * _ssl_enum_crls_impl(PyObject *module, const char *store_name); @@ -1193,4 +1193,4 @@ _ssl_enum_crls(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje #ifndef _SSL_ENUM_CRLS_METHODDEF #define _SSL_ENUM_CRLS_METHODDEF #endif /* !defined(_SSL_ENUM_CRLS_METHODDEF) */ -/*[clinic end generated code: output=c4e73b70ac3618ba input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d87f783224be8fca input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_struct.c.h b/Modules/clinic/_struct.c.h index 2ecadfb1de97..b1fa067bdd3b 100644 --- a/Modules/clinic/_struct.c.h +++ b/Modules/clinic/_struct.c.h @@ -85,7 +85,7 @@ PyDoc_STRVAR(Struct_unpack_from__doc__, "See help(struct) for more on format strings."); #define STRUCT_UNPACK_FROM_METHODDEF \ - {"unpack_from", (PyCFunction)Struct_unpack_from, METH_FASTCALL|METH_KEYWORDS, Struct_unpack_from__doc__}, + {"unpack_from", (PyCFunction)(void(*)(void))Struct_unpack_from, METH_FASTCALL|METH_KEYWORDS, Struct_unpack_from__doc__}, static PyObject * Struct_unpack_from_impl(PyStructObject *self, Py_buffer *buffer, @@ -193,7 +193,7 @@ PyDoc_STRVAR(unpack__doc__, "See help(struct) for more on format strings."); #define UNPACK_METHODDEF \ - {"unpack", (PyCFunction)unpack, METH_FASTCALL, unpack__doc__}, + {"unpack", (PyCFunction)(void(*)(void))unpack, METH_FASTCALL, unpack__doc__}, static PyObject * unpack_impl(PyObject *module, PyStructObject *s_object, Py_buffer *buffer); @@ -233,7 +233,7 @@ PyDoc_STRVAR(unpack_from__doc__, "See help(struct) for more on format strings."); #define UNPACK_FROM_METHODDEF \ - {"unpack_from", (PyCFunction)unpack_from, METH_FASTCALL|METH_KEYWORDS, unpack_from__doc__}, + {"unpack_from", (PyCFunction)(void(*)(void))unpack_from, METH_FASTCALL|METH_KEYWORDS, unpack_from__doc__}, static PyObject * unpack_from_impl(PyObject *module, PyStructObject *s_object, @@ -278,7 +278,7 @@ PyDoc_STRVAR(iter_unpack__doc__, "Requires that the bytes length be a multiple of the format struct size."); #define ITER_UNPACK_METHODDEF \ - {"iter_unpack", (PyCFunction)iter_unpack, METH_FASTCALL, iter_unpack__doc__}, + {"iter_unpack", (PyCFunction)(void(*)(void))iter_unpack, METH_FASTCALL, iter_unpack__doc__}, static PyObject * iter_unpack_impl(PyObject *module, PyStructObject *s_object, @@ -303,4 +303,4 @@ iter_unpack(PyObject *module, PyObject *const *args, Py_ssize_t nargs) return return_value; } -/*[clinic end generated code: output=d79b009652ae0b89 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a73b0453174e4b51 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_tkinter.c.h b/Modules/clinic/_tkinter.c.h index a9dd73911b81..a09bc2d8ed3a 100644 --- a/Modules/clinic/_tkinter.c.h +++ b/Modules/clinic/_tkinter.c.h @@ -256,7 +256,7 @@ PyDoc_STRVAR(_tkinter_tkapp_createcommand__doc__, "\n"); #define _TKINTER_TKAPP_CREATECOMMAND_METHODDEF \ - {"createcommand", (PyCFunction)_tkinter_tkapp_createcommand, METH_FASTCALL, _tkinter_tkapp_createcommand__doc__}, + {"createcommand", (PyCFunction)(void(*)(void))_tkinter_tkapp_createcommand, METH_FASTCALL, _tkinter_tkapp_createcommand__doc__}, static PyObject * _tkinter_tkapp_createcommand_impl(TkappObject *self, const char *name, @@ -313,7 +313,7 @@ PyDoc_STRVAR(_tkinter_tkapp_createfilehandler__doc__, "\n"); #define _TKINTER_TKAPP_CREATEFILEHANDLER_METHODDEF \ - {"createfilehandler", (PyCFunction)_tkinter_tkapp_createfilehandler, METH_FASTCALL, _tkinter_tkapp_createfilehandler__doc__}, + {"createfilehandler", (PyCFunction)(void(*)(void))_tkinter_tkapp_createfilehandler, METH_FASTCALL, _tkinter_tkapp_createfilehandler__doc__}, static PyObject * _tkinter_tkapp_createfilehandler_impl(TkappObject *self, PyObject *file, @@ -374,7 +374,7 @@ PyDoc_STRVAR(_tkinter_tkapp_createtimerhandler__doc__, "\n"); #define _TKINTER_TKAPP_CREATETIMERHANDLER_METHODDEF \ - {"createtimerhandler", (PyCFunction)_tkinter_tkapp_createtimerhandler, METH_FASTCALL, _tkinter_tkapp_createtimerhandler__doc__}, + {"createtimerhandler", (PyCFunction)(void(*)(void))_tkinter_tkapp_createtimerhandler, METH_FASTCALL, _tkinter_tkapp_createtimerhandler__doc__}, static PyObject * _tkinter_tkapp_createtimerhandler_impl(TkappObject *self, int milliseconds, @@ -403,7 +403,7 @@ PyDoc_STRVAR(_tkinter_tkapp_mainloop__doc__, "\n"); #define _TKINTER_TKAPP_MAINLOOP_METHODDEF \ - {"mainloop", (PyCFunction)_tkinter_tkapp_mainloop, METH_FASTCALL, _tkinter_tkapp_mainloop__doc__}, + {"mainloop", (PyCFunction)(void(*)(void))_tkinter_tkapp_mainloop, METH_FASTCALL, _tkinter_tkapp_mainloop__doc__}, static PyObject * _tkinter_tkapp_mainloop_impl(TkappObject *self, int threshold); @@ -430,7 +430,7 @@ PyDoc_STRVAR(_tkinter_tkapp_dooneevent__doc__, "\n"); #define _TKINTER_TKAPP_DOONEEVENT_METHODDEF \ - {"dooneevent", (PyCFunction)_tkinter_tkapp_dooneevent, METH_FASTCALL, _tkinter_tkapp_dooneevent__doc__}, + {"dooneevent", (PyCFunction)(void(*)(void))_tkinter_tkapp_dooneevent, METH_FASTCALL, _tkinter_tkapp_dooneevent__doc__}, static PyObject * _tkinter_tkapp_dooneevent_impl(TkappObject *self, int flags); @@ -543,7 +543,7 @@ PyDoc_STRVAR(_tkinter_create__doc__, " if not None, then pass -use to wish"); #define _TKINTER_CREATE_METHODDEF \ - {"create", (PyCFunction)_tkinter_create, METH_FASTCALL, _tkinter_create__doc__}, + {"create", (PyCFunction)(void(*)(void))_tkinter_create, METH_FASTCALL, _tkinter_create__doc__}, static PyObject * _tkinter_create_impl(PyObject *module, const char *screenName, @@ -638,4 +638,4 @@ _tkinter_getbusywaitinterval(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF #define _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF #endif /* !defined(_TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF) */ -/*[clinic end generated code: output=eb3202e07db3dbb1 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a9d45a90cde94980 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_tracemalloc.c.h b/Modules/clinic/_tracemalloc.c.h index 2ad397072078..aa736ec2fd0c 100644 --- a/Modules/clinic/_tracemalloc.c.h +++ b/Modules/clinic/_tracemalloc.c.h @@ -84,7 +84,7 @@ PyDoc_STRVAR(_tracemalloc_start__doc__, "trace to nframe."); #define _TRACEMALLOC_START_METHODDEF \ - {"start", (PyCFunction)_tracemalloc_start, METH_FASTCALL, _tracemalloc_start__doc__}, + {"start", (PyCFunction)(void(*)(void))_tracemalloc_start, METH_FASTCALL, _tracemalloc_start__doc__}, static PyObject * _tracemalloc_start_impl(PyObject *module, int nframe); @@ -185,4 +185,4 @@ _tracemalloc_get_traced_memory(PyObject *module, PyObject *Py_UNUSED(ignored)) { return _tracemalloc_get_traced_memory_impl(module); } -/*[clinic end generated code: output=d98afded69c89d52 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d4a2dd3eaba9f72d input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_weakref.c.h b/Modules/clinic/_weakref.c.h index 1c3aea13ef8d..21f00ffd205c 100644 --- a/Modules/clinic/_weakref.c.h +++ b/Modules/clinic/_weakref.c.h @@ -37,7 +37,7 @@ PyDoc_STRVAR(_weakref__remove_dead_weakref__doc__, "Atomically remove key from dict if it points to a dead weakref."); #define _WEAKREF__REMOVE_DEAD_WEAKREF_METHODDEF \ - {"_remove_dead_weakref", (PyCFunction)_weakref__remove_dead_weakref, METH_FASTCALL, _weakref__remove_dead_weakref__doc__}, + {"_remove_dead_weakref", (PyCFunction)(void(*)(void))_weakref__remove_dead_weakref, METH_FASTCALL, _weakref__remove_dead_weakref__doc__}, static PyObject * _weakref__remove_dead_weakref_impl(PyObject *module, PyObject *dct, @@ -59,4 +59,4 @@ _weakref__remove_dead_weakref(PyObject *module, PyObject *const *args, Py_ssize_ exit: return return_value; } -/*[clinic end generated code: output=b6a61a4f365a3f0a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=927e889feb8a7dc4 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_winapi.c.h b/Modules/clinic/_winapi.c.h index c66522ebab6d..f82b46d7381c 100644 --- a/Modules/clinic/_winapi.c.h +++ b/Modules/clinic/_winapi.c.h @@ -95,7 +95,7 @@ PyDoc_STRVAR(_winapi_ConnectNamedPipe__doc__, "\n"); #define _WINAPI_CONNECTNAMEDPIPE_METHODDEF \ - {"ConnectNamedPipe", (PyCFunction)_winapi_ConnectNamedPipe, METH_FASTCALL|METH_KEYWORDS, _winapi_ConnectNamedPipe__doc__}, + {"ConnectNamedPipe", (PyCFunction)(void(*)(void))_winapi_ConnectNamedPipe, METH_FASTCALL|METH_KEYWORDS, _winapi_ConnectNamedPipe__doc__}, static PyObject * _winapi_ConnectNamedPipe_impl(PyObject *module, HANDLE handle, @@ -128,7 +128,7 @@ PyDoc_STRVAR(_winapi_CreateFile__doc__, "\n"); #define _WINAPI_CREATEFILE_METHODDEF \ - {"CreateFile", (PyCFunction)_winapi_CreateFile, METH_FASTCALL, _winapi_CreateFile__doc__}, + {"CreateFile", (PyCFunction)(void(*)(void))_winapi_CreateFile, METH_FASTCALL, _winapi_CreateFile__doc__}, static HANDLE _winapi_CreateFile_impl(PyObject *module, LPCTSTR file_name, @@ -173,7 +173,7 @@ PyDoc_STRVAR(_winapi_CreateJunction__doc__, "\n"); #define _WINAPI_CREATEJUNCTION_METHODDEF \ - {"CreateJunction", (PyCFunction)_winapi_CreateJunction, METH_FASTCALL, _winapi_CreateJunction__doc__}, + {"CreateJunction", (PyCFunction)(void(*)(void))_winapi_CreateJunction, METH_FASTCALL, _winapi_CreateJunction__doc__}, static PyObject * _winapi_CreateJunction_impl(PyObject *module, LPWSTR src_path, @@ -204,7 +204,7 @@ PyDoc_STRVAR(_winapi_CreateNamedPipe__doc__, "\n"); #define _WINAPI_CREATENAMEDPIPE_METHODDEF \ - {"CreateNamedPipe", (PyCFunction)_winapi_CreateNamedPipe, METH_FASTCALL, _winapi_CreateNamedPipe__doc__}, + {"CreateNamedPipe", (PyCFunction)(void(*)(void))_winapi_CreateNamedPipe, METH_FASTCALL, _winapi_CreateNamedPipe__doc__}, static HANDLE _winapi_CreateNamedPipe_impl(PyObject *module, LPCTSTR name, DWORD open_mode, @@ -256,7 +256,7 @@ PyDoc_STRVAR(_winapi_CreatePipe__doc__, "Returns a 2-tuple of handles, to the read and write ends of the pipe."); #define _WINAPI_CREATEPIPE_METHODDEF \ - {"CreatePipe", (PyCFunction)_winapi_CreatePipe, METH_FASTCALL, _winapi_CreatePipe__doc__}, + {"CreatePipe", (PyCFunction)(void(*)(void))_winapi_CreatePipe, METH_FASTCALL, _winapi_CreatePipe__doc__}, static PyObject * _winapi_CreatePipe_impl(PyObject *module, PyObject *pipe_attrs, DWORD size); @@ -295,7 +295,7 @@ PyDoc_STRVAR(_winapi_CreateProcess__doc__, "process ID, and thread ID."); #define _WINAPI_CREATEPROCESS_METHODDEF \ - {"CreateProcess", (PyCFunction)_winapi_CreateProcess, METH_FASTCALL, _winapi_CreateProcess__doc__}, + {"CreateProcess", (PyCFunction)(void(*)(void))_winapi_CreateProcess, METH_FASTCALL, _winapi_CreateProcess__doc__}, static PyObject * _winapi_CreateProcess_impl(PyObject *module, Py_UNICODE *application_name, @@ -342,7 +342,7 @@ PyDoc_STRVAR(_winapi_DuplicateHandle__doc__, "through both handles."); #define _WINAPI_DUPLICATEHANDLE_METHODDEF \ - {"DuplicateHandle", (PyCFunction)_winapi_DuplicateHandle, METH_FASTCALL, _winapi_DuplicateHandle__doc__}, + {"DuplicateHandle", (PyCFunction)(void(*)(void))_winapi_DuplicateHandle, METH_FASTCALL, _winapi_DuplicateHandle__doc__}, static HANDLE _winapi_DuplicateHandle_impl(PyObject *module, HANDLE source_process_handle, @@ -604,7 +604,7 @@ PyDoc_STRVAR(_winapi_OpenProcess__doc__, "\n"); #define _WINAPI_OPENPROCESS_METHODDEF \ - {"OpenProcess", (PyCFunction)_winapi_OpenProcess, METH_FASTCALL, _winapi_OpenProcess__doc__}, + {"OpenProcess", (PyCFunction)(void(*)(void))_winapi_OpenProcess, METH_FASTCALL, _winapi_OpenProcess__doc__}, static HANDLE _winapi_OpenProcess_impl(PyObject *module, DWORD desired_access, @@ -642,7 +642,7 @@ PyDoc_STRVAR(_winapi_PeekNamedPipe__doc__, "\n"); #define _WINAPI_PEEKNAMEDPIPE_METHODDEF \ - {"PeekNamedPipe", (PyCFunction)_winapi_PeekNamedPipe, METH_FASTCALL, _winapi_PeekNamedPipe__doc__}, + {"PeekNamedPipe", (PyCFunction)(void(*)(void))_winapi_PeekNamedPipe, METH_FASTCALL, _winapi_PeekNamedPipe__doc__}, static PyObject * _winapi_PeekNamedPipe_impl(PyObject *module, HANDLE handle, int size); @@ -670,7 +670,7 @@ PyDoc_STRVAR(_winapi_ReadFile__doc__, "\n"); #define _WINAPI_READFILE_METHODDEF \ - {"ReadFile", (PyCFunction)_winapi_ReadFile, METH_FASTCALL|METH_KEYWORDS, _winapi_ReadFile__doc__}, + {"ReadFile", (PyCFunction)(void(*)(void))_winapi_ReadFile, METH_FASTCALL|METH_KEYWORDS, _winapi_ReadFile__doc__}, static PyObject * _winapi_ReadFile_impl(PyObject *module, HANDLE handle, DWORD size, @@ -703,7 +703,7 @@ PyDoc_STRVAR(_winapi_SetNamedPipeHandleState__doc__, "\n"); #define _WINAPI_SETNAMEDPIPEHANDLESTATE_METHODDEF \ - {"SetNamedPipeHandleState", (PyCFunction)_winapi_SetNamedPipeHandleState, METH_FASTCALL, _winapi_SetNamedPipeHandleState__doc__}, + {"SetNamedPipeHandleState", (PyCFunction)(void(*)(void))_winapi_SetNamedPipeHandleState, METH_FASTCALL, _winapi_SetNamedPipeHandleState__doc__}, static PyObject * _winapi_SetNamedPipeHandleState_impl(PyObject *module, HANDLE named_pipe, @@ -737,7 +737,7 @@ PyDoc_STRVAR(_winapi_TerminateProcess__doc__, "Terminate the specified process and all of its threads."); #define _WINAPI_TERMINATEPROCESS_METHODDEF \ - {"TerminateProcess", (PyCFunction)_winapi_TerminateProcess, METH_FASTCALL, _winapi_TerminateProcess__doc__}, + {"TerminateProcess", (PyCFunction)(void(*)(void))_winapi_TerminateProcess, METH_FASTCALL, _winapi_TerminateProcess__doc__}, static PyObject * _winapi_TerminateProcess_impl(PyObject *module, HANDLE handle, @@ -766,7 +766,7 @@ PyDoc_STRVAR(_winapi_WaitNamedPipe__doc__, "\n"); #define _WINAPI_WAITNAMEDPIPE_METHODDEF \ - {"WaitNamedPipe", (PyCFunction)_winapi_WaitNamedPipe, METH_FASTCALL, _winapi_WaitNamedPipe__doc__}, + {"WaitNamedPipe", (PyCFunction)(void(*)(void))_winapi_WaitNamedPipe, METH_FASTCALL, _winapi_WaitNamedPipe__doc__}, static PyObject * _winapi_WaitNamedPipe_impl(PyObject *module, LPCTSTR name, DWORD timeout); @@ -795,7 +795,7 @@ PyDoc_STRVAR(_winapi_WaitForMultipleObjects__doc__, "\n"); #define _WINAPI_WAITFORMULTIPLEOBJECTS_METHODDEF \ - {"WaitForMultipleObjects", (PyCFunction)_winapi_WaitForMultipleObjects, METH_FASTCALL, _winapi_WaitForMultipleObjects__doc__}, + {"WaitForMultipleObjects", (PyCFunction)(void(*)(void))_winapi_WaitForMultipleObjects, METH_FASTCALL, _winapi_WaitForMultipleObjects__doc__}, static PyObject * _winapi_WaitForMultipleObjects_impl(PyObject *module, PyObject *handle_seq, @@ -830,7 +830,7 @@ PyDoc_STRVAR(_winapi_WaitForSingleObject__doc__, "in milliseconds."); #define _WINAPI_WAITFORSINGLEOBJECT_METHODDEF \ - {"WaitForSingleObject", (PyCFunction)_winapi_WaitForSingleObject, METH_FASTCALL, _winapi_WaitForSingleObject__doc__}, + {"WaitForSingleObject", (PyCFunction)(void(*)(void))_winapi_WaitForSingleObject, METH_FASTCALL, _winapi_WaitForSingleObject__doc__}, static long _winapi_WaitForSingleObject_impl(PyObject *module, HANDLE handle, @@ -864,7 +864,7 @@ PyDoc_STRVAR(_winapi_WriteFile__doc__, "\n"); #define _WINAPI_WRITEFILE_METHODDEF \ - {"WriteFile", (PyCFunction)_winapi_WriteFile, METH_FASTCALL|METH_KEYWORDS, _winapi_WriteFile__doc__}, + {"WriteFile", (PyCFunction)(void(*)(void))_winapi_WriteFile, METH_FASTCALL|METH_KEYWORDS, _winapi_WriteFile__doc__}, static PyObject * _winapi_WriteFile_impl(PyObject *module, HANDLE handle, PyObject *buffer, @@ -914,7 +914,7 @@ PyDoc_STRVAR(_winapi_GetFileType__doc__, "\n"); #define _WINAPI_GETFILETYPE_METHODDEF \ - {"GetFileType", (PyCFunction)_winapi_GetFileType, METH_FASTCALL|METH_KEYWORDS, _winapi_GetFileType__doc__}, + {"GetFileType", (PyCFunction)(void(*)(void))_winapi_GetFileType, METH_FASTCALL|METH_KEYWORDS, _winapi_GetFileType__doc__}, static DWORD _winapi_GetFileType_impl(PyObject *module, HANDLE handle); @@ -941,4 +941,4 @@ _winapi_GetFileType(PyObject *module, PyObject *const *args, Py_ssize_t nargs, P exit: return return_value; } -/*[clinic end generated code: output=baaf3d379b91be0a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=915dd640329de0c0 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/arraymodule.c.h b/Modules/clinic/arraymodule.c.h index b03a507914a8..aa9938868f41 100644 --- a/Modules/clinic/arraymodule.c.h +++ b/Modules/clinic/arraymodule.c.h @@ -65,7 +65,7 @@ PyDoc_STRVAR(array_array_pop__doc__, "i defaults to -1."); #define ARRAY_ARRAY_POP_METHODDEF \ - {"pop", (PyCFunction)array_array_pop, METH_FASTCALL, array_array_pop__doc__}, + {"pop", (PyCFunction)(void(*)(void))array_array_pop, METH_FASTCALL, array_array_pop__doc__}, static PyObject * array_array_pop_impl(arrayobject *self, Py_ssize_t i); @@ -102,7 +102,7 @@ PyDoc_STRVAR(array_array_insert__doc__, "Insert a new item v into the array before position i."); #define ARRAY_ARRAY_INSERT_METHODDEF \ - {"insert", (PyCFunction)array_array_insert, METH_FASTCALL, array_array_insert__doc__}, + {"insert", (PyCFunction)(void(*)(void))array_array_insert, METH_FASTCALL, array_array_insert__doc__}, static PyObject * array_array_insert_impl(arrayobject *self, Py_ssize_t i, PyObject *v); @@ -200,7 +200,7 @@ PyDoc_STRVAR(array_array_fromfile__doc__, "Read n objects from the file object f and append them to the end of the array."); #define ARRAY_ARRAY_FROMFILE_METHODDEF \ - {"fromfile", (PyCFunction)array_array_fromfile, METH_FASTCALL, array_array_fromfile__doc__}, + {"fromfile", (PyCFunction)(void(*)(void))array_array_fromfile, METH_FASTCALL, array_array_fromfile__doc__}, static PyObject * array_array_fromfile_impl(arrayobject *self, PyObject *f, Py_ssize_t n); @@ -443,7 +443,7 @@ PyDoc_STRVAR(array__array_reconstructor__doc__, "Internal. Used for pickling support."); #define ARRAY__ARRAY_RECONSTRUCTOR_METHODDEF \ - {"_array_reconstructor", (PyCFunction)array__array_reconstructor, METH_FASTCALL, array__array_reconstructor__doc__}, + {"_array_reconstructor", (PyCFunction)(void(*)(void))array__array_reconstructor, METH_FASTCALL, array__array_reconstructor__doc__}, static PyObject * array__array_reconstructor_impl(PyObject *module, PyTypeObject *arraytype, @@ -505,4 +505,4 @@ PyDoc_STRVAR(array_arrayiterator___setstate____doc__, #define ARRAY_ARRAYITERATOR___SETSTATE___METHODDEF \ {"__setstate__", (PyCFunction)array_arrayiterator___setstate__, METH_O, array_arrayiterator___setstate____doc__}, -/*[clinic end generated code: output=1289bde2a095a712 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3a4c6f3deb597bfd input=a9049054013a1b77]*/ diff --git a/Modules/clinic/audioop.c.h b/Modules/clinic/audioop.c.h index cc8d818e1d8d..1eae9aaf5d80 100644 --- a/Modules/clinic/audioop.c.h +++ b/Modules/clinic/audioop.c.h @@ -9,7 +9,7 @@ PyDoc_STRVAR(audioop_getsample__doc__, "Return the value of sample index from the fragment."); #define AUDIOOP_GETSAMPLE_METHODDEF \ - {"getsample", (PyCFunction)audioop_getsample, METH_FASTCALL, audioop_getsample__doc__}, + {"getsample", (PyCFunction)(void(*)(void))audioop_getsample, METH_FASTCALL, audioop_getsample__doc__}, static PyObject * audioop_getsample_impl(PyObject *module, Py_buffer *fragment, int width, @@ -45,7 +45,7 @@ PyDoc_STRVAR(audioop_max__doc__, "Return the maximum of the absolute value of all samples in a fragment."); #define AUDIOOP_MAX_METHODDEF \ - {"max", (PyCFunction)audioop_max, METH_FASTCALL, audioop_max__doc__}, + {"max", (PyCFunction)(void(*)(void))audioop_max, METH_FASTCALL, audioop_max__doc__}, static PyObject * audioop_max_impl(PyObject *module, Py_buffer *fragment, int width); @@ -79,7 +79,7 @@ PyDoc_STRVAR(audioop_minmax__doc__, "Return the minimum and maximum values of all samples in the sound fragment."); #define AUDIOOP_MINMAX_METHODDEF \ - {"minmax", (PyCFunction)audioop_minmax, METH_FASTCALL, audioop_minmax__doc__}, + {"minmax", (PyCFunction)(void(*)(void))audioop_minmax, METH_FASTCALL, audioop_minmax__doc__}, static PyObject * audioop_minmax_impl(PyObject *module, Py_buffer *fragment, int width); @@ -113,7 +113,7 @@ PyDoc_STRVAR(audioop_avg__doc__, "Return the average over all samples in the fragment."); #define AUDIOOP_AVG_METHODDEF \ - {"avg", (PyCFunction)audioop_avg, METH_FASTCALL, audioop_avg__doc__}, + {"avg", (PyCFunction)(void(*)(void))audioop_avg, METH_FASTCALL, audioop_avg__doc__}, static PyObject * audioop_avg_impl(PyObject *module, Py_buffer *fragment, int width); @@ -147,7 +147,7 @@ PyDoc_STRVAR(audioop_rms__doc__, "Return the root-mean-square of the fragment, i.e. sqrt(sum(S_i^2)/n)."); #define AUDIOOP_RMS_METHODDEF \ - {"rms", (PyCFunction)audioop_rms, METH_FASTCALL, audioop_rms__doc__}, + {"rms", (PyCFunction)(void(*)(void))audioop_rms, METH_FASTCALL, audioop_rms__doc__}, static PyObject * audioop_rms_impl(PyObject *module, Py_buffer *fragment, int width); @@ -181,7 +181,7 @@ PyDoc_STRVAR(audioop_findfit__doc__, "Try to match reference as well as possible to a portion of fragment."); #define AUDIOOP_FINDFIT_METHODDEF \ - {"findfit", (PyCFunction)audioop_findfit, METH_FASTCALL, audioop_findfit__doc__}, + {"findfit", (PyCFunction)(void(*)(void))audioop_findfit, METH_FASTCALL, audioop_findfit__doc__}, static PyObject * audioop_findfit_impl(PyObject *module, Py_buffer *fragment, @@ -220,7 +220,7 @@ PyDoc_STRVAR(audioop_findfactor__doc__, "Return a factor F such that rms(add(fragment, mul(reference, -F))) is minimal."); #define AUDIOOP_FINDFACTOR_METHODDEF \ - {"findfactor", (PyCFunction)audioop_findfactor, METH_FASTCALL, audioop_findfactor__doc__}, + {"findfactor", (PyCFunction)(void(*)(void))audioop_findfactor, METH_FASTCALL, audioop_findfactor__doc__}, static PyObject * audioop_findfactor_impl(PyObject *module, Py_buffer *fragment, @@ -259,7 +259,7 @@ PyDoc_STRVAR(audioop_findmax__doc__, "Search fragment for a slice of specified number of samples with maximum energy."); #define AUDIOOP_FINDMAX_METHODDEF \ - {"findmax", (PyCFunction)audioop_findmax, METH_FASTCALL, audioop_findmax__doc__}, + {"findmax", (PyCFunction)(void(*)(void))audioop_findmax, METH_FASTCALL, audioop_findmax__doc__}, static PyObject * audioop_findmax_impl(PyObject *module, Py_buffer *fragment, @@ -294,7 +294,7 @@ PyDoc_STRVAR(audioop_avgpp__doc__, "Return the average peak-peak value over all samples in the fragment."); #define AUDIOOP_AVGPP_METHODDEF \ - {"avgpp", (PyCFunction)audioop_avgpp, METH_FASTCALL, audioop_avgpp__doc__}, + {"avgpp", (PyCFunction)(void(*)(void))audioop_avgpp, METH_FASTCALL, audioop_avgpp__doc__}, static PyObject * audioop_avgpp_impl(PyObject *module, Py_buffer *fragment, int width); @@ -328,7 +328,7 @@ PyDoc_STRVAR(audioop_maxpp__doc__, "Return the maximum peak-peak value in the sound fragment."); #define AUDIOOP_MAXPP_METHODDEF \ - {"maxpp", (PyCFunction)audioop_maxpp, METH_FASTCALL, audioop_maxpp__doc__}, + {"maxpp", (PyCFunction)(void(*)(void))audioop_maxpp, METH_FASTCALL, audioop_maxpp__doc__}, static PyObject * audioop_maxpp_impl(PyObject *module, Py_buffer *fragment, int width); @@ -362,7 +362,7 @@ PyDoc_STRVAR(audioop_cross__doc__, "Return the number of zero crossings in the fragment passed as an argument."); #define AUDIOOP_CROSS_METHODDEF \ - {"cross", (PyCFunction)audioop_cross, METH_FASTCALL, audioop_cross__doc__}, + {"cross", (PyCFunction)(void(*)(void))audioop_cross, METH_FASTCALL, audioop_cross__doc__}, static PyObject * audioop_cross_impl(PyObject *module, Py_buffer *fragment, int width); @@ -396,7 +396,7 @@ PyDoc_STRVAR(audioop_mul__doc__, "Return a fragment that has all samples in the original fragment multiplied by the floating-point value factor."); #define AUDIOOP_MUL_METHODDEF \ - {"mul", (PyCFunction)audioop_mul, METH_FASTCALL, audioop_mul__doc__}, + {"mul", (PyCFunction)(void(*)(void))audioop_mul, METH_FASTCALL, audioop_mul__doc__}, static PyObject * audioop_mul_impl(PyObject *module, Py_buffer *fragment, int width, @@ -432,7 +432,7 @@ PyDoc_STRVAR(audioop_tomono__doc__, "Convert a stereo fragment to a mono fragment."); #define AUDIOOP_TOMONO_METHODDEF \ - {"tomono", (PyCFunction)audioop_tomono, METH_FASTCALL, audioop_tomono__doc__}, + {"tomono", (PyCFunction)(void(*)(void))audioop_tomono, METH_FASTCALL, audioop_tomono__doc__}, static PyObject * audioop_tomono_impl(PyObject *module, Py_buffer *fragment, int width, @@ -469,7 +469,7 @@ PyDoc_STRVAR(audioop_tostereo__doc__, "Generate a stereo fragment from a mono fragment."); #define AUDIOOP_TOSTEREO_METHODDEF \ - {"tostereo", (PyCFunction)audioop_tostereo, METH_FASTCALL, audioop_tostereo__doc__}, + {"tostereo", (PyCFunction)(void(*)(void))audioop_tostereo, METH_FASTCALL, audioop_tostereo__doc__}, static PyObject * audioop_tostereo_impl(PyObject *module, Py_buffer *fragment, int width, @@ -506,7 +506,7 @@ PyDoc_STRVAR(audioop_add__doc__, "Return a fragment which is the addition of the two samples passed as parameters."); #define AUDIOOP_ADD_METHODDEF \ - {"add", (PyCFunction)audioop_add, METH_FASTCALL, audioop_add__doc__}, + {"add", (PyCFunction)(void(*)(void))audioop_add, METH_FASTCALL, audioop_add__doc__}, static PyObject * audioop_add_impl(PyObject *module, Py_buffer *fragment1, @@ -546,7 +546,7 @@ PyDoc_STRVAR(audioop_bias__doc__, "Return a fragment that is the original fragment with a bias added to each sample."); #define AUDIOOP_BIAS_METHODDEF \ - {"bias", (PyCFunction)audioop_bias, METH_FASTCALL, audioop_bias__doc__}, + {"bias", (PyCFunction)(void(*)(void))audioop_bias, METH_FASTCALL, audioop_bias__doc__}, static PyObject * audioop_bias_impl(PyObject *module, Py_buffer *fragment, int width, int bias); @@ -581,7 +581,7 @@ PyDoc_STRVAR(audioop_reverse__doc__, "Reverse the samples in a fragment and returns the modified fragment."); #define AUDIOOP_REVERSE_METHODDEF \ - {"reverse", (PyCFunction)audioop_reverse, METH_FASTCALL, audioop_reverse__doc__}, + {"reverse", (PyCFunction)(void(*)(void))audioop_reverse, METH_FASTCALL, audioop_reverse__doc__}, static PyObject * audioop_reverse_impl(PyObject *module, Py_buffer *fragment, int width); @@ -615,7 +615,7 @@ PyDoc_STRVAR(audioop_byteswap__doc__, "Convert big-endian samples to little-endian and vice versa."); #define AUDIOOP_BYTESWAP_METHODDEF \ - {"byteswap", (PyCFunction)audioop_byteswap, METH_FASTCALL, audioop_byteswap__doc__}, + {"byteswap", (PyCFunction)(void(*)(void))audioop_byteswap, METH_FASTCALL, audioop_byteswap__doc__}, static PyObject * audioop_byteswap_impl(PyObject *module, Py_buffer *fragment, int width); @@ -649,7 +649,7 @@ PyDoc_STRVAR(audioop_lin2lin__doc__, "Convert samples between 1-, 2-, 3- and 4-byte formats."); #define AUDIOOP_LIN2LIN_METHODDEF \ - {"lin2lin", (PyCFunction)audioop_lin2lin, METH_FASTCALL, audioop_lin2lin__doc__}, + {"lin2lin", (PyCFunction)(void(*)(void))audioop_lin2lin, METH_FASTCALL, audioop_lin2lin__doc__}, static PyObject * audioop_lin2lin_impl(PyObject *module, Py_buffer *fragment, int width, @@ -686,7 +686,7 @@ PyDoc_STRVAR(audioop_ratecv__doc__, "Convert the frame rate of the input fragment."); #define AUDIOOP_RATECV_METHODDEF \ - {"ratecv", (PyCFunction)audioop_ratecv, METH_FASTCALL, audioop_ratecv__doc__}, + {"ratecv", (PyCFunction)(void(*)(void))audioop_ratecv, METH_FASTCALL, audioop_ratecv__doc__}, static PyObject * audioop_ratecv_impl(PyObject *module, Py_buffer *fragment, int width, @@ -728,7 +728,7 @@ PyDoc_STRVAR(audioop_lin2ulaw__doc__, "Convert samples in the audio fragment to u-LAW encoding."); #define AUDIOOP_LIN2ULAW_METHODDEF \ - {"lin2ulaw", (PyCFunction)audioop_lin2ulaw, METH_FASTCALL, audioop_lin2ulaw__doc__}, + {"lin2ulaw", (PyCFunction)(void(*)(void))audioop_lin2ulaw, METH_FASTCALL, audioop_lin2ulaw__doc__}, static PyObject * audioop_lin2ulaw_impl(PyObject *module, Py_buffer *fragment, int width); @@ -762,7 +762,7 @@ PyDoc_STRVAR(audioop_ulaw2lin__doc__, "Convert sound fragments in u-LAW encoding to linearly encoded sound fragments."); #define AUDIOOP_ULAW2LIN_METHODDEF \ - {"ulaw2lin", (PyCFunction)audioop_ulaw2lin, METH_FASTCALL, audioop_ulaw2lin__doc__}, + {"ulaw2lin", (PyCFunction)(void(*)(void))audioop_ulaw2lin, METH_FASTCALL, audioop_ulaw2lin__doc__}, static PyObject * audioop_ulaw2lin_impl(PyObject *module, Py_buffer *fragment, int width); @@ -796,7 +796,7 @@ PyDoc_STRVAR(audioop_lin2alaw__doc__, "Convert samples in the audio fragment to a-LAW encoding."); #define AUDIOOP_LIN2ALAW_METHODDEF \ - {"lin2alaw", (PyCFunction)audioop_lin2alaw, METH_FASTCALL, audioop_lin2alaw__doc__}, + {"lin2alaw", (PyCFunction)(void(*)(void))audioop_lin2alaw, METH_FASTCALL, audioop_lin2alaw__doc__}, static PyObject * audioop_lin2alaw_impl(PyObject *module, Py_buffer *fragment, int width); @@ -830,7 +830,7 @@ PyDoc_STRVAR(audioop_alaw2lin__doc__, "Convert sound fragments in a-LAW encoding to linearly encoded sound fragments."); #define AUDIOOP_ALAW2LIN_METHODDEF \ - {"alaw2lin", (PyCFunction)audioop_alaw2lin, METH_FASTCALL, audioop_alaw2lin__doc__}, + {"alaw2lin", (PyCFunction)(void(*)(void))audioop_alaw2lin, METH_FASTCALL, audioop_alaw2lin__doc__}, static PyObject * audioop_alaw2lin_impl(PyObject *module, Py_buffer *fragment, int width); @@ -864,7 +864,7 @@ PyDoc_STRVAR(audioop_lin2adpcm__doc__, "Convert samples to 4 bit Intel/DVI ADPCM encoding."); #define AUDIOOP_LIN2ADPCM_METHODDEF \ - {"lin2adpcm", (PyCFunction)audioop_lin2adpcm, METH_FASTCALL, audioop_lin2adpcm__doc__}, + {"lin2adpcm", (PyCFunction)(void(*)(void))audioop_lin2adpcm, METH_FASTCALL, audioop_lin2adpcm__doc__}, static PyObject * audioop_lin2adpcm_impl(PyObject *module, Py_buffer *fragment, int width, @@ -900,7 +900,7 @@ PyDoc_STRVAR(audioop_adpcm2lin__doc__, "Decode an Intel/DVI ADPCM coded fragment to a linear fragment."); #define AUDIOOP_ADPCM2LIN_METHODDEF \ - {"adpcm2lin", (PyCFunction)audioop_adpcm2lin, METH_FASTCALL, audioop_adpcm2lin__doc__}, + {"adpcm2lin", (PyCFunction)(void(*)(void))audioop_adpcm2lin, METH_FASTCALL, audioop_adpcm2lin__doc__}, static PyObject * audioop_adpcm2lin_impl(PyObject *module, Py_buffer *fragment, int width, @@ -928,4 +928,4 @@ audioop_adpcm2lin(PyObject *module, PyObject *const *args, Py_ssize_t nargs) return return_value; } -/*[clinic end generated code: output=2f88b8827ee0aa9b input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d197b1559196a48a input=a9049054013a1b77]*/ diff --git a/Modules/clinic/binascii.c.h b/Modules/clinic/binascii.c.h index 8099cbd4cce6..07ab24c2f7f4 100644 --- a/Modules/clinic/binascii.c.h +++ b/Modules/clinic/binascii.c.h @@ -40,7 +40,7 @@ PyDoc_STRVAR(binascii_b2a_uu__doc__, "Uuencode line of data."); #define BINASCII_B2A_UU_METHODDEF \ - {"b2a_uu", (PyCFunction)binascii_b2a_uu, METH_FASTCALL|METH_KEYWORDS, binascii_b2a_uu__doc__}, + {"b2a_uu", (PyCFunction)(void(*)(void))binascii_b2a_uu, METH_FASTCALL|METH_KEYWORDS, binascii_b2a_uu__doc__}, static PyObject * binascii_b2a_uu_impl(PyObject *module, Py_buffer *data, int backtick); @@ -107,7 +107,7 @@ PyDoc_STRVAR(binascii_b2a_base64__doc__, "Base64-code line of data."); #define BINASCII_B2A_BASE64_METHODDEF \ - {"b2a_base64", (PyCFunction)binascii_b2a_base64, METH_FASTCALL|METH_KEYWORDS, binascii_b2a_base64__doc__}, + {"b2a_base64", (PyCFunction)(void(*)(void))binascii_b2a_base64, METH_FASTCALL|METH_KEYWORDS, binascii_b2a_base64__doc__}, static PyObject * binascii_b2a_base64_impl(PyObject *module, Py_buffer *data, int newline); @@ -270,7 +270,7 @@ PyDoc_STRVAR(binascii_crc_hqx__doc__, "Compute CRC-CCITT incrementally."); #define BINASCII_CRC_HQX_METHODDEF \ - {"crc_hqx", (PyCFunction)binascii_crc_hqx, METH_FASTCALL, binascii_crc_hqx__doc__}, + {"crc_hqx", (PyCFunction)(void(*)(void))binascii_crc_hqx, METH_FASTCALL, binascii_crc_hqx__doc__}, static unsigned int binascii_crc_hqx_impl(PyObject *module, Py_buffer *data, unsigned int crc); @@ -309,7 +309,7 @@ PyDoc_STRVAR(binascii_crc32__doc__, "Compute CRC-32 incrementally."); #define BINASCII_CRC32_METHODDEF \ - {"crc32", (PyCFunction)binascii_crc32, METH_FASTCALL, binascii_crc32__doc__}, + {"crc32", (PyCFunction)(void(*)(void))binascii_crc32, METH_FASTCALL, binascii_crc32__doc__}, static unsigned int binascii_crc32_impl(PyObject *module, Py_buffer *data, unsigned int crc); @@ -484,7 +484,7 @@ PyDoc_STRVAR(binascii_a2b_qp__doc__, "Decode a string of qp-encoded data."); #define BINASCII_A2B_QP_METHODDEF \ - {"a2b_qp", (PyCFunction)binascii_a2b_qp, METH_FASTCALL|METH_KEYWORDS, binascii_a2b_qp__doc__}, + {"a2b_qp", (PyCFunction)(void(*)(void))binascii_a2b_qp, METH_FASTCALL|METH_KEYWORDS, binascii_a2b_qp__doc__}, static PyObject * binascii_a2b_qp_impl(PyObject *module, Py_buffer *data, int header); @@ -523,7 +523,7 @@ PyDoc_STRVAR(binascii_b2a_qp__doc__, "are both encoded. When quotetabs is set, space and tabs are encoded."); #define BINASCII_B2A_QP_METHODDEF \ - {"b2a_qp", (PyCFunction)binascii_b2a_qp, METH_FASTCALL|METH_KEYWORDS, binascii_b2a_qp__doc__}, + {"b2a_qp", (PyCFunction)(void(*)(void))binascii_b2a_qp, METH_FASTCALL|METH_KEYWORDS, binascii_b2a_qp__doc__}, static PyObject * binascii_b2a_qp_impl(PyObject *module, Py_buffer *data, int quotetabs, @@ -554,4 +554,4 @@ binascii_b2a_qp(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj return return_value; } -/*[clinic end generated code: output=815f1c453fd6568f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3f45e15ce8b563b7 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/cmathmodule.c.h b/Modules/clinic/cmathmodule.c.h index 9b3c62eeb7a4..021c87df4e3c 100644 --- a/Modules/clinic/cmathmodule.c.h +++ b/Modules/clinic/cmathmodule.c.h @@ -641,7 +641,7 @@ PyDoc_STRVAR(cmath_log__doc__, "If the base not specified, returns the natural logarithm (base e) of z."); #define CMATH_LOG_METHODDEF \ - {"log", (PyCFunction)cmath_log, METH_FASTCALL, cmath_log__doc__}, + {"log", (PyCFunction)(void(*)(void))cmath_log, METH_FASTCALL, cmath_log__doc__}, static PyObject * cmath_log_impl(PyObject *module, Py_complex x, PyObject *y_obj); @@ -726,7 +726,7 @@ PyDoc_STRVAR(cmath_rect__doc__, "Convert from polar coordinates to rectangular coordinates."); #define CMATH_RECT_METHODDEF \ - {"rect", (PyCFunction)cmath_rect, METH_FASTCALL, cmath_rect__doc__}, + {"rect", (PyCFunction)(void(*)(void))cmath_rect, METH_FASTCALL, cmath_rect__doc__}, static PyObject * cmath_rect_impl(PyObject *module, double r, double phi); @@ -851,7 +851,7 @@ PyDoc_STRVAR(cmath_isclose__doc__, "not close to anything, even itself. inf and -inf are only close to themselves."); #define CMATH_ISCLOSE_METHODDEF \ - {"isclose", (PyCFunction)cmath_isclose, METH_FASTCALL|METH_KEYWORDS, cmath_isclose__doc__}, + {"isclose", (PyCFunction)(void(*)(void))cmath_isclose, METH_FASTCALL|METH_KEYWORDS, cmath_isclose__doc__}, static int cmath_isclose_impl(PyObject *module, Py_complex a, Py_complex b, @@ -882,4 +882,4 @@ cmath_isclose(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec exit: return return_value; } -/*[clinic end generated code: output=dd93c3a6aeb42ebb input=a9049054013a1b77]*/ +/*[clinic end generated code: output=17f6f65a229b1ef9 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/fcntlmodule.c.h b/Modules/clinic/fcntlmodule.c.h index f61c526a958c..7b5a280045cc 100644 --- a/Modules/clinic/fcntlmodule.c.h +++ b/Modules/clinic/fcntlmodule.c.h @@ -19,7 +19,7 @@ PyDoc_STRVAR(fcntl_fcntl__doc__, "corresponding to the return value of the fcntl call in the C code."); #define FCNTL_FCNTL_METHODDEF \ - {"fcntl", (PyCFunction)fcntl_fcntl, METH_FASTCALL, fcntl_fcntl__doc__}, + {"fcntl", (PyCFunction)(void(*)(void))fcntl_fcntl, METH_FASTCALL, fcntl_fcntl__doc__}, static PyObject * fcntl_fcntl_impl(PyObject *module, int fd, int code, PyObject *arg); @@ -76,7 +76,7 @@ PyDoc_STRVAR(fcntl_ioctl__doc__, "code."); #define FCNTL_IOCTL_METHODDEF \ - {"ioctl", (PyCFunction)fcntl_ioctl, METH_FASTCALL, fcntl_ioctl__doc__}, + {"ioctl", (PyCFunction)(void(*)(void))fcntl_ioctl, METH_FASTCALL, fcntl_ioctl__doc__}, static PyObject * fcntl_ioctl_impl(PyObject *module, int fd, unsigned int code, @@ -111,7 +111,7 @@ PyDoc_STRVAR(fcntl_flock__doc__, "function is emulated using fcntl())."); #define FCNTL_FLOCK_METHODDEF \ - {"flock", (PyCFunction)fcntl_flock, METH_FASTCALL, fcntl_flock__doc__}, + {"flock", (PyCFunction)(void(*)(void))fcntl_flock, METH_FASTCALL, fcntl_flock__doc__}, static PyObject * fcntl_flock_impl(PyObject *module, int fd, int code); @@ -161,7 +161,7 @@ PyDoc_STRVAR(fcntl_lockf__doc__, " 2 - relative to the end of the file (SEEK_END)"); #define FCNTL_LOCKF_METHODDEF \ - {"lockf", (PyCFunction)fcntl_lockf, METH_FASTCALL, fcntl_lockf__doc__}, + {"lockf", (PyCFunction)(void(*)(void))fcntl_lockf, METH_FASTCALL, fcntl_lockf__doc__}, static PyObject * fcntl_lockf_impl(PyObject *module, int fd, int code, PyObject *lenobj, @@ -186,4 +186,4 @@ fcntl_lockf(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=2f6e70ae67ec8ac9 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=fc1a781750750a14 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/gcmodule.c.h b/Modules/clinic/gcmodule.c.h index 0330c8113bcc..1c4be667da5a 100644 --- a/Modules/clinic/gcmodule.c.h +++ b/Modules/clinic/gcmodule.c.h @@ -79,7 +79,7 @@ PyDoc_STRVAR(gc_collect__doc__, "The number of unreachable objects is returned."); #define GC_COLLECT_METHODDEF \ - {"collect", (PyCFunction)gc_collect, METH_FASTCALL|METH_KEYWORDS, gc_collect__doc__}, + {"collect", (PyCFunction)(void(*)(void))gc_collect, METH_FASTCALL|METH_KEYWORDS, gc_collect__doc__}, static Py_ssize_t gc_collect_impl(PyObject *module, int generation); @@ -325,4 +325,4 @@ gc_get_freeze_count(PyObject *module, PyObject *Py_UNUSED(ignored)) exit: return return_value; } -/*[clinic end generated code: output=21dc9270b10b7891 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ba67a1ab58780485 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/grpmodule.c.h b/Modules/clinic/grpmodule.c.h index bb51b8a53ab4..c2e54c94e063 100644 --- a/Modules/clinic/grpmodule.c.h +++ b/Modules/clinic/grpmodule.c.h @@ -11,7 +11,7 @@ PyDoc_STRVAR(grp_getgrgid__doc__, "If id is not valid, raise KeyError."); #define GRP_GETGRGID_METHODDEF \ - {"getgrgid", (PyCFunction)grp_getgrgid, METH_FASTCALL|METH_KEYWORDS, grp_getgrgid__doc__}, + {"getgrgid", (PyCFunction)(void(*)(void))grp_getgrgid, METH_FASTCALL|METH_KEYWORDS, grp_getgrgid__doc__}, static PyObject * grp_getgrgid_impl(PyObject *module, PyObject *id); @@ -43,7 +43,7 @@ PyDoc_STRVAR(grp_getgrnam__doc__, "If name is not valid, raise KeyError."); #define GRP_GETGRNAM_METHODDEF \ - {"getgrnam", (PyCFunction)grp_getgrnam, METH_FASTCALL|METH_KEYWORDS, grp_getgrnam__doc__}, + {"getgrnam", (PyCFunction)(void(*)(void))grp_getgrnam, METH_FASTCALL|METH_KEYWORDS, grp_getgrnam__doc__}, static PyObject * grp_getgrnam_impl(PyObject *module, PyObject *name); @@ -86,4 +86,4 @@ grp_getgrall(PyObject *module, PyObject *Py_UNUSED(ignored)) { return grp_getgrall_impl(module); } -/*[clinic end generated code: output=0ccba09e8ec14c81 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ab10233f6015bc0a input=a9049054013a1b77]*/ diff --git a/Modules/clinic/itertoolsmodule.c.h b/Modules/clinic/itertoolsmodule.c.h index 476adc1f5c5d..b7d70a3492d3 100644 --- a/Modules/clinic/itertoolsmodule.c.h +++ b/Modules/clinic/itertoolsmodule.c.h @@ -131,7 +131,7 @@ PyDoc_STRVAR(itertools_tee__doc__, "Returns a tuple of n independent iterators."); #define ITERTOOLS_TEE_METHODDEF \ - {"tee", (PyCFunction)itertools_tee, METH_FASTCALL, itertools_tee__doc__}, + {"tee", (PyCFunction)(void(*)(void))itertools_tee, METH_FASTCALL, itertools_tee__doc__}, static PyObject * itertools_tee_impl(PyObject *module, PyObject *iterable, Py_ssize_t n); @@ -510,4 +510,4 @@ itertools_count(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=c8c47b766deeffc3 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=916251f891fa84b9 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/mathmodule.c.h b/Modules/clinic/mathmodule.c.h index b40a227dbea5..c8d80296f7b6 100644 --- a/Modules/clinic/mathmodule.c.h +++ b/Modules/clinic/mathmodule.c.h @@ -9,7 +9,7 @@ PyDoc_STRVAR(math_gcd__doc__, "greatest common divisor of x and y"); #define MATH_GCD_METHODDEF \ - {"gcd", (PyCFunction)math_gcd, METH_FASTCALL, math_gcd__doc__}, + {"gcd", (PyCFunction)(void(*)(void))math_gcd, METH_FASTCALL, math_gcd__doc__}, static PyObject * math_gcd_impl(PyObject *module, PyObject *a, PyObject *b); @@ -126,7 +126,7 @@ PyDoc_STRVAR(math_ldexp__doc__, "This is essentially the inverse of frexp()."); #define MATH_LDEXP_METHODDEF \ - {"ldexp", (PyCFunction)math_ldexp, METH_FASTCALL, math_ldexp__doc__}, + {"ldexp", (PyCFunction)(void(*)(void))math_ldexp, METH_FASTCALL, math_ldexp__doc__}, static PyObject * math_ldexp_impl(PyObject *module, double x, PyObject *i); @@ -247,7 +247,7 @@ PyDoc_STRVAR(math_fmod__doc__, "x % y may differ."); #define MATH_FMOD_METHODDEF \ - {"fmod", (PyCFunction)math_fmod, METH_FASTCALL, math_fmod__doc__}, + {"fmod", (PyCFunction)(void(*)(void))math_fmod, METH_FASTCALL, math_fmod__doc__}, static PyObject * math_fmod_impl(PyObject *module, double x, double y); @@ -282,7 +282,7 @@ PyDoc_STRVAR(math_dist__doc__, " sqrt(sum((px - qx) ** 2.0 for px, qx in zip(p, q)))"); #define MATH_DIST_METHODDEF \ - {"dist", (PyCFunction)math_dist, METH_FASTCALL, math_dist__doc__}, + {"dist", (PyCFunction)(void(*)(void))math_dist, METH_FASTCALL, math_dist__doc__}, static PyObject * math_dist_impl(PyObject *module, PyObject *p, PyObject *q); @@ -312,7 +312,7 @@ PyDoc_STRVAR(math_pow__doc__, "Return x**y (x to the power of y)."); #define MATH_POW_METHODDEF \ - {"pow", (PyCFunction)math_pow, METH_FASTCALL, math_pow__doc__}, + {"pow", (PyCFunction)(void(*)(void))math_pow, METH_FASTCALL, math_pow__doc__}, static PyObject * math_pow_impl(PyObject *module, double x, double y); @@ -492,7 +492,7 @@ PyDoc_STRVAR(math_isclose__doc__, "only close to themselves."); #define MATH_ISCLOSE_METHODDEF \ - {"isclose", (PyCFunction)math_isclose, METH_FASTCALL|METH_KEYWORDS, math_isclose__doc__}, + {"isclose", (PyCFunction)(void(*)(void))math_isclose, METH_FASTCALL|METH_KEYWORDS, math_isclose__doc__}, static int math_isclose_impl(PyObject *module, double a, double b, double rel_tol, @@ -523,4 +523,4 @@ math_isclose(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject exit: return return_value; } -/*[clinic end generated code: output=239c51a5acefbafb input=a9049054013a1b77]*/ +/*[clinic end generated code: output=8b1709a71e5fb855 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/md5module.c.h b/Modules/clinic/md5module.c.h index fa1a0d68e834..67cb48c08473 100644 --- a/Modules/clinic/md5module.c.h +++ b/Modules/clinic/md5module.c.h @@ -72,7 +72,7 @@ PyDoc_STRVAR(_md5_md5__doc__, "Return a new MD5 hash object; optionally initialized with a string."); #define _MD5_MD5_METHODDEF \ - {"md5", (PyCFunction)_md5_md5, METH_FASTCALL|METH_KEYWORDS, _md5_md5__doc__}, + {"md5", (PyCFunction)(void(*)(void))_md5_md5, METH_FASTCALL|METH_KEYWORDS, _md5_md5__doc__}, static PyObject * _md5_md5_impl(PyObject *module, PyObject *string); @@ -94,4 +94,4 @@ _md5_md5(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw exit: return return_value; } -/*[clinic end generated code: output=72aa003c308e26cf input=a9049054013a1b77]*/ +/*[clinic end generated code: output=83cb1aef575f13bc input=a9049054013a1b77]*/ diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h index 56010f408ccf..80690703ee2c 100644 --- a/Modules/clinic/posixmodule.c.h +++ b/Modules/clinic/posixmodule.c.h @@ -28,7 +28,7 @@ PyDoc_STRVAR(os_stat__doc__, " an open file descriptor."); #define OS_STAT_METHODDEF \ - {"stat", (PyCFunction)os_stat, METH_FASTCALL|METH_KEYWORDS, os_stat__doc__}, + {"stat", (PyCFunction)(void(*)(void))os_stat, METH_FASTCALL|METH_KEYWORDS, os_stat__doc__}, static PyObject * os_stat_impl(PyObject *module, path_t *path, int dir_fd, int follow_symlinks); @@ -66,7 +66,7 @@ PyDoc_STRVAR(os_lstat__doc__, "Equivalent to stat(path, follow_symlinks=False)."); #define OS_LSTAT_METHODDEF \ - {"lstat", (PyCFunction)os_lstat, METH_FASTCALL|METH_KEYWORDS, os_lstat__doc__}, + {"lstat", (PyCFunction)(void(*)(void))os_lstat, METH_FASTCALL|METH_KEYWORDS, os_lstat__doc__}, static PyObject * os_lstat_impl(PyObject *module, path_t *path, int dir_fd); @@ -126,7 +126,7 @@ PyDoc_STRVAR(os_access__doc__, " has the specified access to the path."); #define OS_ACCESS_METHODDEF \ - {"access", (PyCFunction)os_access, METH_FASTCALL|METH_KEYWORDS, os_access__doc__}, + {"access", (PyCFunction)(void(*)(void))os_access, METH_FASTCALL|METH_KEYWORDS, os_access__doc__}, static int os_access_impl(PyObject *module, path_t *path, int mode, int dir_fd, @@ -234,7 +234,7 @@ PyDoc_STRVAR(os_chdir__doc__, " If this functionality is unavailable, using it raises an exception."); #define OS_CHDIR_METHODDEF \ - {"chdir", (PyCFunction)os_chdir, METH_FASTCALL|METH_KEYWORDS, os_chdir__doc__}, + {"chdir", (PyCFunction)(void(*)(void))os_chdir, METH_FASTCALL|METH_KEYWORDS, os_chdir__doc__}, static PyObject * os_chdir_impl(PyObject *module, path_t *path); @@ -272,7 +272,7 @@ PyDoc_STRVAR(os_fchdir__doc__, "Equivalent to os.chdir(fd)."); #define OS_FCHDIR_METHODDEF \ - {"fchdir", (PyCFunction)os_fchdir, METH_FASTCALL|METH_KEYWORDS, os_fchdir__doc__}, + {"fchdir", (PyCFunction)(void(*)(void))os_fchdir, METH_FASTCALL|METH_KEYWORDS, os_fchdir__doc__}, static PyObject * os_fchdir_impl(PyObject *module, int fd); @@ -324,7 +324,7 @@ PyDoc_STRVAR(os_chmod__doc__, " If they are unavailable, using them will raise a NotImplementedError."); #define OS_CHMOD_METHODDEF \ - {"chmod", (PyCFunction)os_chmod, METH_FASTCALL|METH_KEYWORDS, os_chmod__doc__}, + {"chmod", (PyCFunction)(void(*)(void))os_chmod, METH_FASTCALL|METH_KEYWORDS, os_chmod__doc__}, static PyObject * os_chmod_impl(PyObject *module, path_t *path, int mode, int dir_fd, @@ -365,7 +365,7 @@ PyDoc_STRVAR(os_fchmod__doc__, "Equivalent to os.chmod(fd, mode)."); #define OS_FCHMOD_METHODDEF \ - {"fchmod", (PyCFunction)os_fchmod, METH_FASTCALL|METH_KEYWORDS, os_fchmod__doc__}, + {"fchmod", (PyCFunction)(void(*)(void))os_fchmod, METH_FASTCALL|METH_KEYWORDS, os_fchmod__doc__}, static PyObject * os_fchmod_impl(PyObject *module, int fd, int mode); @@ -403,7 +403,7 @@ PyDoc_STRVAR(os_lchmod__doc__, "Equivalent to chmod(path, mode, follow_symlinks=False).\""); #define OS_LCHMOD_METHODDEF \ - {"lchmod", (PyCFunction)os_lchmod, METH_FASTCALL|METH_KEYWORDS, os_lchmod__doc__}, + {"lchmod", (PyCFunction)(void(*)(void))os_lchmod, METH_FASTCALL|METH_KEYWORDS, os_lchmod__doc__}, static PyObject * os_lchmod_impl(PyObject *module, path_t *path, int mode); @@ -447,7 +447,7 @@ PyDoc_STRVAR(os_chflags__doc__, "unavailable, using it will raise a NotImplementedError."); #define OS_CHFLAGS_METHODDEF \ - {"chflags", (PyCFunction)os_chflags, METH_FASTCALL|METH_KEYWORDS, os_chflags__doc__}, + {"chflags", (PyCFunction)(void(*)(void))os_chflags, METH_FASTCALL|METH_KEYWORDS, os_chflags__doc__}, static PyObject * os_chflags_impl(PyObject *module, path_t *path, unsigned long flags, @@ -490,7 +490,7 @@ PyDoc_STRVAR(os_lchflags__doc__, "Equivalent to chflags(path, flags, follow_symlinks=False)."); #define OS_LCHFLAGS_METHODDEF \ - {"lchflags", (PyCFunction)os_lchflags, METH_FASTCALL|METH_KEYWORDS, os_lchflags__doc__}, + {"lchflags", (PyCFunction)(void(*)(void))os_lchflags, METH_FASTCALL|METH_KEYWORDS, os_lchflags__doc__}, static PyObject * os_lchflags_impl(PyObject *module, path_t *path, unsigned long flags); @@ -528,7 +528,7 @@ PyDoc_STRVAR(os_chroot__doc__, "Change root directory to path."); #define OS_CHROOT_METHODDEF \ - {"chroot", (PyCFunction)os_chroot, METH_FASTCALL|METH_KEYWORDS, os_chroot__doc__}, + {"chroot", (PyCFunction)(void(*)(void))os_chroot, METH_FASTCALL|METH_KEYWORDS, os_chroot__doc__}, static PyObject * os_chroot_impl(PyObject *module, path_t *path); @@ -565,7 +565,7 @@ PyDoc_STRVAR(os_fsync__doc__, "Force write of fd to disk."); #define OS_FSYNC_METHODDEF \ - {"fsync", (PyCFunction)os_fsync, METH_FASTCALL|METH_KEYWORDS, os_fsync__doc__}, + {"fsync", (PyCFunction)(void(*)(void))os_fsync, METH_FASTCALL|METH_KEYWORDS, os_fsync__doc__}, static PyObject * os_fsync_impl(PyObject *module, int fd); @@ -621,7 +621,7 @@ PyDoc_STRVAR(os_fdatasync__doc__, "Force write of fd to disk without forcing update of metadata."); #define OS_FDATASYNC_METHODDEF \ - {"fdatasync", (PyCFunction)os_fdatasync, METH_FASTCALL|METH_KEYWORDS, os_fdatasync__doc__}, + {"fdatasync", (PyCFunction)(void(*)(void))os_fdatasync, METH_FASTCALL|METH_KEYWORDS, os_fdatasync__doc__}, static PyObject * os_fdatasync_impl(PyObject *module, int fd); @@ -679,7 +679,7 @@ PyDoc_STRVAR(os_chown__doc__, " If they are unavailable, using them will raise a NotImplementedError."); #define OS_CHOWN_METHODDEF \ - {"chown", (PyCFunction)os_chown, METH_FASTCALL|METH_KEYWORDS, os_chown__doc__}, + {"chown", (PyCFunction)(void(*)(void))os_chown, METH_FASTCALL|METH_KEYWORDS, os_chown__doc__}, static PyObject * os_chown_impl(PyObject *module, path_t *path, uid_t uid, gid_t gid, @@ -723,7 +723,7 @@ PyDoc_STRVAR(os_fchown__doc__, "Equivalent to os.chown(fd, uid, gid)."); #define OS_FCHOWN_METHODDEF \ - {"fchown", (PyCFunction)os_fchown, METH_FASTCALL|METH_KEYWORDS, os_fchown__doc__}, + {"fchown", (PyCFunction)(void(*)(void))os_fchown, METH_FASTCALL|METH_KEYWORDS, os_fchown__doc__}, static PyObject * os_fchown_impl(PyObject *module, int fd, uid_t uid, gid_t gid); @@ -762,7 +762,7 @@ PyDoc_STRVAR(os_lchown__doc__, "Equivalent to os.chown(path, uid, gid, follow_symlinks=False)."); #define OS_LCHOWN_METHODDEF \ - {"lchown", (PyCFunction)os_lchown, METH_FASTCALL|METH_KEYWORDS, os_lchown__doc__}, + {"lchown", (PyCFunction)(void(*)(void))os_lchown, METH_FASTCALL|METH_KEYWORDS, os_lchown__doc__}, static PyObject * os_lchown_impl(PyObject *module, path_t *path, uid_t uid, gid_t gid); @@ -848,7 +848,7 @@ PyDoc_STRVAR(os_link__doc__, " NotImplementedError."); #define OS_LINK_METHODDEF \ - {"link", (PyCFunction)os_link, METH_FASTCALL|METH_KEYWORDS, os_link__doc__}, + {"link", (PyCFunction)(void(*)(void))os_link, METH_FASTCALL|METH_KEYWORDS, os_link__doc__}, static PyObject * os_link_impl(PyObject *module, path_t *src, path_t *dst, int src_dir_fd, @@ -901,7 +901,7 @@ PyDoc_STRVAR(os_listdir__doc__, "entries \'.\' and \'..\' even if they are present in the directory."); #define OS_LISTDIR_METHODDEF \ - {"listdir", (PyCFunction)os_listdir, METH_FASTCALL|METH_KEYWORDS, os_listdir__doc__}, + {"listdir", (PyCFunction)(void(*)(void))os_listdir, METH_FASTCALL|METH_KEYWORDS, os_listdir__doc__}, static PyObject * os_listdir_impl(PyObject *module, path_t *path); @@ -1016,7 +1016,7 @@ PyDoc_STRVAR(os__getvolumepathname__doc__, "A helper function for ismount on Win32."); #define OS__GETVOLUMEPATHNAME_METHODDEF \ - {"_getvolumepathname", (PyCFunction)os__getvolumepathname, METH_FASTCALL|METH_KEYWORDS, os__getvolumepathname__doc__}, + {"_getvolumepathname", (PyCFunction)(void(*)(void))os__getvolumepathname, METH_FASTCALL|METH_KEYWORDS, os__getvolumepathname__doc__}, static PyObject * os__getvolumepathname_impl(PyObject *module, path_t *path); @@ -1058,7 +1058,7 @@ PyDoc_STRVAR(os_mkdir__doc__, "The mode argument is ignored on Windows."); #define OS_MKDIR_METHODDEF \ - {"mkdir", (PyCFunction)os_mkdir, METH_FASTCALL|METH_KEYWORDS, os_mkdir__doc__}, + {"mkdir", (PyCFunction)(void(*)(void))os_mkdir, METH_FASTCALL|METH_KEYWORDS, os_mkdir__doc__}, static PyObject * os_mkdir_impl(PyObject *module, path_t *path, int mode, int dir_fd); @@ -1126,7 +1126,7 @@ PyDoc_STRVAR(os_getpriority__doc__, "Return program scheduling priority."); #define OS_GETPRIORITY_METHODDEF \ - {"getpriority", (PyCFunction)os_getpriority, METH_FASTCALL|METH_KEYWORDS, os_getpriority__doc__}, + {"getpriority", (PyCFunction)(void(*)(void))os_getpriority, METH_FASTCALL|METH_KEYWORDS, os_getpriority__doc__}, static PyObject * os_getpriority_impl(PyObject *module, int which, int who); @@ -1161,7 +1161,7 @@ PyDoc_STRVAR(os_setpriority__doc__, "Set program scheduling priority."); #define OS_SETPRIORITY_METHODDEF \ - {"setpriority", (PyCFunction)os_setpriority, METH_FASTCALL|METH_KEYWORDS, os_setpriority__doc__}, + {"setpriority", (PyCFunction)(void(*)(void))os_setpriority, METH_FASTCALL|METH_KEYWORDS, os_setpriority__doc__}, static PyObject * os_setpriority_impl(PyObject *module, int which, int who, int priority); @@ -1201,7 +1201,7 @@ PyDoc_STRVAR(os_rename__doc__, " If they are unavailable, using them will raise a NotImplementedError."); #define OS_RENAME_METHODDEF \ - {"rename", (PyCFunction)os_rename, METH_FASTCALL|METH_KEYWORDS, os_rename__doc__}, + {"rename", (PyCFunction)(void(*)(void))os_rename, METH_FASTCALL|METH_KEYWORDS, os_rename__doc__}, static PyObject * os_rename_impl(PyObject *module, path_t *src, path_t *dst, int src_dir_fd, @@ -1246,7 +1246,7 @@ PyDoc_STRVAR(os_replace__doc__, " If they are unavailable, using them will raise a NotImplementedError.\""); #define OS_REPLACE_METHODDEF \ - {"replace", (PyCFunction)os_replace, METH_FASTCALL|METH_KEYWORDS, os_replace__doc__}, + {"replace", (PyCFunction)(void(*)(void))os_replace, METH_FASTCALL|METH_KEYWORDS, os_replace__doc__}, static PyObject * os_replace_impl(PyObject *module, path_t *src, path_t *dst, int src_dir_fd, @@ -1290,7 +1290,7 @@ PyDoc_STRVAR(os_rmdir__doc__, " If it is unavailable, using it will raise a NotImplementedError."); #define OS_RMDIR_METHODDEF \ - {"rmdir", (PyCFunction)os_rmdir, METH_FASTCALL|METH_KEYWORDS, os_rmdir__doc__}, + {"rmdir", (PyCFunction)(void(*)(void))os_rmdir, METH_FASTCALL|METH_KEYWORDS, os_rmdir__doc__}, static PyObject * os_rmdir_impl(PyObject *module, path_t *path, int dir_fd); @@ -1326,7 +1326,7 @@ PyDoc_STRVAR(os_system__doc__, "Execute the command in a subshell."); #define OS_SYSTEM_METHODDEF \ - {"system", (PyCFunction)os_system, METH_FASTCALL|METH_KEYWORDS, os_system__doc__}, + {"system", (PyCFunction)(void(*)(void))os_system, METH_FASTCALL|METH_KEYWORDS, os_system__doc__}, static long os_system_impl(PyObject *module, Py_UNICODE *command); @@ -1365,7 +1365,7 @@ PyDoc_STRVAR(os_system__doc__, "Execute the command in a subshell."); #define OS_SYSTEM_METHODDEF \ - {"system", (PyCFunction)os_system, METH_FASTCALL|METH_KEYWORDS, os_system__doc__}, + {"system", (PyCFunction)(void(*)(void))os_system, METH_FASTCALL|METH_KEYWORDS, os_system__doc__}, static long os_system_impl(PyObject *module, PyObject *command); @@ -1437,7 +1437,7 @@ PyDoc_STRVAR(os_unlink__doc__, " If it is unavailable, using it will raise a NotImplementedError."); #define OS_UNLINK_METHODDEF \ - {"unlink", (PyCFunction)os_unlink, METH_FASTCALL|METH_KEYWORDS, os_unlink__doc__}, + {"unlink", (PyCFunction)(void(*)(void))os_unlink, METH_FASTCALL|METH_KEYWORDS, os_unlink__doc__}, static PyObject * os_unlink_impl(PyObject *module, path_t *path, int dir_fd); @@ -1476,7 +1476,7 @@ PyDoc_STRVAR(os_remove__doc__, " If it is unavailable, using it will raise a NotImplementedError."); #define OS_REMOVE_METHODDEF \ - {"remove", (PyCFunction)os_remove, METH_FASTCALL|METH_KEYWORDS, os_remove__doc__}, + {"remove", (PyCFunction)(void(*)(void))os_remove, METH_FASTCALL|METH_KEYWORDS, os_remove__doc__}, static PyObject * os_remove_impl(PyObject *module, path_t *path, int dir_fd); @@ -1558,7 +1558,7 @@ PyDoc_STRVAR(os_utime__doc__, " If they are unavailable, using them will raise a NotImplementedError."); #define OS_UTIME_METHODDEF \ - {"utime", (PyCFunction)os_utime, METH_FASTCALL|METH_KEYWORDS, os_utime__doc__}, + {"utime", (PyCFunction)(void(*)(void))os_utime, METH_FASTCALL|METH_KEYWORDS, os_utime__doc__}, static PyObject * os_utime_impl(PyObject *module, path_t *path, PyObject *times, PyObject *ns, @@ -1596,7 +1596,7 @@ PyDoc_STRVAR(os__exit__doc__, "Exit to the system with specified status, without normal exit processing."); #define OS__EXIT_METHODDEF \ - {"_exit", (PyCFunction)os__exit, METH_FASTCALL|METH_KEYWORDS, os__exit__doc__}, + {"_exit", (PyCFunction)(void(*)(void))os__exit, METH_FASTCALL|METH_KEYWORDS, os__exit__doc__}, static PyObject * os__exit_impl(PyObject *module, int status); @@ -1633,7 +1633,7 @@ PyDoc_STRVAR(os_execv__doc__, " Tuple or list of strings."); #define OS_EXECV_METHODDEF \ - {"execv", (PyCFunction)os_execv, METH_FASTCALL, os_execv__doc__}, + {"execv", (PyCFunction)(void(*)(void))os_execv, METH_FASTCALL, os_execv__doc__}, static PyObject * os_execv_impl(PyObject *module, path_t *path, PyObject *argv); @@ -1676,7 +1676,7 @@ PyDoc_STRVAR(os_execve__doc__, " Dictionary of strings mapping to strings."); #define OS_EXECVE_METHODDEF \ - {"execve", (PyCFunction)os_execve, METH_FASTCALL|METH_KEYWORDS, os_execve__doc__}, + {"execve", (PyCFunction)(void(*)(void))os_execve, METH_FASTCALL|METH_KEYWORDS, os_execve__doc__}, static PyObject * os_execve_impl(PyObject *module, path_t *path, PyObject *argv, PyObject *env); @@ -1736,7 +1736,7 @@ PyDoc_STRVAR(os_posix_spawn__doc__, " A tuple with the scheduler policy (optional) and parameters."); #define OS_POSIX_SPAWN_METHODDEF \ - {"posix_spawn", (PyCFunction)os_posix_spawn, METH_FASTCALL|METH_KEYWORDS, os_posix_spawn__doc__}, + {"posix_spawn", (PyCFunction)(void(*)(void))os_posix_spawn, METH_FASTCALL|METH_KEYWORDS, os_posix_spawn__doc__}, static PyObject * os_posix_spawn_impl(PyObject *module, path_t *path, PyObject *argv, @@ -1791,7 +1791,7 @@ PyDoc_STRVAR(os_spawnv__doc__, " Tuple or list of strings."); #define OS_SPAWNV_METHODDEF \ - {"spawnv", (PyCFunction)os_spawnv, METH_FASTCALL, os_spawnv__doc__}, + {"spawnv", (PyCFunction)(void(*)(void))os_spawnv, METH_FASTCALL, os_spawnv__doc__}, static PyObject * os_spawnv_impl(PyObject *module, int mode, path_t *path, PyObject *argv); @@ -1837,7 +1837,7 @@ PyDoc_STRVAR(os_spawnve__doc__, " Dictionary of strings mapping to strings."); #define OS_SPAWNVE_METHODDEF \ - {"spawnve", (PyCFunction)os_spawnve, METH_FASTCALL, os_spawnve__doc__}, + {"spawnve", (PyCFunction)(void(*)(void))os_spawnve, METH_FASTCALL, os_spawnve__doc__}, static PyObject * os_spawnve_impl(PyObject *module, int mode, path_t *path, PyObject *argv, @@ -1887,7 +1887,7 @@ PyDoc_STRVAR(os_register_at_fork__doc__, "\'after_in_child\' and \'after_in_parent\' callbacks are called in order."); #define OS_REGISTER_AT_FORK_METHODDEF \ - {"register_at_fork", (PyCFunction)os_register_at_fork, METH_FASTCALL|METH_KEYWORDS, os_register_at_fork__doc__}, + {"register_at_fork", (PyCFunction)(void(*)(void))os_register_at_fork, METH_FASTCALL|METH_KEYWORDS, os_register_at_fork__doc__}, static PyObject * os_register_at_fork_impl(PyObject *module, PyObject *before, @@ -1972,7 +1972,7 @@ PyDoc_STRVAR(os_sched_get_priority_max__doc__, "Get the maximum scheduling priority for policy."); #define OS_SCHED_GET_PRIORITY_MAX_METHODDEF \ - {"sched_get_priority_max", (PyCFunction)os_sched_get_priority_max, METH_FASTCALL|METH_KEYWORDS, os_sched_get_priority_max__doc__}, + {"sched_get_priority_max", (PyCFunction)(void(*)(void))os_sched_get_priority_max, METH_FASTCALL|METH_KEYWORDS, os_sched_get_priority_max__doc__}, static PyObject * os_sched_get_priority_max_impl(PyObject *module, int policy); @@ -2006,7 +2006,7 @@ PyDoc_STRVAR(os_sched_get_priority_min__doc__, "Get the minimum scheduling priority for policy."); #define OS_SCHED_GET_PRIORITY_MIN_METHODDEF \ - {"sched_get_priority_min", (PyCFunction)os_sched_get_priority_min, METH_FASTCALL|METH_KEYWORDS, os_sched_get_priority_min__doc__}, + {"sched_get_priority_min", (PyCFunction)(void(*)(void))os_sched_get_priority_min, METH_FASTCALL|METH_KEYWORDS, os_sched_get_priority_min__doc__}, static PyObject * os_sched_get_priority_min_impl(PyObject *module, int policy); @@ -2110,7 +2110,7 @@ PyDoc_STRVAR(os_sched_setscheduler__doc__, "param is an instance of sched_param."); #define OS_SCHED_SETSCHEDULER_METHODDEF \ - {"sched_setscheduler", (PyCFunction)os_sched_setscheduler, METH_FASTCALL, os_sched_setscheduler__doc__}, + {"sched_setscheduler", (PyCFunction)(void(*)(void))os_sched_setscheduler, METH_FASTCALL, os_sched_setscheduler__doc__}, static PyObject * os_sched_setscheduler_impl(PyObject *module, pid_t pid, int policy, @@ -2182,7 +2182,7 @@ PyDoc_STRVAR(os_sched_setparam__doc__, "param should be an instance of sched_param."); #define OS_SCHED_SETPARAM_METHODDEF \ - {"sched_setparam", (PyCFunction)os_sched_setparam, METH_FASTCALL, os_sched_setparam__doc__}, + {"sched_setparam", (PyCFunction)(void(*)(void))os_sched_setparam, METH_FASTCALL, os_sched_setparam__doc__}, static PyObject * os_sched_setparam_impl(PyObject *module, pid_t pid, @@ -2278,7 +2278,7 @@ PyDoc_STRVAR(os_sched_setaffinity__doc__, "mask should be an iterable of integers identifying CPUs."); #define OS_SCHED_SETAFFINITY_METHODDEF \ - {"sched_setaffinity", (PyCFunction)os_sched_setaffinity, METH_FASTCALL, os_sched_setaffinity__doc__}, + {"sched_setaffinity", (PyCFunction)(void(*)(void))os_sched_setaffinity, METH_FASTCALL, os_sched_setaffinity__doc__}, static PyObject * os_sched_setaffinity_impl(PyObject *module, pid_t pid, PyObject *mask); @@ -2506,7 +2506,7 @@ PyDoc_STRVAR(os_getpgid__doc__, "Call the system call getpgid(), and return the result."); #define OS_GETPGID_METHODDEF \ - {"getpgid", (PyCFunction)os_getpgid, METH_FASTCALL|METH_KEYWORDS, os_getpgid__doc__}, + {"getpgid", (PyCFunction)(void(*)(void))os_getpgid, METH_FASTCALL|METH_KEYWORDS, os_getpgid__doc__}, static PyObject * os_getpgid_impl(PyObject *module, pid_t pid); @@ -2653,7 +2653,7 @@ PyDoc_STRVAR(os_kill__doc__, "Kill a process with a signal."); #define OS_KILL_METHODDEF \ - {"kill", (PyCFunction)os_kill, METH_FASTCALL, os_kill__doc__}, + {"kill", (PyCFunction)(void(*)(void))os_kill, METH_FASTCALL, os_kill__doc__}, static PyObject * os_kill_impl(PyObject *module, pid_t pid, Py_ssize_t signal); @@ -2686,7 +2686,7 @@ PyDoc_STRVAR(os_killpg__doc__, "Kill a process group with a signal."); #define OS_KILLPG_METHODDEF \ - {"killpg", (PyCFunction)os_killpg, METH_FASTCALL, os_killpg__doc__}, + {"killpg", (PyCFunction)(void(*)(void))os_killpg, METH_FASTCALL, os_killpg__doc__}, static PyObject * os_killpg_impl(PyObject *module, pid_t pgid, int signal); @@ -2843,7 +2843,7 @@ PyDoc_STRVAR(os_setreuid__doc__, "Set the current process\'s real and effective user ids."); #define OS_SETREUID_METHODDEF \ - {"setreuid", (PyCFunction)os_setreuid, METH_FASTCALL, os_setreuid__doc__}, + {"setreuid", (PyCFunction)(void(*)(void))os_setreuid, METH_FASTCALL, os_setreuid__doc__}, static PyObject * os_setreuid_impl(PyObject *module, uid_t ruid, uid_t euid); @@ -2876,7 +2876,7 @@ PyDoc_STRVAR(os_setregid__doc__, "Set the current process\'s real and effective group ids."); #define OS_SETREGID_METHODDEF \ - {"setregid", (PyCFunction)os_setregid, METH_FASTCALL, os_setregid__doc__}, + {"setregid", (PyCFunction)(void(*)(void))os_setregid, METH_FASTCALL, os_setregid__doc__}, static PyObject * os_setregid_impl(PyObject *module, gid_t rgid, gid_t egid); @@ -2956,7 +2956,7 @@ PyDoc_STRVAR(os_wait3__doc__, " (pid, status, rusage)"); #define OS_WAIT3_METHODDEF \ - {"wait3", (PyCFunction)os_wait3, METH_FASTCALL|METH_KEYWORDS, os_wait3__doc__}, + {"wait3", (PyCFunction)(void(*)(void))os_wait3, METH_FASTCALL|METH_KEYWORDS, os_wait3__doc__}, static PyObject * os_wait3_impl(PyObject *module, int options); @@ -2993,7 +2993,7 @@ PyDoc_STRVAR(os_wait4__doc__, " (pid, status, rusage)"); #define OS_WAIT4_METHODDEF \ - {"wait4", (PyCFunction)os_wait4, METH_FASTCALL|METH_KEYWORDS, os_wait4__doc__}, + {"wait4", (PyCFunction)(void(*)(void))os_wait4, METH_FASTCALL|METH_KEYWORDS, os_wait4__doc__}, static PyObject * os_wait4_impl(PyObject *module, pid_t pid, int options); @@ -3039,7 +3039,7 @@ PyDoc_STRVAR(os_waitid__doc__, "no children in a waitable state."); #define OS_WAITID_METHODDEF \ - {"waitid", (PyCFunction)os_waitid, METH_FASTCALL, os_waitid__doc__}, + {"waitid", (PyCFunction)(void(*)(void))os_waitid, METH_FASTCALL, os_waitid__doc__}, static PyObject * os_waitid_impl(PyObject *module, idtype_t idtype, id_t id, int options); @@ -3078,7 +3078,7 @@ PyDoc_STRVAR(os_waitpid__doc__, "The options argument is ignored on Windows."); #define OS_WAITPID_METHODDEF \ - {"waitpid", (PyCFunction)os_waitpid, METH_FASTCALL, os_waitpid__doc__}, + {"waitpid", (PyCFunction)(void(*)(void))os_waitpid, METH_FASTCALL, os_waitpid__doc__}, static PyObject * os_waitpid_impl(PyObject *module, pid_t pid, int options); @@ -3116,7 +3116,7 @@ PyDoc_STRVAR(os_waitpid__doc__, "The options argument is ignored on Windows."); #define OS_WAITPID_METHODDEF \ - {"waitpid", (PyCFunction)os_waitpid, METH_FASTCALL, os_waitpid__doc__}, + {"waitpid", (PyCFunction)(void(*)(void))os_waitpid, METH_FASTCALL, os_waitpid__doc__}, static PyObject * os_waitpid_impl(PyObject *module, intptr_t pid, int options); @@ -3180,7 +3180,7 @@ PyDoc_STRVAR(os_readlink__doc__, "using it will raise a NotImplementedError."); #define OS_READLINK_METHODDEF \ - {"readlink", (PyCFunction)os_readlink, METH_FASTCALL|METH_KEYWORDS, os_readlink__doc__}, + {"readlink", (PyCFunction)(void(*)(void))os_readlink, METH_FASTCALL|METH_KEYWORDS, os_readlink__doc__}, static PyObject * os_readlink_impl(PyObject *module, path_t *path, int dir_fd); @@ -3228,7 +3228,7 @@ PyDoc_STRVAR(os_symlink__doc__, " If it is unavailable, using it will raise a NotImplementedError."); #define OS_SYMLINK_METHODDEF \ - {"symlink", (PyCFunction)os_symlink, METH_FASTCALL|METH_KEYWORDS, os_symlink__doc__}, + {"symlink", (PyCFunction)(void(*)(void))os_symlink, METH_FASTCALL|METH_KEYWORDS, os_symlink__doc__}, static PyObject * os_symlink_impl(PyObject *module, path_t *src, path_t *dst, @@ -3350,7 +3350,7 @@ PyDoc_STRVAR(os_setpgid__doc__, "Call the system call setpgid(pid, pgrp)."); #define OS_SETPGID_METHODDEF \ - {"setpgid", (PyCFunction)os_setpgid, METH_FASTCALL, os_setpgid__doc__}, + {"setpgid", (PyCFunction)(void(*)(void))os_setpgid, METH_FASTCALL, os_setpgid__doc__}, static PyObject * os_setpgid_impl(PyObject *module, pid_t pid, pid_t pgrp); @@ -3414,7 +3414,7 @@ PyDoc_STRVAR(os_tcsetpgrp__doc__, "Set the process group associated with the terminal specified by fd."); #define OS_TCSETPGRP_METHODDEF \ - {"tcsetpgrp", (PyCFunction)os_tcsetpgrp, METH_FASTCALL, os_tcsetpgrp__doc__}, + {"tcsetpgrp", (PyCFunction)(void(*)(void))os_tcsetpgrp, METH_FASTCALL, os_tcsetpgrp__doc__}, static PyObject * os_tcsetpgrp_impl(PyObject *module, int fd, pid_t pgid); @@ -3450,7 +3450,7 @@ PyDoc_STRVAR(os_open__doc__, " If it is unavailable, using it will raise a NotImplementedError."); #define OS_OPEN_METHODDEF \ - {"open", (PyCFunction)os_open, METH_FASTCALL|METH_KEYWORDS, os_open__doc__}, + {"open", (PyCFunction)(void(*)(void))os_open, METH_FASTCALL|METH_KEYWORDS, os_open__doc__}, static int os_open_impl(PyObject *module, path_t *path, int flags, int mode, int dir_fd); @@ -3491,7 +3491,7 @@ PyDoc_STRVAR(os_close__doc__, "Close a file descriptor."); #define OS_CLOSE_METHODDEF \ - {"close", (PyCFunction)os_close, METH_FASTCALL|METH_KEYWORDS, os_close__doc__}, + {"close", (PyCFunction)(void(*)(void))os_close, METH_FASTCALL|METH_KEYWORDS, os_close__doc__}, static PyObject * os_close_impl(PyObject *module, int fd); @@ -3521,7 +3521,7 @@ PyDoc_STRVAR(os_closerange__doc__, "Closes all file descriptors in [fd_low, fd_high), ignoring errors."); #define OS_CLOSERANGE_METHODDEF \ - {"closerange", (PyCFunction)os_closerange, METH_FASTCALL, os_closerange__doc__}, + {"closerange", (PyCFunction)(void(*)(void))os_closerange, METH_FASTCALL, os_closerange__doc__}, static PyObject * os_closerange_impl(PyObject *module, int fd_low, int fd_high); @@ -3582,7 +3582,7 @@ PyDoc_STRVAR(os_dup2__doc__, "Duplicate file descriptor."); #define OS_DUP2_METHODDEF \ - {"dup2", (PyCFunction)os_dup2, METH_FASTCALL|METH_KEYWORDS, os_dup2__doc__}, + {"dup2", (PyCFunction)(void(*)(void))os_dup2, METH_FASTCALL|METH_KEYWORDS, os_dup2__doc__}, static int os_dup2_impl(PyObject *module, int fd, int fd2, int inheritable); @@ -3628,7 +3628,7 @@ PyDoc_STRVAR(os_lockf__doc__, " The number of bytes to lock, starting at the current position."); #define OS_LOCKF_METHODDEF \ - {"lockf", (PyCFunction)os_lockf, METH_FASTCALL, os_lockf__doc__}, + {"lockf", (PyCFunction)(void(*)(void))os_lockf, METH_FASTCALL, os_lockf__doc__}, static PyObject * os_lockf_impl(PyObject *module, int fd, int command, Py_off_t length); @@ -3663,7 +3663,7 @@ PyDoc_STRVAR(os_lseek__doc__, "relative to the beginning of the file."); #define OS_LSEEK_METHODDEF \ - {"lseek", (PyCFunction)os_lseek, METH_FASTCALL, os_lseek__doc__}, + {"lseek", (PyCFunction)(void(*)(void))os_lseek, METH_FASTCALL, os_lseek__doc__}, static Py_off_t os_lseek_impl(PyObject *module, int fd, Py_off_t position, int how); @@ -3698,7 +3698,7 @@ PyDoc_STRVAR(os_read__doc__, "Read from a file descriptor. Returns a bytes object."); #define OS_READ_METHODDEF \ - {"read", (PyCFunction)os_read, METH_FASTCALL, os_read__doc__}, + {"read", (PyCFunction)(void(*)(void))os_read, METH_FASTCALL, os_read__doc__}, static PyObject * os_read_impl(PyObject *module, int fd, Py_ssize_t length); @@ -3737,7 +3737,7 @@ PyDoc_STRVAR(os_readv__doc__, "which may be less than the total capacity of all the buffers."); #define OS_READV_METHODDEF \ - {"readv", (PyCFunction)os_readv, METH_FASTCALL, os_readv__doc__}, + {"readv", (PyCFunction)(void(*)(void))os_readv, METH_FASTCALL, os_readv__doc__}, static Py_ssize_t os_readv_impl(PyObject *module, int fd, PyObject *buffers); @@ -3778,7 +3778,7 @@ PyDoc_STRVAR(os_pread__doc__, "the beginning of the file. The file offset remains unchanged."); #define OS_PREAD_METHODDEF \ - {"pread", (PyCFunction)os_pread, METH_FASTCALL, os_pread__doc__}, + {"pread", (PyCFunction)(void(*)(void))os_pread, METH_FASTCALL, os_pread__doc__}, static PyObject * os_pread_impl(PyObject *module, int fd, int length, Py_off_t offset); @@ -3826,7 +3826,7 @@ PyDoc_STRVAR(os_preadv__doc__, "Using non-zero flags requires Linux 4.6 or newer."); #define OS_PREADV_METHODDEF \ - {"preadv", (PyCFunction)os_preadv, METH_FASTCALL, os_preadv__doc__}, + {"preadv", (PyCFunction)(void(*)(void))os_preadv, METH_FASTCALL, os_preadv__doc__}, static Py_ssize_t os_preadv_impl(PyObject *module, int fd, PyObject *buffers, Py_off_t offset, @@ -3865,7 +3865,7 @@ PyDoc_STRVAR(os_write__doc__, "Write a bytes object to a file descriptor."); #define OS_WRITE_METHODDEF \ - {"write", (PyCFunction)os_write, METH_FASTCALL, os_write__doc__}, + {"write", (PyCFunction)(void(*)(void))os_write, METH_FASTCALL, os_write__doc__}, static Py_ssize_t os_write_impl(PyObject *module, int fd, Py_buffer *data); @@ -3906,7 +3906,7 @@ PyDoc_STRVAR(os__fcopyfile__doc__, "Efficiently copy content or metadata of 2 regular file descriptors (macOS)."); #define OS__FCOPYFILE_METHODDEF \ - {"_fcopyfile", (PyCFunction)os__fcopyfile, METH_FASTCALL, os__fcopyfile__doc__}, + {"_fcopyfile", (PyCFunction)(void(*)(void))os__fcopyfile, METH_FASTCALL, os__fcopyfile__doc__}, static PyObject * os__fcopyfile_impl(PyObject *module, int infd, int outfd, int flags); @@ -3941,7 +3941,7 @@ PyDoc_STRVAR(os_fstat__doc__, "Equivalent to os.stat(fd)."); #define OS_FSTAT_METHODDEF \ - {"fstat", (PyCFunction)os_fstat, METH_FASTCALL|METH_KEYWORDS, os_fstat__doc__}, + {"fstat", (PyCFunction)(void(*)(void))os_fstat, METH_FASTCALL|METH_KEYWORDS, os_fstat__doc__}, static PyObject * os_fstat_impl(PyObject *module, int fd); @@ -4073,7 +4073,7 @@ PyDoc_STRVAR(os_writev__doc__, "buffers must be a sequence of bytes-like objects."); #define OS_WRITEV_METHODDEF \ - {"writev", (PyCFunction)os_writev, METH_FASTCALL, os_writev__doc__}, + {"writev", (PyCFunction)(void(*)(void))os_writev, METH_FASTCALL, os_writev__doc__}, static Py_ssize_t os_writev_impl(PyObject *module, int fd, PyObject *buffers); @@ -4115,7 +4115,7 @@ PyDoc_STRVAR(os_pwrite__doc__, "current file offset."); #define OS_PWRITE_METHODDEF \ - {"pwrite", (PyCFunction)os_pwrite, METH_FASTCALL, os_pwrite__doc__}, + {"pwrite", (PyCFunction)(void(*)(void))os_pwrite, METH_FASTCALL, os_pwrite__doc__}, static Py_ssize_t os_pwrite_impl(PyObject *module, int fd, Py_buffer *buffer, Py_off_t offset); @@ -4173,7 +4173,7 @@ PyDoc_STRVAR(os_pwritev__doc__, "Using non-zero flags requires Linux 4.7 or newer."); #define OS_PWRITEV_METHODDEF \ - {"pwritev", (PyCFunction)os_pwritev, METH_FASTCALL, os_pwritev__doc__}, + {"pwritev", (PyCFunction)(void(*)(void))os_pwritev, METH_FASTCALL, os_pwritev__doc__}, static Py_ssize_t os_pwritev_impl(PyObject *module, int fd, PyObject *buffers, Py_off_t offset, @@ -4219,7 +4219,7 @@ PyDoc_STRVAR(os_mkfifo__doc__, " If it is unavailable, using it will raise a NotImplementedError."); #define OS_MKFIFO_METHODDEF \ - {"mkfifo", (PyCFunction)os_mkfifo, METH_FASTCALL|METH_KEYWORDS, os_mkfifo__doc__}, + {"mkfifo", (PyCFunction)(void(*)(void))os_mkfifo, METH_FASTCALL|METH_KEYWORDS, os_mkfifo__doc__}, static PyObject * os_mkfifo_impl(PyObject *module, path_t *path, int mode, int dir_fd); @@ -4270,7 +4270,7 @@ PyDoc_STRVAR(os_mknod__doc__, " If it is unavailable, using it will raise a NotImplementedError."); #define OS_MKNOD_METHODDEF \ - {"mknod", (PyCFunction)os_mknod, METH_FASTCALL|METH_KEYWORDS, os_mknod__doc__}, + {"mknod", (PyCFunction)(void(*)(void))os_mknod, METH_FASTCALL|METH_KEYWORDS, os_mknod__doc__}, static PyObject * os_mknod_impl(PyObject *module, path_t *path, int mode, dev_t device, @@ -4383,7 +4383,7 @@ PyDoc_STRVAR(os_makedev__doc__, "Composes a raw device number from the major and minor device numbers."); #define OS_MAKEDEV_METHODDEF \ - {"makedev", (PyCFunction)os_makedev, METH_FASTCALL, os_makedev__doc__}, + {"makedev", (PyCFunction)(void(*)(void))os_makedev, METH_FASTCALL, os_makedev__doc__}, static dev_t os_makedev_impl(PyObject *module, int major, int minor); @@ -4421,7 +4421,7 @@ PyDoc_STRVAR(os_ftruncate__doc__, "Truncate a file, specified by file descriptor, to a specific length."); #define OS_FTRUNCATE_METHODDEF \ - {"ftruncate", (PyCFunction)os_ftruncate, METH_FASTCALL, os_ftruncate__doc__}, + {"ftruncate", (PyCFunction)(void(*)(void))os_ftruncate, METH_FASTCALL, os_ftruncate__doc__}, static PyObject * os_ftruncate_impl(PyObject *module, int fd, Py_off_t length); @@ -4457,7 +4457,7 @@ PyDoc_STRVAR(os_truncate__doc__, " If this functionality is unavailable, using it raises an exception."); #define OS_TRUNCATE_METHODDEF \ - {"truncate", (PyCFunction)os_truncate, METH_FASTCALL|METH_KEYWORDS, os_truncate__doc__}, + {"truncate", (PyCFunction)(void(*)(void))os_truncate, METH_FASTCALL|METH_KEYWORDS, os_truncate__doc__}, static PyObject * os_truncate_impl(PyObject *module, path_t *path, Py_off_t length); @@ -4498,7 +4498,7 @@ PyDoc_STRVAR(os_posix_fallocate__doc__, "starting at offset bytes from the beginning and continuing for length bytes."); #define OS_POSIX_FALLOCATE_METHODDEF \ - {"posix_fallocate", (PyCFunction)os_posix_fallocate, METH_FASTCALL, os_posix_fallocate__doc__}, + {"posix_fallocate", (PyCFunction)(void(*)(void))os_posix_fallocate, METH_FASTCALL, os_posix_fallocate__doc__}, static PyObject * os_posix_fallocate_impl(PyObject *module, int fd, Py_off_t offset, @@ -4541,7 +4541,7 @@ PyDoc_STRVAR(os_posix_fadvise__doc__, "POSIX_FADV_DONTNEED."); #define OS_POSIX_FADVISE_METHODDEF \ - {"posix_fadvise", (PyCFunction)os_posix_fadvise, METH_FASTCALL, os_posix_fadvise__doc__}, + {"posix_fadvise", (PyCFunction)(void(*)(void))os_posix_fadvise, METH_FASTCALL, os_posix_fadvise__doc__}, static PyObject * os_posix_fadvise_impl(PyObject *module, int fd, Py_off_t offset, @@ -4577,7 +4577,7 @@ PyDoc_STRVAR(os_putenv__doc__, "Change or add an environment variable."); #define OS_PUTENV_METHODDEF \ - {"putenv", (PyCFunction)os_putenv, METH_FASTCALL, os_putenv__doc__}, + {"putenv", (PyCFunction)(void(*)(void))os_putenv, METH_FASTCALL, os_putenv__doc__}, static PyObject * os_putenv_impl(PyObject *module, PyObject *name, PyObject *value); @@ -4610,7 +4610,7 @@ PyDoc_STRVAR(os_putenv__doc__, "Change or add an environment variable."); #define OS_PUTENV_METHODDEF \ - {"putenv", (PyCFunction)os_putenv, METH_FASTCALL, os_putenv__doc__}, + {"putenv", (PyCFunction)(void(*)(void))os_putenv, METH_FASTCALL, os_putenv__doc__}, static PyObject * os_putenv_impl(PyObject *module, PyObject *name, PyObject *value); @@ -4748,7 +4748,7 @@ PyDoc_STRVAR(os_WIFCONTINUED__doc__, "job control stop."); #define OS_WIFCONTINUED_METHODDEF \ - {"WIFCONTINUED", (PyCFunction)os_WIFCONTINUED, METH_FASTCALL|METH_KEYWORDS, os_WIFCONTINUED__doc__}, + {"WIFCONTINUED", (PyCFunction)(void(*)(void))os_WIFCONTINUED, METH_FASTCALL|METH_KEYWORDS, os_WIFCONTINUED__doc__}, static int os_WIFCONTINUED_impl(PyObject *module, int status); @@ -4787,7 +4787,7 @@ PyDoc_STRVAR(os_WIFSTOPPED__doc__, "Return True if the process returning status was stopped."); #define OS_WIFSTOPPED_METHODDEF \ - {"WIFSTOPPED", (PyCFunction)os_WIFSTOPPED, METH_FASTCALL|METH_KEYWORDS, os_WIFSTOPPED__doc__}, + {"WIFSTOPPED", (PyCFunction)(void(*)(void))os_WIFSTOPPED, METH_FASTCALL|METH_KEYWORDS, os_WIFSTOPPED__doc__}, static int os_WIFSTOPPED_impl(PyObject *module, int status); @@ -4826,7 +4826,7 @@ PyDoc_STRVAR(os_WIFSIGNALED__doc__, "Return True if the process returning status was terminated by a signal."); #define OS_WIFSIGNALED_METHODDEF \ - {"WIFSIGNALED", (PyCFunction)os_WIFSIGNALED, METH_FASTCALL|METH_KEYWORDS, os_WIFSIGNALED__doc__}, + {"WIFSIGNALED", (PyCFunction)(void(*)(void))os_WIFSIGNALED, METH_FASTCALL|METH_KEYWORDS, os_WIFSIGNALED__doc__}, static int os_WIFSIGNALED_impl(PyObject *module, int status); @@ -4865,7 +4865,7 @@ PyDoc_STRVAR(os_WIFEXITED__doc__, "Return True if the process returning status exited via the exit() system call."); #define OS_WIFEXITED_METHODDEF \ - {"WIFEXITED", (PyCFunction)os_WIFEXITED, METH_FASTCALL|METH_KEYWORDS, os_WIFEXITED__doc__}, + {"WIFEXITED", (PyCFunction)(void(*)(void))os_WIFEXITED, METH_FASTCALL|METH_KEYWORDS, os_WIFEXITED__doc__}, static int os_WIFEXITED_impl(PyObject *module, int status); @@ -4904,7 +4904,7 @@ PyDoc_STRVAR(os_WEXITSTATUS__doc__, "Return the process return code from status."); #define OS_WEXITSTATUS_METHODDEF \ - {"WEXITSTATUS", (PyCFunction)os_WEXITSTATUS, METH_FASTCALL|METH_KEYWORDS, os_WEXITSTATUS__doc__}, + {"WEXITSTATUS", (PyCFunction)(void(*)(void))os_WEXITSTATUS, METH_FASTCALL|METH_KEYWORDS, os_WEXITSTATUS__doc__}, static int os_WEXITSTATUS_impl(PyObject *module, int status); @@ -4943,7 +4943,7 @@ PyDoc_STRVAR(os_WTERMSIG__doc__, "Return the signal that terminated the process that provided the status value."); #define OS_WTERMSIG_METHODDEF \ - {"WTERMSIG", (PyCFunction)os_WTERMSIG, METH_FASTCALL|METH_KEYWORDS, os_WTERMSIG__doc__}, + {"WTERMSIG", (PyCFunction)(void(*)(void))os_WTERMSIG, METH_FASTCALL|METH_KEYWORDS, os_WTERMSIG__doc__}, static int os_WTERMSIG_impl(PyObject *module, int status); @@ -4982,7 +4982,7 @@ PyDoc_STRVAR(os_WSTOPSIG__doc__, "Return the signal that stopped the process that provided the status value."); #define OS_WSTOPSIG_METHODDEF \ - {"WSTOPSIG", (PyCFunction)os_WSTOPSIG, METH_FASTCALL|METH_KEYWORDS, os_WSTOPSIG__doc__}, + {"WSTOPSIG", (PyCFunction)(void(*)(void))os_WSTOPSIG, METH_FASTCALL|METH_KEYWORDS, os_WSTOPSIG__doc__}, static int os_WSTOPSIG_impl(PyObject *module, int status); @@ -5058,7 +5058,7 @@ PyDoc_STRVAR(os_statvfs__doc__, " If this functionality is unavailable, using it raises an exception."); #define OS_STATVFS_METHODDEF \ - {"statvfs", (PyCFunction)os_statvfs, METH_FASTCALL|METH_KEYWORDS, os_statvfs__doc__}, + {"statvfs", (PyCFunction)(void(*)(void))os_statvfs, METH_FASTCALL|METH_KEYWORDS, os_statvfs__doc__}, static PyObject * os_statvfs_impl(PyObject *module, path_t *path); @@ -5095,7 +5095,7 @@ PyDoc_STRVAR(os__getdiskusage__doc__, "Return disk usage statistics about the given path as a (total, free) tuple."); #define OS__GETDISKUSAGE_METHODDEF \ - {"_getdiskusage", (PyCFunction)os__getdiskusage, METH_FASTCALL|METH_KEYWORDS, os__getdiskusage__doc__}, + {"_getdiskusage", (PyCFunction)(void(*)(void))os__getdiskusage, METH_FASTCALL|METH_KEYWORDS, os__getdiskusage__doc__}, static PyObject * os__getdiskusage_impl(PyObject *module, path_t *path); @@ -5134,7 +5134,7 @@ PyDoc_STRVAR(os_fpathconf__doc__, "If there is no limit, return -1."); #define OS_FPATHCONF_METHODDEF \ - {"fpathconf", (PyCFunction)os_fpathconf, METH_FASTCALL, os_fpathconf__doc__}, + {"fpathconf", (PyCFunction)(void(*)(void))os_fpathconf, METH_FASTCALL, os_fpathconf__doc__}, static long os_fpathconf_impl(PyObject *module, int fd, int name); @@ -5176,7 +5176,7 @@ PyDoc_STRVAR(os_pathconf__doc__, " If this functionality is unavailable, using it raises an exception."); #define OS_PATHCONF_METHODDEF \ - {"pathconf", (PyCFunction)os_pathconf, METH_FASTCALL|METH_KEYWORDS, os_pathconf__doc__}, + {"pathconf", (PyCFunction)(void(*)(void))os_pathconf, METH_FASTCALL|METH_KEYWORDS, os_pathconf__doc__}, static long os_pathconf_impl(PyObject *module, path_t *path, int name); @@ -5324,7 +5324,7 @@ PyDoc_STRVAR(os_startfile__doc__, "the underlying Win32 ShellExecute function doesn\'t work if it is."); #define OS_STARTFILE_METHODDEF \ - {"startfile", (PyCFunction)os_startfile, METH_FASTCALL|METH_KEYWORDS, os_startfile__doc__}, + {"startfile", (PyCFunction)(void(*)(void))os_startfile, METH_FASTCALL|METH_KEYWORDS, os_startfile__doc__}, static PyObject * os_startfile_impl(PyObject *module, path_t *filepath, Py_UNICODE *operation); @@ -5389,7 +5389,7 @@ PyDoc_STRVAR(os_device_encoding__doc__, "If the device is not a terminal, return None."); #define OS_DEVICE_ENCODING_METHODDEF \ - {"device_encoding", (PyCFunction)os_device_encoding, METH_FASTCALL|METH_KEYWORDS, os_device_encoding__doc__}, + {"device_encoding", (PyCFunction)(void(*)(void))os_device_encoding, METH_FASTCALL|METH_KEYWORDS, os_device_encoding__doc__}, static PyObject * os_device_encoding_impl(PyObject *module, int fd); @@ -5421,7 +5421,7 @@ PyDoc_STRVAR(os_setresuid__doc__, "Set the current process\'s real, effective, and saved user ids."); #define OS_SETRESUID_METHODDEF \ - {"setresuid", (PyCFunction)os_setresuid, METH_FASTCALL, os_setresuid__doc__}, + {"setresuid", (PyCFunction)(void(*)(void))os_setresuid, METH_FASTCALL, os_setresuid__doc__}, static PyObject * os_setresuid_impl(PyObject *module, uid_t ruid, uid_t euid, uid_t suid); @@ -5455,7 +5455,7 @@ PyDoc_STRVAR(os_setresgid__doc__, "Set the current process\'s real, effective, and saved group ids."); #define OS_SETRESGID_METHODDEF \ - {"setresgid", (PyCFunction)os_setresgid, METH_FASTCALL, os_setresgid__doc__}, + {"setresgid", (PyCFunction)(void(*)(void))os_setresgid, METH_FASTCALL, os_setresgid__doc__}, static PyObject * os_setresgid_impl(PyObject *module, gid_t rgid, gid_t egid, gid_t sgid); @@ -5538,7 +5538,7 @@ PyDoc_STRVAR(os_getxattr__doc__, " the link points to."); #define OS_GETXATTR_METHODDEF \ - {"getxattr", (PyCFunction)os_getxattr, METH_FASTCALL|METH_KEYWORDS, os_getxattr__doc__}, + {"getxattr", (PyCFunction)(void(*)(void))os_getxattr, METH_FASTCALL|METH_KEYWORDS, os_getxattr__doc__}, static PyObject * os_getxattr_impl(PyObject *module, path_t *path, path_t *attribute, @@ -5586,7 +5586,7 @@ PyDoc_STRVAR(os_setxattr__doc__, " the link points to."); #define OS_SETXATTR_METHODDEF \ - {"setxattr", (PyCFunction)os_setxattr, METH_FASTCALL|METH_KEYWORDS, os_setxattr__doc__}, + {"setxattr", (PyCFunction)(void(*)(void))os_setxattr, METH_FASTCALL|METH_KEYWORDS, os_setxattr__doc__}, static PyObject * os_setxattr_impl(PyObject *module, path_t *path, path_t *attribute, @@ -5639,7 +5639,7 @@ PyDoc_STRVAR(os_removexattr__doc__, " the link points to."); #define OS_REMOVEXATTR_METHODDEF \ - {"removexattr", (PyCFunction)os_removexattr, METH_FASTCALL|METH_KEYWORDS, os_removexattr__doc__}, + {"removexattr", (PyCFunction)(void(*)(void))os_removexattr, METH_FASTCALL|METH_KEYWORDS, os_removexattr__doc__}, static PyObject * os_removexattr_impl(PyObject *module, path_t *path, path_t *attribute, @@ -5687,7 +5687,7 @@ PyDoc_STRVAR(os_listxattr__doc__, " the link points to."); #define OS_LISTXATTR_METHODDEF \ - {"listxattr", (PyCFunction)os_listxattr, METH_FASTCALL|METH_KEYWORDS, os_listxattr__doc__}, + {"listxattr", (PyCFunction)(void(*)(void))os_listxattr, METH_FASTCALL|METH_KEYWORDS, os_listxattr__doc__}, static PyObject * os_listxattr_impl(PyObject *module, path_t *path, int follow_symlinks); @@ -5804,7 +5804,7 @@ PyDoc_STRVAR(os_set_inheritable__doc__, "Set the inheritable flag of the specified file descriptor."); #define OS_SET_INHERITABLE_METHODDEF \ - {"set_inheritable", (PyCFunction)os_set_inheritable, METH_FASTCALL, os_set_inheritable__doc__}, + {"set_inheritable", (PyCFunction)(void(*)(void))os_set_inheritable, METH_FASTCALL, os_set_inheritable__doc__}, static PyObject * os_set_inheritable_impl(PyObject *module, int fd, int inheritable); @@ -5871,7 +5871,7 @@ PyDoc_STRVAR(os_set_handle_inheritable__doc__, "Set the inheritable flag of the specified handle."); #define OS_SET_HANDLE_INHERITABLE_METHODDEF \ - {"set_handle_inheritable", (PyCFunction)os_set_handle_inheritable, METH_FASTCALL, os_set_handle_inheritable__doc__}, + {"set_handle_inheritable", (PyCFunction)(void(*)(void))os_set_handle_inheritable, METH_FASTCALL, os_set_handle_inheritable__doc__}, static PyObject * os_set_handle_inheritable_impl(PyObject *module, intptr_t handle, @@ -5946,7 +5946,7 @@ PyDoc_STRVAR(os_set_blocking__doc__, "clear the O_NONBLOCK flag otherwise."); #define OS_SET_BLOCKING_METHODDEF \ - {"set_blocking", (PyCFunction)os_set_blocking, METH_FASTCALL, os_set_blocking__doc__}, + {"set_blocking", (PyCFunction)(void(*)(void))os_set_blocking, METH_FASTCALL, os_set_blocking__doc__}, static PyObject * os_set_blocking_impl(PyObject *module, int fd, int blocking); @@ -6005,7 +6005,7 @@ PyDoc_STRVAR(os_DirEntry_stat__doc__, "Return stat_result object for the entry; cached per entry."); #define OS_DIRENTRY_STAT_METHODDEF \ - {"stat", (PyCFunction)os_DirEntry_stat, METH_FASTCALL|METH_KEYWORDS, os_DirEntry_stat__doc__}, + {"stat", (PyCFunction)(void(*)(void))os_DirEntry_stat, METH_FASTCALL|METH_KEYWORDS, os_DirEntry_stat__doc__}, static PyObject * os_DirEntry_stat_impl(DirEntry *self, int follow_symlinks); @@ -6035,7 +6035,7 @@ PyDoc_STRVAR(os_DirEntry_is_dir__doc__, "Return True if the entry is a directory; cached per entry."); #define OS_DIRENTRY_IS_DIR_METHODDEF \ - {"is_dir", (PyCFunction)os_DirEntry_is_dir, METH_FASTCALL|METH_KEYWORDS, os_DirEntry_is_dir__doc__}, + {"is_dir", (PyCFunction)(void(*)(void))os_DirEntry_is_dir, METH_FASTCALL|METH_KEYWORDS, os_DirEntry_is_dir__doc__}, static int os_DirEntry_is_dir_impl(DirEntry *self, int follow_symlinks); @@ -6070,7 +6070,7 @@ PyDoc_STRVAR(os_DirEntry_is_file__doc__, "Return True if the entry is a file; cached per entry."); #define OS_DIRENTRY_IS_FILE_METHODDEF \ - {"is_file", (PyCFunction)os_DirEntry_is_file, METH_FASTCALL|METH_KEYWORDS, os_DirEntry_is_file__doc__}, + {"is_file", (PyCFunction)(void(*)(void))os_DirEntry_is_file, METH_FASTCALL|METH_KEYWORDS, os_DirEntry_is_file__doc__}, static int os_DirEntry_is_file_impl(DirEntry *self, int follow_symlinks); @@ -6147,7 +6147,7 @@ PyDoc_STRVAR(os_scandir__doc__, "If path is None, uses the path=\'.\'."); #define OS_SCANDIR_METHODDEF \ - {"scandir", (PyCFunction)os_scandir, METH_FASTCALL|METH_KEYWORDS, os_scandir__doc__}, + {"scandir", (PyCFunction)(void(*)(void))os_scandir, METH_FASTCALL|METH_KEYWORDS, os_scandir__doc__}, static PyObject * os_scandir_impl(PyObject *module, path_t *path); @@ -6184,7 +6184,7 @@ PyDoc_STRVAR(os_fspath__doc__, "types raise a TypeError."); #define OS_FSPATH_METHODDEF \ - {"fspath", (PyCFunction)os_fspath, METH_FASTCALL|METH_KEYWORDS, os_fspath__doc__}, + {"fspath", (PyCFunction)(void(*)(void))os_fspath, METH_FASTCALL|METH_KEYWORDS, os_fspath__doc__}, static PyObject * os_fspath_impl(PyObject *module, PyObject *path); @@ -6216,7 +6216,7 @@ PyDoc_STRVAR(os_getrandom__doc__, "Obtain a series of random bytes."); #define OS_GETRANDOM_METHODDEF \ - {"getrandom", (PyCFunction)os_getrandom, METH_FASTCALL|METH_KEYWORDS, os_getrandom__doc__}, + {"getrandom", (PyCFunction)(void(*)(void))os_getrandom, METH_FASTCALL|METH_KEYWORDS, os_getrandom__doc__}, static PyObject * os_getrandom_impl(PyObject *module, Py_ssize_t size, int flags); @@ -6757,4 +6757,4 @@ os_getrandom(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #ifndef OS_GETRANDOM_METHODDEF #define OS_GETRANDOM_METHODDEF #endif /* !defined(OS_GETRANDOM_METHODDEF) */ -/*[clinic end generated code: output=f2951c34e0907fb6 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d62c0bb988141e70 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/pyexpat.c.h b/Modules/clinic/pyexpat.c.h index b7687e5a3695..5e6db44c7c43 100644 --- a/Modules/clinic/pyexpat.c.h +++ b/Modules/clinic/pyexpat.c.h @@ -11,7 +11,7 @@ PyDoc_STRVAR(pyexpat_xmlparser_Parse__doc__, "`isfinal\' should be true at end of input."); #define PYEXPAT_XMLPARSER_PARSE_METHODDEF \ - {"Parse", (PyCFunction)pyexpat_xmlparser_Parse, METH_FASTCALL, pyexpat_xmlparser_Parse__doc__}, + {"Parse", (PyCFunction)(void(*)(void))pyexpat_xmlparser_Parse, METH_FASTCALL, pyexpat_xmlparser_Parse__doc__}, static PyObject * pyexpat_xmlparser_Parse_impl(xmlparseobject *self, PyObject *data, @@ -116,7 +116,7 @@ PyDoc_STRVAR(pyexpat_xmlparser_ExternalEntityParserCreate__doc__, "Create a parser for parsing an external entity based on the information passed to the ExternalEntityRefHandler."); #define PYEXPAT_XMLPARSER_EXTERNALENTITYPARSERCREATE_METHODDEF \ - {"ExternalEntityParserCreate", (PyCFunction)pyexpat_xmlparser_ExternalEntityParserCreate, METH_FASTCALL, pyexpat_xmlparser_ExternalEntityParserCreate__doc__}, + {"ExternalEntityParserCreate", (PyCFunction)(void(*)(void))pyexpat_xmlparser_ExternalEntityParserCreate, METH_FASTCALL, pyexpat_xmlparser_ExternalEntityParserCreate__doc__}, static PyObject * pyexpat_xmlparser_ExternalEntityParserCreate_impl(xmlparseobject *self, @@ -185,7 +185,7 @@ PyDoc_STRVAR(pyexpat_xmlparser_UseForeignDTD__doc__, "information to the parser. \'flag\' defaults to True if not provided."); #define PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF \ - {"UseForeignDTD", (PyCFunction)pyexpat_xmlparser_UseForeignDTD, METH_FASTCALL, pyexpat_xmlparser_UseForeignDTD__doc__}, + {"UseForeignDTD", (PyCFunction)(void(*)(void))pyexpat_xmlparser_UseForeignDTD, METH_FASTCALL, pyexpat_xmlparser_UseForeignDTD__doc__}, static PyObject * pyexpat_xmlparser_UseForeignDTD_impl(xmlparseobject *self, int flag); @@ -216,7 +216,7 @@ PyDoc_STRVAR(pyexpat_ParserCreate__doc__, "Return a new XML parser object."); #define PYEXPAT_PARSERCREATE_METHODDEF \ - {"ParserCreate", (PyCFunction)pyexpat_ParserCreate, METH_FASTCALL|METH_KEYWORDS, pyexpat_ParserCreate__doc__}, + {"ParserCreate", (PyCFunction)(void(*)(void))pyexpat_ParserCreate, METH_FASTCALL|METH_KEYWORDS, pyexpat_ParserCreate__doc__}, static PyObject * pyexpat_ParserCreate_impl(PyObject *module, const char *encoding, @@ -272,4 +272,4 @@ pyexpat_ErrorString(PyObject *module, PyObject *arg) #ifndef PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF #define PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF #endif /* !defined(PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF) */ -/*[clinic end generated code: output=6bdf1faf8ba1af32 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c390207761c679d3 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/resource.c.h b/Modules/clinic/resource.c.h index 9163cac76c6f..cd9fae1df0ae 100644 --- a/Modules/clinic/resource.c.h +++ b/Modules/clinic/resource.c.h @@ -60,7 +60,7 @@ PyDoc_STRVAR(resource_setrlimit__doc__, "\n"); #define RESOURCE_SETRLIMIT_METHODDEF \ - {"setrlimit", (PyCFunction)resource_setrlimit, METH_FASTCALL, resource_setrlimit__doc__}, + {"setrlimit", (PyCFunction)(void(*)(void))resource_setrlimit, METH_FASTCALL, resource_setrlimit__doc__}, static PyObject * resource_setrlimit_impl(PyObject *module, int resource, PyObject *limits); @@ -157,4 +157,4 @@ resource_getpagesize(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef RESOURCE_PRLIMIT_METHODDEF #define RESOURCE_PRLIMIT_METHODDEF #endif /* !defined(RESOURCE_PRLIMIT_METHODDEF) */ -/*[clinic end generated code: output=2a69aca90631a582 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=637ed2c42bde5ca6 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/selectmodule.c.h b/Modules/clinic/selectmodule.c.h index b87b3906f116..0a53ae2b9199 100644 --- a/Modules/clinic/selectmodule.c.h +++ b/Modules/clinic/selectmodule.c.h @@ -30,7 +30,7 @@ PyDoc_STRVAR(select_select__doc__, "descriptors can be used."); #define SELECT_SELECT_METHODDEF \ - {"select", (PyCFunction)select_select, METH_FASTCALL, select_select__doc__}, + {"select", (PyCFunction)(void(*)(void))select_select, METH_FASTCALL, select_select__doc__}, static PyObject * select_select_impl(PyObject *module, PyObject *rlist, PyObject *wlist, @@ -70,7 +70,7 @@ PyDoc_STRVAR(select_poll_register__doc__, " an optional bitmask describing the type of events to check for"); #define SELECT_POLL_REGISTER_METHODDEF \ - {"register", (PyCFunction)select_poll_register, METH_FASTCALL, select_poll_register__doc__}, + {"register", (PyCFunction)(void(*)(void))select_poll_register, METH_FASTCALL, select_poll_register__doc__}, static PyObject * select_poll_register_impl(pollObject *self, int fd, unsigned short eventmask); @@ -109,7 +109,7 @@ PyDoc_STRVAR(select_poll_modify__doc__, " a bitmask describing the type of events to check for"); #define SELECT_POLL_MODIFY_METHODDEF \ - {"modify", (PyCFunction)select_poll_modify, METH_FASTCALL, select_poll_modify__doc__}, + {"modify", (PyCFunction)(void(*)(void))select_poll_modify, METH_FASTCALL, select_poll_modify__doc__}, static PyObject * select_poll_modify_impl(pollObject *self, int fd, unsigned short eventmask); @@ -176,7 +176,7 @@ PyDoc_STRVAR(select_poll_poll__doc__, "report, as a list of (fd, event) 2-tuples."); #define SELECT_POLL_POLL_METHODDEF \ - {"poll", (PyCFunction)select_poll_poll, METH_FASTCALL, select_poll_poll__doc__}, + {"poll", (PyCFunction)(void(*)(void))select_poll_poll, METH_FASTCALL, select_poll_poll__doc__}, static PyObject * select_poll_poll_impl(pollObject *self, PyObject *timeout_obj); @@ -215,7 +215,7 @@ PyDoc_STRVAR(select_devpoll_register__doc__, " an optional bitmask describing the type of events to check for"); #define SELECT_DEVPOLL_REGISTER_METHODDEF \ - {"register", (PyCFunction)select_devpoll_register, METH_FASTCALL, select_devpoll_register__doc__}, + {"register", (PyCFunction)(void(*)(void))select_devpoll_register, METH_FASTCALL, select_devpoll_register__doc__}, static PyObject * select_devpoll_register_impl(devpollObject *self, int fd, @@ -255,7 +255,7 @@ PyDoc_STRVAR(select_devpoll_modify__doc__, " an optional bitmask describing the type of events to check for"); #define SELECT_DEVPOLL_MODIFY_METHODDEF \ - {"modify", (PyCFunction)select_devpoll_modify, METH_FASTCALL, select_devpoll_modify__doc__}, + {"modify", (PyCFunction)(void(*)(void))select_devpoll_modify, METH_FASTCALL, select_devpoll_modify__doc__}, static PyObject * select_devpoll_modify_impl(devpollObject *self, int fd, @@ -323,7 +323,7 @@ PyDoc_STRVAR(select_devpoll_poll__doc__, "report, as a list of (fd, event) 2-tuples."); #define SELECT_DEVPOLL_POLL_METHODDEF \ - {"poll", (PyCFunction)select_devpoll_poll, METH_FASTCALL, select_devpoll_poll__doc__}, + {"poll", (PyCFunction)(void(*)(void))select_devpoll_poll, METH_FASTCALL, select_devpoll_poll__doc__}, static PyObject * select_devpoll_poll_impl(devpollObject *self, PyObject *timeout_obj); @@ -577,7 +577,7 @@ PyDoc_STRVAR(select_epoll_register__doc__, "The epoll interface supports all file descriptors that support poll."); #define SELECT_EPOLL_REGISTER_METHODDEF \ - {"register", (PyCFunction)select_epoll_register, METH_FASTCALL|METH_KEYWORDS, select_epoll_register__doc__}, + {"register", (PyCFunction)(void(*)(void))select_epoll_register, METH_FASTCALL|METH_KEYWORDS, select_epoll_register__doc__}, static PyObject * select_epoll_register_impl(pyEpoll_Object *self, int fd, @@ -618,7 +618,7 @@ PyDoc_STRVAR(select_epoll_modify__doc__, " a bit set composed of the various EPOLL constants"); #define SELECT_EPOLL_MODIFY_METHODDEF \ - {"modify", (PyCFunction)select_epoll_modify, METH_FASTCALL|METH_KEYWORDS, select_epoll_modify__doc__}, + {"modify", (PyCFunction)(void(*)(void))select_epoll_modify, METH_FASTCALL|METH_KEYWORDS, select_epoll_modify__doc__}, static PyObject * select_epoll_modify_impl(pyEpoll_Object *self, int fd, @@ -657,7 +657,7 @@ PyDoc_STRVAR(select_epoll_unregister__doc__, " the target file descriptor of the operation"); #define SELECT_EPOLL_UNREGISTER_METHODDEF \ - {"unregister", (PyCFunction)select_epoll_unregister, METH_FASTCALL|METH_KEYWORDS, select_epoll_unregister__doc__}, + {"unregister", (PyCFunction)(void(*)(void))select_epoll_unregister, METH_FASTCALL|METH_KEYWORDS, select_epoll_unregister__doc__}, static PyObject * select_epoll_unregister_impl(pyEpoll_Object *self, int fd); @@ -700,7 +700,7 @@ PyDoc_STRVAR(select_epoll_poll__doc__, "as a list of (fd, events) 2-tuples."); #define SELECT_EPOLL_POLL_METHODDEF \ - {"poll", (PyCFunction)select_epoll_poll, METH_FASTCALL|METH_KEYWORDS, select_epoll_poll__doc__}, + {"poll", (PyCFunction)(void(*)(void))select_epoll_poll, METH_FASTCALL|METH_KEYWORDS, select_epoll_poll__doc__}, static PyObject * select_epoll_poll_impl(pyEpoll_Object *self, PyObject *timeout_obj, @@ -756,7 +756,7 @@ PyDoc_STRVAR(select_epoll___exit____doc__, "\n"); #define SELECT_EPOLL___EXIT___METHODDEF \ - {"__exit__", (PyCFunction)select_epoll___exit__, METH_FASTCALL, select_epoll___exit____doc__}, + {"__exit__", (PyCFunction)(void(*)(void))select_epoll___exit__, METH_FASTCALL, select_epoll___exit____doc__}, static PyObject * select_epoll___exit___impl(pyEpoll_Object *self, PyObject *exc_type, @@ -922,7 +922,7 @@ PyDoc_STRVAR(select_kqueue_control__doc__, " This accepts floats for smaller timeouts, too."); #define SELECT_KQUEUE_CONTROL_METHODDEF \ - {"control", (PyCFunction)select_kqueue_control, METH_FASTCALL, select_kqueue_control__doc__}, + {"control", (PyCFunction)(void(*)(void))select_kqueue_control, METH_FASTCALL, select_kqueue_control__doc__}, static PyObject * select_kqueue_control_impl(kqueue_queue_Object *self, PyObject *changelist, @@ -1047,4 +1047,4 @@ select_kqueue_control(kqueue_queue_Object *self, PyObject *const *args, Py_ssize #ifndef SELECT_KQUEUE_CONTROL_METHODDEF #define SELECT_KQUEUE_CONTROL_METHODDEF #endif /* !defined(SELECT_KQUEUE_CONTROL_METHODDEF) */ -/*[clinic end generated code: output=561bec8bcb0e00c5 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=04c4019eb5a4d464 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/sha1module.c.h b/Modules/clinic/sha1module.c.h index c84fcbac5f6f..af29173bae55 100644 --- a/Modules/clinic/sha1module.c.h +++ b/Modules/clinic/sha1module.c.h @@ -72,7 +72,7 @@ PyDoc_STRVAR(_sha1_sha1__doc__, "Return a new SHA1 hash object; optionally initialized with a string."); #define _SHA1_SHA1_METHODDEF \ - {"sha1", (PyCFunction)_sha1_sha1, METH_FASTCALL|METH_KEYWORDS, _sha1_sha1__doc__}, + {"sha1", (PyCFunction)(void(*)(void))_sha1_sha1, METH_FASTCALL|METH_KEYWORDS, _sha1_sha1__doc__}, static PyObject * _sha1_sha1_impl(PyObject *module, PyObject *string); @@ -94,4 +94,4 @@ _sha1_sha1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject * exit: return return_value; } -/*[clinic end generated code: output=81d2424c0585bfd4 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3bae85313ee5a3b5 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/sha256module.c.h b/Modules/clinic/sha256module.c.h index 45f78c8f795e..14a88a2be8f4 100644 --- a/Modules/clinic/sha256module.c.h +++ b/Modules/clinic/sha256module.c.h @@ -72,7 +72,7 @@ PyDoc_STRVAR(_sha256_sha256__doc__, "Return a new SHA-256 hash object; optionally initialized with a string."); #define _SHA256_SHA256_METHODDEF \ - {"sha256", (PyCFunction)_sha256_sha256, METH_FASTCALL|METH_KEYWORDS, _sha256_sha256__doc__}, + {"sha256", (PyCFunction)(void(*)(void))_sha256_sha256, METH_FASTCALL|METH_KEYWORDS, _sha256_sha256__doc__}, static PyObject * _sha256_sha256_impl(PyObject *module, PyObject *string); @@ -102,7 +102,7 @@ PyDoc_STRVAR(_sha256_sha224__doc__, "Return a new SHA-224 hash object; optionally initialized with a string."); #define _SHA256_SHA224_METHODDEF \ - {"sha224", (PyCFunction)_sha256_sha224, METH_FASTCALL|METH_KEYWORDS, _sha256_sha224__doc__}, + {"sha224", (PyCFunction)(void(*)(void))_sha256_sha224, METH_FASTCALL|METH_KEYWORDS, _sha256_sha224__doc__}, static PyObject * _sha256_sha224_impl(PyObject *module, PyObject *string); @@ -124,4 +124,4 @@ _sha256_sha224(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje exit: return return_value; } -/*[clinic end generated code: output=0086286cffcbc31c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=fb208641d4bc3b5f input=a9049054013a1b77]*/ diff --git a/Modules/clinic/sha512module.c.h b/Modules/clinic/sha512module.c.h index 9d3a7c9e6d4a..7e08701937a5 100644 --- a/Modules/clinic/sha512module.c.h +++ b/Modules/clinic/sha512module.c.h @@ -72,7 +72,7 @@ PyDoc_STRVAR(_sha512_sha512__doc__, "Return a new SHA-512 hash object; optionally initialized with a string."); #define _SHA512_SHA512_METHODDEF \ - {"sha512", (PyCFunction)_sha512_sha512, METH_FASTCALL|METH_KEYWORDS, _sha512_sha512__doc__}, + {"sha512", (PyCFunction)(void(*)(void))_sha512_sha512, METH_FASTCALL|METH_KEYWORDS, _sha512_sha512__doc__}, static PyObject * _sha512_sha512_impl(PyObject *module, PyObject *string); @@ -102,7 +102,7 @@ PyDoc_STRVAR(_sha512_sha384__doc__, "Return a new SHA-384 hash object; optionally initialized with a string."); #define _SHA512_SHA384_METHODDEF \ - {"sha384", (PyCFunction)_sha512_sha384, METH_FASTCALL|METH_KEYWORDS, _sha512_sha384__doc__}, + {"sha384", (PyCFunction)(void(*)(void))_sha512_sha384, METH_FASTCALL|METH_KEYWORDS, _sha512_sha384__doc__}, static PyObject * _sha512_sha384_impl(PyObject *module, PyObject *string); @@ -124,4 +124,4 @@ _sha512_sha384(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje exit: return return_value; } -/*[clinic end generated code: output=fcc3306fb6672222 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3706fa47bea06c0b input=a9049054013a1b77]*/ diff --git a/Modules/clinic/signalmodule.c.h b/Modules/clinic/signalmodule.c.h index 4d7ac38372f2..912f989539d9 100644 --- a/Modules/clinic/signalmodule.c.h +++ b/Modules/clinic/signalmodule.c.h @@ -74,7 +74,7 @@ PyDoc_STRVAR(signal_signal__doc__, "the first is the signal number, the second is the interrupted stack frame."); #define SIGNAL_SIGNAL_METHODDEF \ - {"signal", (PyCFunction)signal_signal, METH_FASTCALL, signal_signal__doc__}, + {"signal", (PyCFunction)(void(*)(void))signal_signal, METH_FASTCALL, signal_signal__doc__}, static PyObject * signal_signal_impl(PyObject *module, int signalnum, PyObject *handler); @@ -171,7 +171,7 @@ PyDoc_STRVAR(signal_siginterrupt__doc__, "signal sig, else system calls will be interrupted."); #define SIGNAL_SIGINTERRUPT_METHODDEF \ - {"siginterrupt", (PyCFunction)signal_siginterrupt, METH_FASTCALL, signal_siginterrupt__doc__}, + {"siginterrupt", (PyCFunction)(void(*)(void))signal_siginterrupt, METH_FASTCALL, signal_siginterrupt__doc__}, static PyObject * signal_siginterrupt_impl(PyObject *module, int signalnum, int flag); @@ -209,7 +209,7 @@ PyDoc_STRVAR(signal_setitimer__doc__, "Returns old values as a tuple: (delay, interval)."); #define SIGNAL_SETITIMER_METHODDEF \ - {"setitimer", (PyCFunction)signal_setitimer, METH_FASTCALL, signal_setitimer__doc__}, + {"setitimer", (PyCFunction)(void(*)(void))signal_setitimer, METH_FASTCALL, signal_setitimer__doc__}, static PyObject * signal_setitimer_impl(PyObject *module, int which, PyObject *seconds, @@ -275,7 +275,7 @@ PyDoc_STRVAR(signal_pthread_sigmask__doc__, "Fetch and/or change the signal mask of the calling thread."); #define SIGNAL_PTHREAD_SIGMASK_METHODDEF \ - {"pthread_sigmask", (PyCFunction)signal_pthread_sigmask, METH_FASTCALL, signal_pthread_sigmask__doc__}, + {"pthread_sigmask", (PyCFunction)(void(*)(void))signal_pthread_sigmask, METH_FASTCALL, signal_pthread_sigmask__doc__}, static PyObject * signal_pthread_sigmask_impl(PyObject *module, int how, sigset_t mask); @@ -428,7 +428,7 @@ PyDoc_STRVAR(signal_sigtimedwait__doc__, "The timeout is specified in seconds, with floating point numbers allowed."); #define SIGNAL_SIGTIMEDWAIT_METHODDEF \ - {"sigtimedwait", (PyCFunction)signal_sigtimedwait, METH_FASTCALL, signal_sigtimedwait__doc__}, + {"sigtimedwait", (PyCFunction)(void(*)(void))signal_sigtimedwait, METH_FASTCALL, signal_sigtimedwait__doc__}, static PyObject * signal_sigtimedwait_impl(PyObject *module, sigset_t sigset, @@ -462,7 +462,7 @@ PyDoc_STRVAR(signal_pthread_kill__doc__, "Send a signal to a thread."); #define SIGNAL_PTHREAD_KILL_METHODDEF \ - {"pthread_kill", (PyCFunction)signal_pthread_kill, METH_FASTCALL, signal_pthread_kill__doc__}, + {"pthread_kill", (PyCFunction)(void(*)(void))signal_pthread_kill, METH_FASTCALL, signal_pthread_kill__doc__}, static PyObject * signal_pthread_kill_impl(PyObject *module, unsigned long thread_id, @@ -534,4 +534,4 @@ signal_pthread_kill(PyObject *module, PyObject *const *args, Py_ssize_t nargs) #ifndef SIGNAL_PTHREAD_KILL_METHODDEF #define SIGNAL_PTHREAD_KILL_METHODDEF #endif /* !defined(SIGNAL_PTHREAD_KILL_METHODDEF) */ -/*[clinic end generated code: output=549f0efdc7405834 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=fa0040750f4c1fcb input=a9049054013a1b77]*/ diff --git a/Modules/clinic/symtablemodule.c.h b/Modules/clinic/symtablemodule.c.h index 6f1e4fe0c731..b5e64e0313f8 100644 --- a/Modules/clinic/symtablemodule.c.h +++ b/Modules/clinic/symtablemodule.c.h @@ -9,7 +9,7 @@ PyDoc_STRVAR(_symtable_symtable__doc__, "Return symbol and scope dictionaries used internally by compiler."); #define _SYMTABLE_SYMTABLE_METHODDEF \ - {"symtable", (PyCFunction)_symtable_symtable, METH_FASTCALL, _symtable_symtable__doc__}, + {"symtable", (PyCFunction)(void(*)(void))_symtable_symtable, METH_FASTCALL, _symtable_symtable__doc__}, static PyObject * _symtable_symtable_impl(PyObject *module, const char *str, @@ -32,4 +32,4 @@ _symtable_symtable(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=c18565060a6cae04 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=52ece07dd0e7a113 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/unicodedata.c.h b/Modules/clinic/unicodedata.c.h index 54021fedba41..4799fb44279c 100644 --- a/Modules/clinic/unicodedata.c.h +++ b/Modules/clinic/unicodedata.c.h @@ -13,7 +13,7 @@ PyDoc_STRVAR(unicodedata_UCD_decimal__doc__, "ValueError is raised."); #define UNICODEDATA_UCD_DECIMAL_METHODDEF \ - {"decimal", (PyCFunction)unicodedata_UCD_decimal, METH_FASTCALL, unicodedata_UCD_decimal__doc__}, + {"decimal", (PyCFunction)(void(*)(void))unicodedata_UCD_decimal, METH_FASTCALL, unicodedata_UCD_decimal__doc__}, static PyObject * unicodedata_UCD_decimal_impl(PyObject *self, int chr, @@ -47,7 +47,7 @@ PyDoc_STRVAR(unicodedata_UCD_digit__doc__, "ValueError is raised."); #define UNICODEDATA_UCD_DIGIT_METHODDEF \ - {"digit", (PyCFunction)unicodedata_UCD_digit, METH_FASTCALL, unicodedata_UCD_digit__doc__}, + {"digit", (PyCFunction)(void(*)(void))unicodedata_UCD_digit, METH_FASTCALL, unicodedata_UCD_digit__doc__}, static PyObject * unicodedata_UCD_digit_impl(PyObject *self, int chr, PyObject *default_value); @@ -80,7 +80,7 @@ PyDoc_STRVAR(unicodedata_UCD_numeric__doc__, "ValueError is raised."); #define UNICODEDATA_UCD_NUMERIC_METHODDEF \ - {"numeric", (PyCFunction)unicodedata_UCD_numeric, METH_FASTCALL, unicodedata_UCD_numeric__doc__}, + {"numeric", (PyCFunction)(void(*)(void))unicodedata_UCD_numeric, METH_FASTCALL, unicodedata_UCD_numeric__doc__}, static PyObject * unicodedata_UCD_numeric_impl(PyObject *self, int chr, @@ -293,7 +293,7 @@ PyDoc_STRVAR(unicodedata_UCD_is_normalized__doc__, "Valid values for form are \'NFC\', \'NFKC\', \'NFD\', and \'NFKD\'."); #define UNICODEDATA_UCD_IS_NORMALIZED_METHODDEF \ - {"is_normalized", (PyCFunction)unicodedata_UCD_is_normalized, METH_FASTCALL, unicodedata_UCD_is_normalized__doc__}, + {"is_normalized", (PyCFunction)(void(*)(void))unicodedata_UCD_is_normalized, METH_FASTCALL, unicodedata_UCD_is_normalized__doc__}, static PyObject * unicodedata_UCD_is_normalized_impl(PyObject *self, PyObject *form, @@ -325,7 +325,7 @@ PyDoc_STRVAR(unicodedata_UCD_normalize__doc__, "Valid values for form are \'NFC\', \'NFKC\', \'NFD\', and \'NFKD\'."); #define UNICODEDATA_UCD_NORMALIZE_METHODDEF \ - {"normalize", (PyCFunction)unicodedata_UCD_normalize, METH_FASTCALL, unicodedata_UCD_normalize__doc__}, + {"normalize", (PyCFunction)(void(*)(void))unicodedata_UCD_normalize, METH_FASTCALL, unicodedata_UCD_normalize__doc__}, static PyObject * unicodedata_UCD_normalize_impl(PyObject *self, PyObject *form, @@ -358,7 +358,7 @@ PyDoc_STRVAR(unicodedata_UCD_name__doc__, "ValueError is raised."); #define UNICODEDATA_UCD_NAME_METHODDEF \ - {"name", (PyCFunction)unicodedata_UCD_name, METH_FASTCALL, unicodedata_UCD_name__doc__}, + {"name", (PyCFunction)(void(*)(void))unicodedata_UCD_name, METH_FASTCALL, unicodedata_UCD_name__doc__}, static PyObject * unicodedata_UCD_name_impl(PyObject *self, int chr, PyObject *default_value); @@ -411,4 +411,4 @@ unicodedata_UCD_lookup(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=2c5fbf597c18f6b8 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=67f474927be668bf input=a9049054013a1b77]*/ diff --git a/Modules/clinic/zipimport.c.h b/Modules/clinic/zipimport.c.h new file mode 100644 index 000000000000..aabe7a05ae9d --- /dev/null +++ b/Modules/clinic/zipimport.c.h @@ -0,0 +1,325 @@ +/*[clinic input] +preserve +[clinic start generated code]*/ + +PyDoc_STRVAR(zipimport_zipimporter___init____doc__, +"zipimporter(archivepath, /)\n" +"--\n" +"\n" +"Create a new zipimporter instance.\n" +"\n" +" archivepath\n" +" A path-like object to a zipfile, or to a specific path inside\n" +" a zipfile.\n" +"\n" +"\'archivepath\' must be a path-like object to a zipfile, or to a specific path\n" +"inside a zipfile. For example, it can be \'/tmp/myimport.zip\', or\n" +"\'/tmp/myimport.zip/mydirectory\', if mydirectory is a valid directory inside\n" +"the archive.\n" +"\n" +"\'ZipImportError\' is raised if \'archivepath\' doesn\'t point to a valid Zip\n" +"archive.\n" +"\n" +"The \'archive\' attribute of the zipimporter object contains the name of the\n" +"zipfile targeted."); + +static int +zipimport_zipimporter___init___impl(ZipImporter *self, PyObject *path); + +static int +zipimport_zipimporter___init__(PyObject *self, PyObject *args, PyObject *kwargs) +{ + int return_value = -1; + PyObject *path; + + if ((Py_TYPE(self) == &ZipImporter_Type) && + !_PyArg_NoKeywords("zipimporter", kwargs)) { + goto exit; + } + if (!PyArg_ParseTuple(args, "O&:zipimporter", + PyUnicode_FSDecoder, &path)) { + goto exit; + } + return_value = zipimport_zipimporter___init___impl((ZipImporter *)self, path); + +exit: + return return_value; +} + +PyDoc_STRVAR(zipimport_zipimporter_find_module__doc__, +"find_module($self, fullname, path=None, /)\n" +"--\n" +"\n" +"Search for a module specified by \'fullname\'.\n" +"\n" +"\'fullname\' must be the fully qualified (dotted) module name. It returns the\n" +"zipimporter instance itself if the module was found, or None if it wasn\'t.\n" +"The optional \'path\' argument is ignored -- it\'s there for compatibility\n" +"with the importer protocol."); + +#define ZIPIMPORT_ZIPIMPORTER_FIND_MODULE_METHODDEF \ + {"find_module", (PyCFunction)(void *)zipimport_zipimporter_find_module, METH_FASTCALL, zipimport_zipimporter_find_module__doc__}, + +static PyObject * +zipimport_zipimporter_find_module_impl(ZipImporter *self, PyObject *fullname, + PyObject *path); + +static PyObject * +zipimport_zipimporter_find_module(ZipImporter *self, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *fullname; + PyObject *path = Py_None; + + if (!_PyArg_ParseStack(args, nargs, "U|O:find_module", + &fullname, &path)) { + goto exit; + } + return_value = zipimport_zipimporter_find_module_impl(self, fullname, path); + +exit: + return return_value; +} + +PyDoc_STRVAR(zipimport_zipimporter_find_loader__doc__, +"find_loader($self, fullname, path=None, /)\n" +"--\n" +"\n" +"Search for a module specified by \'fullname\'.\n" +"\n" +"\'fullname\' must be the fully qualified (dotted) module name. It returns the\n" +"zipimporter instance itself if the module was found, a string containing the\n" +"full path name if it\'s possibly a portion of a namespace package,\n" +"or None otherwise. The optional \'path\' argument is ignored -- it\'s\n" +"there for compatibility with the importer protocol."); + +#define ZIPIMPORT_ZIPIMPORTER_FIND_LOADER_METHODDEF \ + {"find_loader", (PyCFunction)(void *)zipimport_zipimporter_find_loader, METH_FASTCALL, zipimport_zipimporter_find_loader__doc__}, + +static PyObject * +zipimport_zipimporter_find_loader_impl(ZipImporter *self, PyObject *fullname, + PyObject *path); + +static PyObject * +zipimport_zipimporter_find_loader(ZipImporter *self, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *fullname; + PyObject *path = Py_None; + + if (!_PyArg_ParseStack(args, nargs, "U|O:find_loader", + &fullname, &path)) { + goto exit; + } + return_value = zipimport_zipimporter_find_loader_impl(self, fullname, path); + +exit: + return return_value; +} + +PyDoc_STRVAR(zipimport_zipimporter_load_module__doc__, +"load_module($self, fullname, /)\n" +"--\n" +"\n" +"Load the module specified by \'fullname\'.\n" +"\n" +"\'fullname\' must be the fully qualified (dotted) module name. It returns the\n" +"imported module, or raises ZipImportError if it wasn\'t found."); + +#define ZIPIMPORT_ZIPIMPORTER_LOAD_MODULE_METHODDEF \ + {"load_module", (PyCFunction)zipimport_zipimporter_load_module, METH_O, zipimport_zipimporter_load_module__doc__}, + +static PyObject * +zipimport_zipimporter_load_module_impl(ZipImporter *self, PyObject *fullname); + +static PyObject * +zipimport_zipimporter_load_module(ZipImporter *self, PyObject *arg) +{ + PyObject *return_value = NULL; + PyObject *fullname; + + if (!PyArg_Parse(arg, "U:load_module", &fullname)) { + goto exit; + } + return_value = zipimport_zipimporter_load_module_impl(self, fullname); + +exit: + return return_value; +} + +PyDoc_STRVAR(zipimport_zipimporter_get_filename__doc__, +"get_filename($self, fullname, /)\n" +"--\n" +"\n" +"Return the filename for the specified module."); + +#define ZIPIMPORT_ZIPIMPORTER_GET_FILENAME_METHODDEF \ + {"get_filename", (PyCFunction)zipimport_zipimporter_get_filename, METH_O, zipimport_zipimporter_get_filename__doc__}, + +static PyObject * +zipimport_zipimporter_get_filename_impl(ZipImporter *self, + PyObject *fullname); + +static PyObject * +zipimport_zipimporter_get_filename(ZipImporter *self, PyObject *arg) +{ + PyObject *return_value = NULL; + PyObject *fullname; + + if (!PyArg_Parse(arg, "U:get_filename", &fullname)) { + goto exit; + } + return_value = zipimport_zipimporter_get_filename_impl(self, fullname); + +exit: + return return_value; +} + +PyDoc_STRVAR(zipimport_zipimporter_is_package__doc__, +"is_package($self, fullname, /)\n" +"--\n" +"\n" +"Return True if the module specified by fullname is a package.\n" +"\n" +"Raise ZipImportError if the module couldn\'t be found."); + +#define ZIPIMPORT_ZIPIMPORTER_IS_PACKAGE_METHODDEF \ + {"is_package", (PyCFunction)zipimport_zipimporter_is_package, METH_O, zipimport_zipimporter_is_package__doc__}, + +static PyObject * +zipimport_zipimporter_is_package_impl(ZipImporter *self, PyObject *fullname); + +static PyObject * +zipimport_zipimporter_is_package(ZipImporter *self, PyObject *arg) +{ + PyObject *return_value = NULL; + PyObject *fullname; + + if (!PyArg_Parse(arg, "U:is_package", &fullname)) { + goto exit; + } + return_value = zipimport_zipimporter_is_package_impl(self, fullname); + +exit: + return return_value; +} + +PyDoc_STRVAR(zipimport_zipimporter_get_data__doc__, +"get_data($self, pathname, /)\n" +"--\n" +"\n" +"Return the data associated with \'pathname\'.\n" +"\n" +"Raise OSError if the file was not found."); + +#define ZIPIMPORT_ZIPIMPORTER_GET_DATA_METHODDEF \ + {"get_data", (PyCFunction)zipimport_zipimporter_get_data, METH_O, zipimport_zipimporter_get_data__doc__}, + +static PyObject * +zipimport_zipimporter_get_data_impl(ZipImporter *self, PyObject *path); + +static PyObject * +zipimport_zipimporter_get_data(ZipImporter *self, PyObject *arg) +{ + PyObject *return_value = NULL; + PyObject *path; + + if (!PyArg_Parse(arg, "U:get_data", &path)) { + goto exit; + } + return_value = zipimport_zipimporter_get_data_impl(self, path); + +exit: + return return_value; +} + +PyDoc_STRVAR(zipimport_zipimporter_get_code__doc__, +"get_code($self, fullname, /)\n" +"--\n" +"\n" +"Return the code object for the specified module.\n" +"\n" +"Raise ZipImportError if the module couldn\'t be found."); + +#define ZIPIMPORT_ZIPIMPORTER_GET_CODE_METHODDEF \ + {"get_code", (PyCFunction)zipimport_zipimporter_get_code, METH_O, zipimport_zipimporter_get_code__doc__}, + +static PyObject * +zipimport_zipimporter_get_code_impl(ZipImporter *self, PyObject *fullname); + +static PyObject * +zipimport_zipimporter_get_code(ZipImporter *self, PyObject *arg) +{ + PyObject *return_value = NULL; + PyObject *fullname; + + if (!PyArg_Parse(arg, "U:get_code", &fullname)) { + goto exit; + } + return_value = zipimport_zipimporter_get_code_impl(self, fullname); + +exit: + return return_value; +} + +PyDoc_STRVAR(zipimport_zipimporter_get_source__doc__, +"get_source($self, fullname, /)\n" +"--\n" +"\n" +"Return the source code for the specified module.\n" +"\n" +"Raise ZipImportError if the module couldn\'t be found, return None if the\n" +"archive does contain the module, but has no source for it."); + +#define ZIPIMPORT_ZIPIMPORTER_GET_SOURCE_METHODDEF \ + {"get_source", (PyCFunction)zipimport_zipimporter_get_source, METH_O, zipimport_zipimporter_get_source__doc__}, + +static PyObject * +zipimport_zipimporter_get_source_impl(ZipImporter *self, PyObject *fullname); + +static PyObject * +zipimport_zipimporter_get_source(ZipImporter *self, PyObject *arg) +{ + PyObject *return_value = NULL; + PyObject *fullname; + + if (!PyArg_Parse(arg, "U:get_source", &fullname)) { + goto exit; + } + return_value = zipimport_zipimporter_get_source_impl(self, fullname); + +exit: + return return_value; +} + +PyDoc_STRVAR(zipimport_zipimporter_get_resource_reader__doc__, +"get_resource_reader($self, fullname, /)\n" +"--\n" +"\n" +"Return the ResourceReader for a package in a zip file.\n" +"\n" +"If \'fullname\' is a package within the zip file, return the \'ResourceReader\'\n" +"object for the package. Otherwise return None."); + +#define ZIPIMPORT_ZIPIMPORTER_GET_RESOURCE_READER_METHODDEF \ + {"get_resource_reader", (PyCFunction)zipimport_zipimporter_get_resource_reader, METH_O, zipimport_zipimporter_get_resource_reader__doc__}, + +static PyObject * +zipimport_zipimporter_get_resource_reader_impl(ZipImporter *self, + PyObject *fullname); + +static PyObject * +zipimport_zipimporter_get_resource_reader(ZipImporter *self, PyObject *arg) +{ + PyObject *return_value = NULL; + PyObject *fullname; + + if (!PyArg_Parse(arg, "U:get_resource_reader", &fullname)) { + goto exit; + } + return_value = zipimport_zipimporter_get_resource_reader_impl(self, fullname); + +exit: + return return_value; +} +/*[clinic end generated code: output=854ce3502180dc1f input=a9049054013a1b77]*/ diff --git a/Modules/clinic/zlibmodule.c.h b/Modules/clinic/zlibmodule.c.h index 99db052bf2fa..c5eeab7459c5 100644 --- a/Modules/clinic/zlibmodule.c.h +++ b/Modules/clinic/zlibmodule.c.h @@ -14,7 +14,7 @@ PyDoc_STRVAR(zlib_compress__doc__, " Compression level, in 0-9 or -1."); #define ZLIB_COMPRESS_METHODDEF \ - {"compress", (PyCFunction)zlib_compress, METH_FASTCALL|METH_KEYWORDS, zlib_compress__doc__}, + {"compress", (PyCFunction)(void(*)(void))zlib_compress, METH_FASTCALL|METH_KEYWORDS, zlib_compress__doc__}, static PyObject * zlib_compress_impl(PyObject *module, Py_buffer *data, int level); @@ -57,7 +57,7 @@ PyDoc_STRVAR(zlib_decompress__doc__, " The initial output buffer size."); #define ZLIB_DECOMPRESS_METHODDEF \ - {"decompress", (PyCFunction)zlib_decompress, METH_FASTCALL|METH_KEYWORDS, zlib_decompress__doc__}, + {"decompress", (PyCFunction)(void(*)(void))zlib_decompress, METH_FASTCALL|METH_KEYWORDS, zlib_decompress__doc__}, static PyObject * zlib_decompress_impl(PyObject *module, Py_buffer *data, int wbits, @@ -119,7 +119,7 @@ PyDoc_STRVAR(zlib_compressobj__doc__, " containing subsequences that are likely to occur in the input data."); #define ZLIB_COMPRESSOBJ_METHODDEF \ - {"compressobj", (PyCFunction)zlib_compressobj, METH_FASTCALL|METH_KEYWORDS, zlib_compressobj__doc__}, + {"compressobj", (PyCFunction)(void(*)(void))zlib_compressobj, METH_FASTCALL|METH_KEYWORDS, zlib_compressobj__doc__}, static PyObject * zlib_compressobj_impl(PyObject *module, int level, int method, int wbits, @@ -166,7 +166,7 @@ PyDoc_STRVAR(zlib_decompressobj__doc__, " dictionary as used by the compressor that produced the input data."); #define ZLIB_DECOMPRESSOBJ_METHODDEF \ - {"decompressobj", (PyCFunction)zlib_decompressobj, METH_FASTCALL|METH_KEYWORDS, zlib_decompressobj__doc__}, + {"decompressobj", (PyCFunction)(void(*)(void))zlib_decompressobj, METH_FASTCALL|METH_KEYWORDS, zlib_decompressobj__doc__}, static PyObject * zlib_decompressobj_impl(PyObject *module, int wbits, PyObject *zdict); @@ -247,7 +247,7 @@ PyDoc_STRVAR(zlib_Decompress_decompress__doc__, "Call the flush() method to clear these buffers."); #define ZLIB_DECOMPRESS_DECOMPRESS_METHODDEF \ - {"decompress", (PyCFunction)zlib_Decompress_decompress, METH_FASTCALL|METH_KEYWORDS, zlib_Decompress_decompress__doc__}, + {"decompress", (PyCFunction)(void(*)(void))zlib_Decompress_decompress, METH_FASTCALL|METH_KEYWORDS, zlib_Decompress_decompress__doc__}, static PyObject * zlib_Decompress_decompress_impl(compobject *self, Py_buffer *data, @@ -290,7 +290,7 @@ PyDoc_STRVAR(zlib_Compress_flush__doc__, " can still be compressed."); #define ZLIB_COMPRESS_FLUSH_METHODDEF \ - {"flush", (PyCFunction)zlib_Compress_flush, METH_FASTCALL, zlib_Compress_flush__doc__}, + {"flush", (PyCFunction)(void(*)(void))zlib_Compress_flush, METH_FASTCALL, zlib_Compress_flush__doc__}, static PyObject * zlib_Compress_flush_impl(compobject *self, int mode); @@ -431,7 +431,7 @@ PyDoc_STRVAR(zlib_Decompress_flush__doc__, " the initial size of the output buffer."); #define ZLIB_DECOMPRESS_FLUSH_METHODDEF \ - {"flush", (PyCFunction)zlib_Decompress_flush, METH_FASTCALL, zlib_Decompress_flush__doc__}, + {"flush", (PyCFunction)(void(*)(void))zlib_Decompress_flush, METH_FASTCALL, zlib_Decompress_flush__doc__}, static PyObject * zlib_Decompress_flush_impl(compobject *self, Py_ssize_t length); @@ -464,7 +464,7 @@ PyDoc_STRVAR(zlib_adler32__doc__, "The returned checksum is an integer."); #define ZLIB_ADLER32_METHODDEF \ - {"adler32", (PyCFunction)zlib_adler32, METH_FASTCALL, zlib_adler32__doc__}, + {"adler32", (PyCFunction)(void(*)(void))zlib_adler32, METH_FASTCALL, zlib_adler32__doc__}, static PyObject * zlib_adler32_impl(PyObject *module, Py_buffer *data, unsigned int value); @@ -503,7 +503,7 @@ PyDoc_STRVAR(zlib_crc32__doc__, "The returned checksum is an integer."); #define ZLIB_CRC32_METHODDEF \ - {"crc32", (PyCFunction)zlib_crc32, METH_FASTCALL, zlib_crc32__doc__}, + {"crc32", (PyCFunction)(void(*)(void))zlib_crc32, METH_FASTCALL, zlib_crc32__doc__}, static PyObject * zlib_crc32_impl(PyObject *module, Py_buffer *data, unsigned int value); @@ -553,4 +553,4 @@ zlib_crc32(PyObject *module, PyObject *const *args, Py_ssize_t nargs) #ifndef ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF #define ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF #endif /* !defined(ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF) */ -/*[clinic end generated code: output=d46c646770146ade input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e721c15e7af2d2fd input=a9049054013a1b77]*/ diff --git a/Objects/clinic/bytearrayobject.c.h b/Objects/clinic/bytearrayobject.c.h index d88883245ef6..f21353a17eae 100644 --- a/Objects/clinic/bytearrayobject.c.h +++ b/Objects/clinic/bytearrayobject.c.h @@ -51,7 +51,7 @@ PyDoc_STRVAR(bytearray_translate__doc__, "The remaining characters are mapped through the given translation table."); #define BYTEARRAY_TRANSLATE_METHODDEF \ - {"translate", (PyCFunction)bytearray_translate, METH_FASTCALL|METH_KEYWORDS, bytearray_translate__doc__}, + {"translate", (PyCFunction)(void(*)(void))bytearray_translate, METH_FASTCALL|METH_KEYWORDS, bytearray_translate__doc__}, static PyObject * bytearray_translate_impl(PyByteArrayObject *self, PyObject *table, @@ -88,7 +88,7 @@ PyDoc_STRVAR(bytearray_maketrans__doc__, "The bytes objects frm and to must be of the same length."); #define BYTEARRAY_MAKETRANS_METHODDEF \ - {"maketrans", (PyCFunction)bytearray_maketrans, METH_FASTCALL|METH_STATIC, bytearray_maketrans__doc__}, + {"maketrans", (PyCFunction)(void(*)(void))bytearray_maketrans, METH_FASTCALL|METH_STATIC, bytearray_maketrans__doc__}, static PyObject * bytearray_maketrans_impl(Py_buffer *frm, Py_buffer *to); @@ -133,7 +133,7 @@ PyDoc_STRVAR(bytearray_replace__doc__, "replaced."); #define BYTEARRAY_REPLACE_METHODDEF \ - {"replace", (PyCFunction)bytearray_replace, METH_FASTCALL, bytearray_replace__doc__}, + {"replace", (PyCFunction)(void(*)(void))bytearray_replace, METH_FASTCALL, bytearray_replace__doc__}, static PyObject * bytearray_replace_impl(PyByteArrayObject *self, Py_buffer *old, @@ -181,7 +181,7 @@ PyDoc_STRVAR(bytearray_split__doc__, " -1 (the default value) means no limit."); #define BYTEARRAY_SPLIT_METHODDEF \ - {"split", (PyCFunction)bytearray_split, METH_FASTCALL|METH_KEYWORDS, bytearray_split__doc__}, + {"split", (PyCFunction)(void(*)(void))bytearray_split, METH_FASTCALL|METH_KEYWORDS, bytearray_split__doc__}, static PyObject * bytearray_split_impl(PyByteArrayObject *self, PyObject *sep, @@ -256,7 +256,7 @@ PyDoc_STRVAR(bytearray_rsplit__doc__, "Splitting is done starting at the end of the bytearray and working to the front."); #define BYTEARRAY_RSPLIT_METHODDEF \ - {"rsplit", (PyCFunction)bytearray_rsplit, METH_FASTCALL|METH_KEYWORDS, bytearray_rsplit__doc__}, + {"rsplit", (PyCFunction)(void(*)(void))bytearray_rsplit, METH_FASTCALL|METH_KEYWORDS, bytearray_rsplit__doc__}, static PyObject * bytearray_rsplit_impl(PyByteArrayObject *self, PyObject *sep, @@ -311,7 +311,7 @@ PyDoc_STRVAR(bytearray_insert__doc__, " The item to be inserted."); #define BYTEARRAY_INSERT_METHODDEF \ - {"insert", (PyCFunction)bytearray_insert, METH_FASTCALL, bytearray_insert__doc__}, + {"insert", (PyCFunction)(void(*)(void))bytearray_insert, METH_FASTCALL, bytearray_insert__doc__}, static PyObject * bytearray_insert_impl(PyByteArrayObject *self, Py_ssize_t index, int item); @@ -388,7 +388,7 @@ PyDoc_STRVAR(bytearray_pop__doc__, "If no index argument is given, will pop the last item."); #define BYTEARRAY_POP_METHODDEF \ - {"pop", (PyCFunction)bytearray_pop, METH_FASTCALL, bytearray_pop__doc__}, + {"pop", (PyCFunction)(void(*)(void))bytearray_pop, METH_FASTCALL, bytearray_pop__doc__}, static PyObject * bytearray_pop_impl(PyByteArrayObject *self, Py_ssize_t index); @@ -448,7 +448,7 @@ PyDoc_STRVAR(bytearray_strip__doc__, "If the argument is omitted or None, strip leading and trailing ASCII whitespace."); #define BYTEARRAY_STRIP_METHODDEF \ - {"strip", (PyCFunction)bytearray_strip, METH_FASTCALL, bytearray_strip__doc__}, + {"strip", (PyCFunction)(void(*)(void))bytearray_strip, METH_FASTCALL, bytearray_strip__doc__}, static PyObject * bytearray_strip_impl(PyByteArrayObject *self, PyObject *bytes); @@ -479,7 +479,7 @@ PyDoc_STRVAR(bytearray_lstrip__doc__, "If the argument is omitted or None, strip leading ASCII whitespace."); #define BYTEARRAY_LSTRIP_METHODDEF \ - {"lstrip", (PyCFunction)bytearray_lstrip, METH_FASTCALL, bytearray_lstrip__doc__}, + {"lstrip", (PyCFunction)(void(*)(void))bytearray_lstrip, METH_FASTCALL, bytearray_lstrip__doc__}, static PyObject * bytearray_lstrip_impl(PyByteArrayObject *self, PyObject *bytes); @@ -510,7 +510,7 @@ PyDoc_STRVAR(bytearray_rstrip__doc__, "If the argument is omitted or None, strip trailing ASCII whitespace."); #define BYTEARRAY_RSTRIP_METHODDEF \ - {"rstrip", (PyCFunction)bytearray_rstrip, METH_FASTCALL, bytearray_rstrip__doc__}, + {"rstrip", (PyCFunction)(void(*)(void))bytearray_rstrip, METH_FASTCALL, bytearray_rstrip__doc__}, static PyObject * bytearray_rstrip_impl(PyByteArrayObject *self, PyObject *bytes); @@ -548,7 +548,7 @@ PyDoc_STRVAR(bytearray_decode__doc__, " can handle UnicodeDecodeErrors."); #define BYTEARRAY_DECODE_METHODDEF \ - {"decode", (PyCFunction)bytearray_decode, METH_FASTCALL|METH_KEYWORDS, bytearray_decode__doc__}, + {"decode", (PyCFunction)(void(*)(void))bytearray_decode, METH_FASTCALL|METH_KEYWORDS, bytearray_decode__doc__}, static PyObject * bytearray_decode_impl(PyByteArrayObject *self, const char *encoding, @@ -596,7 +596,7 @@ PyDoc_STRVAR(bytearray_splitlines__doc__, "true."); #define BYTEARRAY_SPLITLINES_METHODDEF \ - {"splitlines", (PyCFunction)bytearray_splitlines, METH_FASTCALL|METH_KEYWORDS, bytearray_splitlines__doc__}, + {"splitlines", (PyCFunction)(void(*)(void))bytearray_splitlines, METH_FASTCALL|METH_KEYWORDS, bytearray_splitlines__doc__}, static PyObject * bytearray_splitlines_impl(PyByteArrayObject *self, int keepends); @@ -674,7 +674,7 @@ PyDoc_STRVAR(bytearray_reduce_ex__doc__, "Return state information for pickling."); #define BYTEARRAY_REDUCE_EX_METHODDEF \ - {"__reduce_ex__", (PyCFunction)bytearray_reduce_ex, METH_FASTCALL, bytearray_reduce_ex__doc__}, + {"__reduce_ex__", (PyCFunction)(void(*)(void))bytearray_reduce_ex, METH_FASTCALL, bytearray_reduce_ex__doc__}, static PyObject * bytearray_reduce_ex_impl(PyByteArrayObject *self, int proto); @@ -712,4 +712,4 @@ bytearray_sizeof(PyByteArrayObject *self, PyObject *Py_UNUSED(ignored)) { return bytearray_sizeof_impl(self); } -/*[clinic end generated code: output=bb9051a369adb328 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b88bb192dddca6e1 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/bytesobject.c.h b/Objects/clinic/bytesobject.c.h index c781948ead0e..193d534fdd50 100644 --- a/Objects/clinic/bytesobject.c.h +++ b/Objects/clinic/bytesobject.c.h @@ -17,7 +17,7 @@ PyDoc_STRVAR(bytes_split__doc__, " -1 (the default value) means no limit."); #define BYTES_SPLIT_METHODDEF \ - {"split", (PyCFunction)bytes_split, METH_FASTCALL|METH_KEYWORDS, bytes_split__doc__}, + {"split", (PyCFunction)(void(*)(void))bytes_split, METH_FASTCALL|METH_KEYWORDS, bytes_split__doc__}, static PyObject * bytes_split_impl(PyBytesObject *self, PyObject *sep, Py_ssize_t maxsplit); @@ -136,7 +136,7 @@ PyDoc_STRVAR(bytes_rsplit__doc__, "Splitting is done starting at the end of the bytes and working to the front."); #define BYTES_RSPLIT_METHODDEF \ - {"rsplit", (PyCFunction)bytes_rsplit, METH_FASTCALL|METH_KEYWORDS, bytes_rsplit__doc__}, + {"rsplit", (PyCFunction)(void(*)(void))bytes_rsplit, METH_FASTCALL|METH_KEYWORDS, bytes_rsplit__doc__}, static PyObject * bytes_rsplit_impl(PyBytesObject *self, PyObject *sep, Py_ssize_t maxsplit); @@ -184,7 +184,7 @@ PyDoc_STRVAR(bytes_strip__doc__, "If the argument is omitted or None, strip leading and trailing ASCII whitespace."); #define BYTES_STRIP_METHODDEF \ - {"strip", (PyCFunction)bytes_strip, METH_FASTCALL, bytes_strip__doc__}, + {"strip", (PyCFunction)(void(*)(void))bytes_strip, METH_FASTCALL, bytes_strip__doc__}, static PyObject * bytes_strip_impl(PyBytesObject *self, PyObject *bytes); @@ -215,7 +215,7 @@ PyDoc_STRVAR(bytes_lstrip__doc__, "If the argument is omitted or None, strip leading ASCII whitespace."); #define BYTES_LSTRIP_METHODDEF \ - {"lstrip", (PyCFunction)bytes_lstrip, METH_FASTCALL, bytes_lstrip__doc__}, + {"lstrip", (PyCFunction)(void(*)(void))bytes_lstrip, METH_FASTCALL, bytes_lstrip__doc__}, static PyObject * bytes_lstrip_impl(PyBytesObject *self, PyObject *bytes); @@ -246,7 +246,7 @@ PyDoc_STRVAR(bytes_rstrip__doc__, "If the argument is omitted or None, strip trailing ASCII whitespace."); #define BYTES_RSTRIP_METHODDEF \ - {"rstrip", (PyCFunction)bytes_rstrip, METH_FASTCALL, bytes_rstrip__doc__}, + {"rstrip", (PyCFunction)(void(*)(void))bytes_rstrip, METH_FASTCALL, bytes_rstrip__doc__}, static PyObject * bytes_rstrip_impl(PyBytesObject *self, PyObject *bytes); @@ -281,7 +281,7 @@ PyDoc_STRVAR(bytes_translate__doc__, "The remaining characters are mapped through the given translation table."); #define BYTES_TRANSLATE_METHODDEF \ - {"translate", (PyCFunction)bytes_translate, METH_FASTCALL|METH_KEYWORDS, bytes_translate__doc__}, + {"translate", (PyCFunction)(void(*)(void))bytes_translate, METH_FASTCALL|METH_KEYWORDS, bytes_translate__doc__}, static PyObject * bytes_translate_impl(PyBytesObject *self, PyObject *table, @@ -318,7 +318,7 @@ PyDoc_STRVAR(bytes_maketrans__doc__, "The bytes objects frm and to must be of the same length."); #define BYTES_MAKETRANS_METHODDEF \ - {"maketrans", (PyCFunction)bytes_maketrans, METH_FASTCALL|METH_STATIC, bytes_maketrans__doc__}, + {"maketrans", (PyCFunction)(void(*)(void))bytes_maketrans, METH_FASTCALL|METH_STATIC, bytes_maketrans__doc__}, static PyObject * bytes_maketrans_impl(Py_buffer *frm, Py_buffer *to); @@ -363,7 +363,7 @@ PyDoc_STRVAR(bytes_replace__doc__, "replaced."); #define BYTES_REPLACE_METHODDEF \ - {"replace", (PyCFunction)bytes_replace, METH_FASTCALL, bytes_replace__doc__}, + {"replace", (PyCFunction)(void(*)(void))bytes_replace, METH_FASTCALL, bytes_replace__doc__}, static PyObject * bytes_replace_impl(PyBytesObject *self, Py_buffer *old, Py_buffer *new, @@ -412,7 +412,7 @@ PyDoc_STRVAR(bytes_decode__doc__, " can handle UnicodeDecodeErrors."); #define BYTES_DECODE_METHODDEF \ - {"decode", (PyCFunction)bytes_decode, METH_FASTCALL|METH_KEYWORDS, bytes_decode__doc__}, + {"decode", (PyCFunction)(void(*)(void))bytes_decode, METH_FASTCALL|METH_KEYWORDS, bytes_decode__doc__}, static PyObject * bytes_decode_impl(PyBytesObject *self, const char *encoding, @@ -447,7 +447,7 @@ PyDoc_STRVAR(bytes_splitlines__doc__, "true."); #define BYTES_SPLITLINES_METHODDEF \ - {"splitlines", (PyCFunction)bytes_splitlines, METH_FASTCALL|METH_KEYWORDS, bytes_splitlines__doc__}, + {"splitlines", (PyCFunction)(void(*)(void))bytes_splitlines, METH_FASTCALL|METH_KEYWORDS, bytes_splitlines__doc__}, static PyObject * bytes_splitlines_impl(PyBytesObject *self, int keepends); @@ -499,4 +499,4 @@ bytes_fromhex(PyTypeObject *type, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=470acd12b2534765 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=07b33ac65362301b input=a9049054013a1b77]*/ diff --git a/Objects/clinic/dictobject.c.h b/Objects/clinic/dictobject.c.h index 4f4c9fa9cb7a..5db3a426f459 100644 --- a/Objects/clinic/dictobject.c.h +++ b/Objects/clinic/dictobject.c.h @@ -9,7 +9,7 @@ PyDoc_STRVAR(dict_fromkeys__doc__, "Create a new dictionary with keys from iterable and values set to value."); #define DICT_FROMKEYS_METHODDEF \ - {"fromkeys", (PyCFunction)dict_fromkeys, METH_FASTCALL|METH_CLASS, dict_fromkeys__doc__}, + {"fromkeys", (PyCFunction)(void(*)(void))dict_fromkeys, METH_FASTCALL|METH_CLASS, dict_fromkeys__doc__}, static PyObject * dict_fromkeys_impl(PyTypeObject *type, PyObject *iterable, PyObject *value); @@ -48,7 +48,7 @@ PyDoc_STRVAR(dict_get__doc__, "Return the value for key if key is in the dictionary, else default."); #define DICT_GET_METHODDEF \ - {"get", (PyCFunction)dict_get, METH_FASTCALL, dict_get__doc__}, + {"get", (PyCFunction)(void(*)(void))dict_get, METH_FASTCALL, dict_get__doc__}, static PyObject * dict_get_impl(PyDictObject *self, PyObject *key, PyObject *default_value); @@ -80,7 +80,7 @@ PyDoc_STRVAR(dict_setdefault__doc__, "Return the value for key if key is in the dictionary, else default."); #define DICT_SETDEFAULT_METHODDEF \ - {"setdefault", (PyCFunction)dict_setdefault, METH_FASTCALL, dict_setdefault__doc__}, + {"setdefault", (PyCFunction)(void(*)(void))dict_setdefault, METH_FASTCALL, dict_setdefault__doc__}, static PyObject * dict_setdefault_impl(PyDictObject *self, PyObject *key, @@ -121,4 +121,4 @@ dict___reversed__(PyDictObject *self, PyObject *Py_UNUSED(ignored)) { return dict___reversed___impl(self); } -/*[clinic end generated code: output=b9923851cbd9213a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=193e08cb8099fe22 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/floatobject.c.h b/Objects/clinic/floatobject.c.h index ac3ff0c9f838..8ff2a2bebaa6 100644 --- a/Objects/clinic/floatobject.c.h +++ b/Objects/clinic/floatobject.c.h @@ -47,7 +47,7 @@ PyDoc_STRVAR(float___round____doc__, "When an argument is passed, work like built-in round(x, ndigits)."); #define FLOAT___ROUND___METHODDEF \ - {"__round__", (PyCFunction)float___round__, METH_FASTCALL, float___round____doc__}, + {"__round__", (PyCFunction)(void(*)(void))float___round__, METH_FASTCALL, float___round____doc__}, static PyObject * float___round___impl(PyObject *self, PyObject *o_ndigits); @@ -256,7 +256,7 @@ PyDoc_STRVAR(float___set_format____doc__, "This affects how floats are converted to and from binary strings."); #define FLOAT___SET_FORMAT___METHODDEF \ - {"__set_format__", (PyCFunction)float___set_format__, METH_FASTCALL|METH_CLASS, float___set_format____doc__}, + {"__set_format__", (PyCFunction)(void(*)(void))float___set_format__, METH_FASTCALL|METH_CLASS, float___set_format____doc__}, static PyObject * float___set_format___impl(PyTypeObject *type, const char *typestr, @@ -305,4 +305,4 @@ float___format__(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=a3c366a156be61f9 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=091dd499f5386a6c input=a9049054013a1b77]*/ diff --git a/Objects/clinic/listobject.c.h b/Objects/clinic/listobject.c.h index 63da672ca3dd..0097481dbaed 100644 --- a/Objects/clinic/listobject.c.h +++ b/Objects/clinic/listobject.c.h @@ -9,7 +9,7 @@ PyDoc_STRVAR(list_insert__doc__, "Insert object before index."); #define LIST_INSERT_METHODDEF \ - {"insert", (PyCFunction)list_insert, METH_FASTCALL, list_insert__doc__}, + {"insert", (PyCFunction)(void(*)(void))list_insert, METH_FASTCALL, list_insert__doc__}, static PyObject * list_insert_impl(PyListObject *self, Py_ssize_t index, PyObject *object); @@ -94,7 +94,7 @@ PyDoc_STRVAR(list_pop__doc__, "Raises IndexError if list is empty or index is out of range."); #define LIST_POP_METHODDEF \ - {"pop", (PyCFunction)list_pop, METH_FASTCALL, list_pop__doc__}, + {"pop", (PyCFunction)(void(*)(void))list_pop, METH_FASTCALL, list_pop__doc__}, static PyObject * list_pop_impl(PyListObject *self, Py_ssize_t index); @@ -122,7 +122,7 @@ PyDoc_STRVAR(list_sort__doc__, "Stable sort *IN PLACE*."); #define LIST_SORT_METHODDEF \ - {"sort", (PyCFunction)list_sort, METH_FASTCALL|METH_KEYWORDS, list_sort__doc__}, + {"sort", (PyCFunction)(void(*)(void))list_sort, METH_FASTCALL|METH_KEYWORDS, list_sort__doc__}, static PyObject * list_sort_impl(PyListObject *self, PyObject *keyfunc, int reverse); @@ -173,7 +173,7 @@ PyDoc_STRVAR(list_index__doc__, "Raises ValueError if the value is not present."); #define LIST_INDEX_METHODDEF \ - {"index", (PyCFunction)list_index, METH_FASTCALL, list_index__doc__}, + {"index", (PyCFunction)(void(*)(void))list_index, METH_FASTCALL, list_index__doc__}, static PyObject * list_index_impl(PyListObject *self, PyObject *value, Py_ssize_t start, @@ -285,4 +285,4 @@ list___reversed__(PyListObject *self, PyObject *Py_UNUSED(ignored)) { return list___reversed___impl(self); } -/*[clinic end generated code: output=d8cb29e6e6d79844 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=652ae4ee63a9de71 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/longobject.c.h b/Objects/clinic/longobject.c.h index 0e70fe5d8c44..3c33993e83c0 100644 --- a/Objects/clinic/longobject.c.h +++ b/Objects/clinic/longobject.c.h @@ -167,7 +167,7 @@ PyDoc_STRVAR(int_to_bytes__doc__, " is raised."); #define INT_TO_BYTES_METHODDEF \ - {"to_bytes", (PyCFunction)int_to_bytes, METH_FASTCALL|METH_KEYWORDS, int_to_bytes__doc__}, + {"to_bytes", (PyCFunction)(void(*)(void))int_to_bytes, METH_FASTCALL|METH_KEYWORDS, int_to_bytes__doc__}, static PyObject * int_to_bytes_impl(PyObject *self, Py_ssize_t length, PyObject *byteorder, @@ -214,7 +214,7 @@ PyDoc_STRVAR(int_from_bytes__doc__, " Indicates whether two\'s complement is used to represent the integer."); #define INT_FROM_BYTES_METHODDEF \ - {"from_bytes", (PyCFunction)int_from_bytes, METH_FASTCALL|METH_KEYWORDS|METH_CLASS, int_from_bytes__doc__}, + {"from_bytes", (PyCFunction)(void(*)(void))int_from_bytes, METH_FASTCALL|METH_KEYWORDS|METH_CLASS, int_from_bytes__doc__}, static PyObject * int_from_bytes_impl(PyTypeObject *type, PyObject *bytes_obj, @@ -239,4 +239,4 @@ int_from_bytes(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs, PyOb exit: return return_value; } -/*[clinic end generated code: output=6d5e92d7dc803751 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=403ccd096555fd1e input=a9049054013a1b77]*/ diff --git a/Objects/clinic/odictobject.c.h b/Objects/clinic/odictobject.c.h index 15a8bece0378..1aea36ec94c9 100644 --- a/Objects/clinic/odictobject.c.h +++ b/Objects/clinic/odictobject.c.h @@ -9,7 +9,7 @@ PyDoc_STRVAR(OrderedDict_fromkeys__doc__, "Create a new ordered dictionary with keys from iterable and values set to value."); #define ORDEREDDICT_FROMKEYS_METHODDEF \ - {"fromkeys", (PyCFunction)OrderedDict_fromkeys, METH_FASTCALL|METH_KEYWORDS|METH_CLASS, OrderedDict_fromkeys__doc__}, + {"fromkeys", (PyCFunction)(void(*)(void))OrderedDict_fromkeys, METH_FASTCALL|METH_KEYWORDS|METH_CLASS, OrderedDict_fromkeys__doc__}, static PyObject * OrderedDict_fromkeys_impl(PyTypeObject *type, PyObject *seq, PyObject *value); @@ -42,7 +42,7 @@ PyDoc_STRVAR(OrderedDict_setdefault__doc__, "Return the value for key if key is in the dictionary, else default."); #define ORDEREDDICT_SETDEFAULT_METHODDEF \ - {"setdefault", (PyCFunction)OrderedDict_setdefault, METH_FASTCALL|METH_KEYWORDS, OrderedDict_setdefault__doc__}, + {"setdefault", (PyCFunction)(void(*)(void))OrderedDict_setdefault, METH_FASTCALL|METH_KEYWORDS, OrderedDict_setdefault__doc__}, static PyObject * OrderedDict_setdefault_impl(PyODictObject *self, PyObject *key, @@ -76,7 +76,7 @@ PyDoc_STRVAR(OrderedDict_popitem__doc__, "Pairs are returned in LIFO order if last is true or FIFO order if false."); #define ORDEREDDICT_POPITEM_METHODDEF \ - {"popitem", (PyCFunction)OrderedDict_popitem, METH_FASTCALL|METH_KEYWORDS, OrderedDict_popitem__doc__}, + {"popitem", (PyCFunction)(void(*)(void))OrderedDict_popitem, METH_FASTCALL|METH_KEYWORDS, OrderedDict_popitem__doc__}, static PyObject * OrderedDict_popitem_impl(PyODictObject *self, int last); @@ -108,7 +108,7 @@ PyDoc_STRVAR(OrderedDict_move_to_end__doc__, "Raise KeyError if the element does not exist."); #define ORDEREDDICT_MOVE_TO_END_METHODDEF \ - {"move_to_end", (PyCFunction)OrderedDict_move_to_end, METH_FASTCALL|METH_KEYWORDS, OrderedDict_move_to_end__doc__}, + {"move_to_end", (PyCFunction)(void(*)(void))OrderedDict_move_to_end, METH_FASTCALL|METH_KEYWORDS, OrderedDict_move_to_end__doc__}, static PyObject * OrderedDict_move_to_end_impl(PyODictObject *self, PyObject *key, int last); @@ -131,4 +131,4 @@ OrderedDict_move_to_end(PyODictObject *self, PyObject *const *args, Py_ssize_t n exit: return return_value; } -/*[clinic end generated code: output=7f23d569eda2a558 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f6f189e1fe032e0b input=a9049054013a1b77]*/ diff --git a/Objects/clinic/tupleobject.c.h b/Objects/clinic/tupleobject.c.h index bef900515b55..67d9f340e083 100644 --- a/Objects/clinic/tupleobject.c.h +++ b/Objects/clinic/tupleobject.c.h @@ -11,7 +11,7 @@ PyDoc_STRVAR(tuple_index__doc__, "Raises ValueError if the value is not present."); #define TUPLE_INDEX_METHODDEF \ - {"index", (PyCFunction)tuple_index, METH_FASTCALL, tuple_index__doc__}, + {"index", (PyCFunction)(void(*)(void))tuple_index, METH_FASTCALL, tuple_index__doc__}, static PyObject * tuple_index_impl(PyTupleObject *self, PyObject *value, Py_ssize_t start, @@ -95,4 +95,4 @@ tuple___getnewargs__(PyTupleObject *self, PyObject *Py_UNUSED(ignored)) { return tuple___getnewargs___impl(self); } -/*[clinic end generated code: output=0fbf4321fb4365ac input=a9049054013a1b77]*/ +/*[clinic end generated code: output=0a6ebd2d16b09c5d input=a9049054013a1b77]*/ diff --git a/Objects/clinic/unicodeobject.c.h b/Objects/clinic/unicodeobject.c.h index 21937802d293..273ae9240636 100644 --- a/Objects/clinic/unicodeobject.c.h +++ b/Objects/clinic/unicodeobject.c.h @@ -71,7 +71,7 @@ PyDoc_STRVAR(unicode_center__doc__, "Padding is done using the specified fill character (default is a space)."); #define UNICODE_CENTER_METHODDEF \ - {"center", (PyCFunction)unicode_center, METH_FASTCALL, unicode_center__doc__}, + {"center", (PyCFunction)(void(*)(void))unicode_center, METH_FASTCALL, unicode_center__doc__}, static PyObject * unicode_center_impl(PyObject *self, Py_ssize_t width, Py_UCS4 fillchar); @@ -109,7 +109,7 @@ PyDoc_STRVAR(unicode_encode__doc__, " codecs.register_error that can handle UnicodeEncodeErrors."); #define UNICODE_ENCODE_METHODDEF \ - {"encode", (PyCFunction)unicode_encode, METH_FASTCALL|METH_KEYWORDS, unicode_encode__doc__}, + {"encode", (PyCFunction)(void(*)(void))unicode_encode, METH_FASTCALL|METH_KEYWORDS, unicode_encode__doc__}, static PyObject * unicode_encode_impl(PyObject *self, const char *encoding, const char *errors); @@ -142,7 +142,7 @@ PyDoc_STRVAR(unicode_expandtabs__doc__, "If tabsize is not given, a tab size of 8 characters is assumed."); #define UNICODE_EXPANDTABS_METHODDEF \ - {"expandtabs", (PyCFunction)unicode_expandtabs, METH_FASTCALL|METH_KEYWORDS, unicode_expandtabs__doc__}, + {"expandtabs", (PyCFunction)(void(*)(void))unicode_expandtabs, METH_FASTCALL|METH_KEYWORDS, unicode_expandtabs__doc__}, static PyObject * unicode_expandtabs_impl(PyObject *self, int tabsize); @@ -440,7 +440,7 @@ PyDoc_STRVAR(unicode_ljust__doc__, "Padding is done using the specified fill character (default is a space)."); #define UNICODE_LJUST_METHODDEF \ - {"ljust", (PyCFunction)unicode_ljust, METH_FASTCALL, unicode_ljust__doc__}, + {"ljust", (PyCFunction)(void(*)(void))unicode_ljust, METH_FASTCALL, unicode_ljust__doc__}, static PyObject * unicode_ljust_impl(PyObject *self, Py_ssize_t width, Py_UCS4 fillchar); @@ -489,7 +489,7 @@ PyDoc_STRVAR(unicode_strip__doc__, "If chars is given and not None, remove characters in chars instead."); #define UNICODE_STRIP_METHODDEF \ - {"strip", (PyCFunction)unicode_strip, METH_FASTCALL, unicode_strip__doc__}, + {"strip", (PyCFunction)(void(*)(void))unicode_strip, METH_FASTCALL, unicode_strip__doc__}, static PyObject * unicode_strip_impl(PyObject *self, PyObject *chars); @@ -520,7 +520,7 @@ PyDoc_STRVAR(unicode_lstrip__doc__, "If chars is given and not None, remove characters in chars instead."); #define UNICODE_LSTRIP_METHODDEF \ - {"lstrip", (PyCFunction)unicode_lstrip, METH_FASTCALL, unicode_lstrip__doc__}, + {"lstrip", (PyCFunction)(void(*)(void))unicode_lstrip, METH_FASTCALL, unicode_lstrip__doc__}, static PyObject * unicode_lstrip_impl(PyObject *self, PyObject *chars); @@ -551,7 +551,7 @@ PyDoc_STRVAR(unicode_rstrip__doc__, "If chars is given and not None, remove characters in chars instead."); #define UNICODE_RSTRIP_METHODDEF \ - {"rstrip", (PyCFunction)unicode_rstrip, METH_FASTCALL, unicode_rstrip__doc__}, + {"rstrip", (PyCFunction)(void(*)(void))unicode_rstrip, METH_FASTCALL, unicode_rstrip__doc__}, static PyObject * unicode_rstrip_impl(PyObject *self, PyObject *chars); @@ -587,7 +587,7 @@ PyDoc_STRVAR(unicode_replace__doc__, "replaced."); #define UNICODE_REPLACE_METHODDEF \ - {"replace", (PyCFunction)unicode_replace, METH_FASTCALL, unicode_replace__doc__}, + {"replace", (PyCFunction)(void(*)(void))unicode_replace, METH_FASTCALL, unicode_replace__doc__}, static PyObject * unicode_replace_impl(PyObject *self, PyObject *old, PyObject *new, @@ -620,7 +620,7 @@ PyDoc_STRVAR(unicode_rjust__doc__, "Padding is done using the specified fill character (default is a space)."); #define UNICODE_RJUST_METHODDEF \ - {"rjust", (PyCFunction)unicode_rjust, METH_FASTCALL, unicode_rjust__doc__}, + {"rjust", (PyCFunction)(void(*)(void))unicode_rjust, METH_FASTCALL, unicode_rjust__doc__}, static PyObject * unicode_rjust_impl(PyObject *self, Py_ssize_t width, Py_UCS4 fillchar); @@ -657,7 +657,7 @@ PyDoc_STRVAR(unicode_split__doc__, " -1 (the default value) means no limit."); #define UNICODE_SPLIT_METHODDEF \ - {"split", (PyCFunction)unicode_split, METH_FASTCALL|METH_KEYWORDS, unicode_split__doc__}, + {"split", (PyCFunction)(void(*)(void))unicode_split, METH_FASTCALL|METH_KEYWORDS, unicode_split__doc__}, static PyObject * unicode_split_impl(PyObject *self, PyObject *sep, Py_ssize_t maxsplit); @@ -730,7 +730,7 @@ PyDoc_STRVAR(unicode_rsplit__doc__, "Splits are done starting at the end of the string and working to the front."); #define UNICODE_RSPLIT_METHODDEF \ - {"rsplit", (PyCFunction)unicode_rsplit, METH_FASTCALL|METH_KEYWORDS, unicode_rsplit__doc__}, + {"rsplit", (PyCFunction)(void(*)(void))unicode_rsplit, METH_FASTCALL|METH_KEYWORDS, unicode_rsplit__doc__}, static PyObject * unicode_rsplit_impl(PyObject *self, PyObject *sep, Py_ssize_t maxsplit); @@ -764,7 +764,7 @@ PyDoc_STRVAR(unicode_splitlines__doc__, "true."); #define UNICODE_SPLITLINES_METHODDEF \ - {"splitlines", (PyCFunction)unicode_splitlines, METH_FASTCALL|METH_KEYWORDS, unicode_splitlines__doc__}, + {"splitlines", (PyCFunction)(void(*)(void))unicode_splitlines, METH_FASTCALL|METH_KEYWORDS, unicode_splitlines__doc__}, static PyObject * unicode_splitlines_impl(PyObject *self, int keepends); @@ -820,7 +820,7 @@ PyDoc_STRVAR(unicode_maketrans__doc__, "must be a string, whose characters will be mapped to None in the result."); #define UNICODE_MAKETRANS_METHODDEF \ - {"maketrans", (PyCFunction)unicode_maketrans, METH_FASTCALL|METH_STATIC, unicode_maketrans__doc__}, + {"maketrans", (PyCFunction)(void(*)(void))unicode_maketrans, METH_FASTCALL|METH_STATIC, unicode_maketrans__doc__}, static PyObject * unicode_maketrans_impl(PyObject *x, PyObject *y, PyObject *z); @@ -951,4 +951,4 @@ unicode_sizeof(PyObject *self, PyObject *Py_UNUSED(ignored)) { return unicode_sizeof_impl(self); } -/*[clinic end generated code: output=8bcd992b25733bcc input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d323802b67bfc6d8 input=a9049054013a1b77]*/ diff --git a/Objects/stringlib/clinic/transmogrify.h.h b/Objects/stringlib/clinic/transmogrify.h.h index 6d266225c020..fb63060d450a 100644 --- a/Objects/stringlib/clinic/transmogrify.h.h +++ b/Objects/stringlib/clinic/transmogrify.h.h @@ -11,7 +11,7 @@ PyDoc_STRVAR(stringlib_expandtabs__doc__, "If tabsize is not given, a tab size of 8 characters is assumed."); #define STRINGLIB_EXPANDTABS_METHODDEF \ - {"expandtabs", (PyCFunction)stringlib_expandtabs, METH_FASTCALL|METH_KEYWORDS, stringlib_expandtabs__doc__}, + {"expandtabs", (PyCFunction)(void(*)(void))stringlib_expandtabs, METH_FASTCALL|METH_KEYWORDS, stringlib_expandtabs__doc__}, static PyObject * stringlib_expandtabs_impl(PyObject *self, int tabsize); @@ -43,7 +43,7 @@ PyDoc_STRVAR(stringlib_ljust__doc__, "Padding is done using the specified fill character."); #define STRINGLIB_LJUST_METHODDEF \ - {"ljust", (PyCFunction)stringlib_ljust, METH_FASTCALL, stringlib_ljust__doc__}, + {"ljust", (PyCFunction)(void(*)(void))stringlib_ljust, METH_FASTCALL, stringlib_ljust__doc__}, static PyObject * stringlib_ljust_impl(PyObject *self, Py_ssize_t width, char fillchar); @@ -74,7 +74,7 @@ PyDoc_STRVAR(stringlib_rjust__doc__, "Padding is done using the specified fill character."); #define STRINGLIB_RJUST_METHODDEF \ - {"rjust", (PyCFunction)stringlib_rjust, METH_FASTCALL, stringlib_rjust__doc__}, + {"rjust", (PyCFunction)(void(*)(void))stringlib_rjust, METH_FASTCALL, stringlib_rjust__doc__}, static PyObject * stringlib_rjust_impl(PyObject *self, Py_ssize_t width, char fillchar); @@ -105,7 +105,7 @@ PyDoc_STRVAR(stringlib_center__doc__, "Padding is done using the specified fill character."); #define STRINGLIB_CENTER_METHODDEF \ - {"center", (PyCFunction)stringlib_center, METH_FASTCALL, stringlib_center__doc__}, + {"center", (PyCFunction)(void(*)(void))stringlib_center, METH_FASTCALL, stringlib_center__doc__}, static PyObject * stringlib_center_impl(PyObject *self, Py_ssize_t width, char fillchar); @@ -155,4 +155,4 @@ stringlib_zfill(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=336620159a1fc70d input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d09ba158d470566e input=a9049054013a1b77]*/ diff --git a/PC/clinic/_testconsole.c.h b/PC/clinic/_testconsole.c.h index 8112e789ff69..2809f2aa6e68 100644 --- a/PC/clinic/_testconsole.c.h +++ b/PC/clinic/_testconsole.c.h @@ -11,7 +11,7 @@ PyDoc_STRVAR(_testconsole_write_input__doc__, "Writes UTF-16-LE encoded bytes to the console as if typed by a user."); #define _TESTCONSOLE_WRITE_INPUT_METHODDEF \ - {"write_input", (PyCFunction)_testconsole_write_input, METH_FASTCALL|METH_KEYWORDS, _testconsole_write_input__doc__}, + {"write_input", (PyCFunction)(void(*)(void))_testconsole_write_input, METH_FASTCALL|METH_KEYWORDS, _testconsole_write_input__doc__}, static PyObject * _testconsole_write_input_impl(PyObject *module, PyObject *file, @@ -47,7 +47,7 @@ PyDoc_STRVAR(_testconsole_read_output__doc__, "Reads a str from the console as written to stdout."); #define _TESTCONSOLE_READ_OUTPUT_METHODDEF \ - {"read_output", (PyCFunction)_testconsole_read_output, METH_FASTCALL|METH_KEYWORDS, _testconsole_read_output__doc__}, + {"read_output", (PyCFunction)(void(*)(void))_testconsole_read_output, METH_FASTCALL|METH_KEYWORDS, _testconsole_read_output__doc__}, static PyObject * _testconsole_read_output_impl(PyObject *module, PyObject *file); @@ -79,4 +79,4 @@ _testconsole_read_output(PyObject *module, PyObject *const *args, Py_ssize_t nar #ifndef _TESTCONSOLE_READ_OUTPUT_METHODDEF #define _TESTCONSOLE_READ_OUTPUT_METHODDEF #endif /* !defined(_TESTCONSOLE_READ_OUTPUT_METHODDEF) */ -/*[clinic end generated code: output=e7dd05a60463c5f0 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ab9ea8e78d26288e input=a9049054013a1b77]*/ diff --git a/PC/clinic/msvcrtmodule.c.h b/PC/clinic/msvcrtmodule.c.h index 22ddfea80248..0466306b2404 100644 --- a/PC/clinic/msvcrtmodule.c.h +++ b/PC/clinic/msvcrtmodule.c.h @@ -37,7 +37,7 @@ PyDoc_STRVAR(msvcrt_locking__doc__, "individually."); #define MSVCRT_LOCKING_METHODDEF \ - {"locking", (PyCFunction)msvcrt_locking, METH_FASTCALL, msvcrt_locking__doc__}, + {"locking", (PyCFunction)(void(*)(void))msvcrt_locking, METH_FASTCALL, msvcrt_locking__doc__}, static PyObject * msvcrt_locking_impl(PyObject *module, int fd, int mode, long nbytes); @@ -72,7 +72,7 @@ PyDoc_STRVAR(msvcrt_setmode__doc__, "Return value is the previous mode."); #define MSVCRT_SETMODE_METHODDEF \ - {"setmode", (PyCFunction)msvcrt_setmode, METH_FASTCALL, msvcrt_setmode__doc__}, + {"setmode", (PyCFunction)(void(*)(void))msvcrt_setmode, METH_FASTCALL, msvcrt_setmode__doc__}, static long msvcrt_setmode_impl(PyObject *module, int fd, int flags); @@ -110,7 +110,7 @@ PyDoc_STRVAR(msvcrt_open_osfhandle__doc__, "to os.fdopen() to create a file object."); #define MSVCRT_OPEN_OSFHANDLE_METHODDEF \ - {"open_osfhandle", (PyCFunction)msvcrt_open_osfhandle, METH_FASTCALL, msvcrt_open_osfhandle__doc__}, + {"open_osfhandle", (PyCFunction)(void(*)(void))msvcrt_open_osfhandle, METH_FASTCALL, msvcrt_open_osfhandle__doc__}, static long msvcrt_open_osfhandle_impl(PyObject *module, void *handle, int flags); @@ -424,7 +424,7 @@ PyDoc_STRVAR(msvcrt_CrtSetReportFile__doc__, "Only available on Debug builds."); #define MSVCRT_CRTSETREPORTFILE_METHODDEF \ - {"CrtSetReportFile", (PyCFunction)msvcrt_CrtSetReportFile, METH_FASTCALL, msvcrt_CrtSetReportFile__doc__}, + {"CrtSetReportFile", (PyCFunction)(void(*)(void))msvcrt_CrtSetReportFile, METH_FASTCALL, msvcrt_CrtSetReportFile__doc__}, static void * msvcrt_CrtSetReportFile_impl(PyObject *module, int type, void *file); @@ -464,7 +464,7 @@ PyDoc_STRVAR(msvcrt_CrtSetReportMode__doc__, "Only available on Debug builds."); #define MSVCRT_CRTSETREPORTMODE_METHODDEF \ - {"CrtSetReportMode", (PyCFunction)msvcrt_CrtSetReportMode, METH_FASTCALL, msvcrt_CrtSetReportMode__doc__}, + {"CrtSetReportMode", (PyCFunction)(void(*)(void))msvcrt_CrtSetReportMode, METH_FASTCALL, msvcrt_CrtSetReportMode__doc__}, static long msvcrt_CrtSetReportMode_impl(PyObject *module, int type, int mode); @@ -569,4 +569,4 @@ msvcrt_SetErrorMode(PyObject *module, PyObject *arg) #ifndef MSVCRT_SET_ERROR_MODE_METHODDEF #define MSVCRT_SET_ERROR_MODE_METHODDEF #endif /* !defined(MSVCRT_SET_ERROR_MODE_METHODDEF) */ -/*[clinic end generated code: output=3dd4cf62afb9771a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=632089ff9236ac77 input=a9049054013a1b77]*/ diff --git a/PC/clinic/winreg.c.h b/PC/clinic/winreg.c.h index 69781a969285..1a5356335521 100644 --- a/PC/clinic/winreg.c.h +++ b/PC/clinic/winreg.c.h @@ -77,7 +77,7 @@ PyDoc_STRVAR(winreg_HKEYType___exit____doc__, "\n"); #define WINREG_HKEYTYPE___EXIT___METHODDEF \ - {"__exit__", (PyCFunction)winreg_HKEYType___exit__, METH_FASTCALL|METH_KEYWORDS, winreg_HKEYType___exit____doc__}, + {"__exit__", (PyCFunction)(void(*)(void))winreg_HKEYType___exit__, METH_FASTCALL|METH_KEYWORDS, winreg_HKEYType___exit____doc__}, static PyObject * winreg_HKEYType___exit___impl(PyHKEYObject *self, PyObject *exc_type, @@ -134,7 +134,7 @@ PyDoc_STRVAR(winreg_ConnectRegistry__doc__, "If the function fails, an OSError exception is raised."); #define WINREG_CONNECTREGISTRY_METHODDEF \ - {"ConnectRegistry", (PyCFunction)winreg_ConnectRegistry, METH_FASTCALL, winreg_ConnectRegistry__doc__}, + {"ConnectRegistry", (PyCFunction)(void(*)(void))winreg_ConnectRegistry, METH_FASTCALL, winreg_ConnectRegistry__doc__}, static HKEY winreg_ConnectRegistry_impl(PyObject *module, Py_UNICODE *computer_name, @@ -182,7 +182,7 @@ PyDoc_STRVAR(winreg_CreateKey__doc__, "If the function fails, an OSError exception is raised."); #define WINREG_CREATEKEY_METHODDEF \ - {"CreateKey", (PyCFunction)winreg_CreateKey, METH_FASTCALL, winreg_CreateKey__doc__}, + {"CreateKey", (PyCFunction)(void(*)(void))winreg_CreateKey, METH_FASTCALL, winreg_CreateKey__doc__}, static HKEY winreg_CreateKey_impl(PyObject *module, HKEY key, Py_UNICODE *sub_key); @@ -235,7 +235,7 @@ PyDoc_STRVAR(winreg_CreateKeyEx__doc__, "If the function fails, an OSError exception is raised."); #define WINREG_CREATEKEYEX_METHODDEF \ - {"CreateKeyEx", (PyCFunction)winreg_CreateKeyEx, METH_FASTCALL|METH_KEYWORDS, winreg_CreateKeyEx__doc__}, + {"CreateKeyEx", (PyCFunction)(void(*)(void))winreg_CreateKeyEx, METH_FASTCALL|METH_KEYWORDS, winreg_CreateKeyEx__doc__}, static HKEY winreg_CreateKeyEx_impl(PyObject *module, HKEY key, Py_UNICODE *sub_key, @@ -286,7 +286,7 @@ PyDoc_STRVAR(winreg_DeleteKey__doc__, "is removed. If the function fails, an OSError exception is raised."); #define WINREG_DELETEKEY_METHODDEF \ - {"DeleteKey", (PyCFunction)winreg_DeleteKey, METH_FASTCALL, winreg_DeleteKey__doc__}, + {"DeleteKey", (PyCFunction)(void(*)(void))winreg_DeleteKey, METH_FASTCALL, winreg_DeleteKey__doc__}, static PyObject * winreg_DeleteKey_impl(PyObject *module, HKEY key, Py_UNICODE *sub_key); @@ -334,7 +334,7 @@ PyDoc_STRVAR(winreg_DeleteKeyEx__doc__, "On unsupported Windows versions, NotImplementedError is raised."); #define WINREG_DELETEKEYEX_METHODDEF \ - {"DeleteKeyEx", (PyCFunction)winreg_DeleteKeyEx, METH_FASTCALL|METH_KEYWORDS, winreg_DeleteKeyEx__doc__}, + {"DeleteKeyEx", (PyCFunction)(void(*)(void))winreg_DeleteKeyEx, METH_FASTCALL|METH_KEYWORDS, winreg_DeleteKeyEx__doc__}, static PyObject * winreg_DeleteKeyEx_impl(PyObject *module, HKEY key, Py_UNICODE *sub_key, @@ -373,7 +373,7 @@ PyDoc_STRVAR(winreg_DeleteValue__doc__, " A string that identifies the value to remove."); #define WINREG_DELETEVALUE_METHODDEF \ - {"DeleteValue", (PyCFunction)winreg_DeleteValue, METH_FASTCALL, winreg_DeleteValue__doc__}, + {"DeleteValue", (PyCFunction)(void(*)(void))winreg_DeleteValue, METH_FASTCALL, winreg_DeleteValue__doc__}, static PyObject * winreg_DeleteValue_impl(PyObject *module, HKEY key, Py_UNICODE *value); @@ -411,7 +411,7 @@ PyDoc_STRVAR(winreg_EnumKey__doc__, "raised, indicating no more values are available."); #define WINREG_ENUMKEY_METHODDEF \ - {"EnumKey", (PyCFunction)winreg_EnumKey, METH_FASTCALL, winreg_EnumKey__doc__}, + {"EnumKey", (PyCFunction)(void(*)(void))winreg_EnumKey, METH_FASTCALL, winreg_EnumKey__doc__}, static PyObject * winreg_EnumKey_impl(PyObject *module, HKEY key, int index); @@ -458,7 +458,7 @@ PyDoc_STRVAR(winreg_EnumValue__doc__, " An integer that identifies the type of the value data."); #define WINREG_ENUMVALUE_METHODDEF \ - {"EnumValue", (PyCFunction)winreg_EnumValue, METH_FASTCALL, winreg_EnumValue__doc__}, + {"EnumValue", (PyCFunction)(void(*)(void))winreg_EnumValue, METH_FASTCALL, winreg_EnumValue__doc__}, static PyObject * winreg_EnumValue_impl(PyObject *module, HKEY key, int index); @@ -576,7 +576,7 @@ PyDoc_STRVAR(winreg_LoadKey__doc__, "tree."); #define WINREG_LOADKEY_METHODDEF \ - {"LoadKey", (PyCFunction)winreg_LoadKey, METH_FASTCALL, winreg_LoadKey__doc__}, + {"LoadKey", (PyCFunction)(void(*)(void))winreg_LoadKey, METH_FASTCALL, winreg_LoadKey__doc__}, static PyObject * winreg_LoadKey_impl(PyObject *module, HKEY key, Py_UNICODE *sub_key, @@ -620,7 +620,7 @@ PyDoc_STRVAR(winreg_OpenKey__doc__, "If the function fails, an OSError exception is raised."); #define WINREG_OPENKEY_METHODDEF \ - {"OpenKey", (PyCFunction)winreg_OpenKey, METH_FASTCALL|METH_KEYWORDS, winreg_OpenKey__doc__}, + {"OpenKey", (PyCFunction)(void(*)(void))winreg_OpenKey, METH_FASTCALL|METH_KEYWORDS, winreg_OpenKey__doc__}, static HKEY winreg_OpenKey_impl(PyObject *module, HKEY key, Py_UNICODE *sub_key, @@ -672,7 +672,7 @@ PyDoc_STRVAR(winreg_OpenKeyEx__doc__, "If the function fails, an OSError exception is raised."); #define WINREG_OPENKEYEX_METHODDEF \ - {"OpenKeyEx", (PyCFunction)winreg_OpenKeyEx, METH_FASTCALL|METH_KEYWORDS, winreg_OpenKeyEx__doc__}, + {"OpenKeyEx", (PyCFunction)(void(*)(void))winreg_OpenKeyEx, METH_FASTCALL|METH_KEYWORDS, winreg_OpenKeyEx__doc__}, static HKEY winreg_OpenKeyEx_impl(PyObject *module, HKEY key, Py_UNICODE *sub_key, @@ -761,7 +761,7 @@ PyDoc_STRVAR(winreg_QueryValue__doc__, "completeness."); #define WINREG_QUERYVALUE_METHODDEF \ - {"QueryValue", (PyCFunction)winreg_QueryValue, METH_FASTCALL, winreg_QueryValue__doc__}, + {"QueryValue", (PyCFunction)(void(*)(void))winreg_QueryValue, METH_FASTCALL, winreg_QueryValue__doc__}, static PyObject * winreg_QueryValue_impl(PyObject *module, HKEY key, Py_UNICODE *sub_key); @@ -800,7 +800,7 @@ PyDoc_STRVAR(winreg_QueryValueEx__doc__, "The return value is a tuple of the value and the type_id."); #define WINREG_QUERYVALUEEX_METHODDEF \ - {"QueryValueEx", (PyCFunction)winreg_QueryValueEx, METH_FASTCALL, winreg_QueryValueEx__doc__}, + {"QueryValueEx", (PyCFunction)(void(*)(void))winreg_QueryValueEx, METH_FASTCALL, winreg_QueryValueEx__doc__}, static PyObject * winreg_QueryValueEx_impl(PyObject *module, HKEY key, Py_UNICODE *name); @@ -844,7 +844,7 @@ PyDoc_STRVAR(winreg_SaveKey__doc__, "to the API."); #define WINREG_SAVEKEY_METHODDEF \ - {"SaveKey", (PyCFunction)winreg_SaveKey, METH_FASTCALL, winreg_SaveKey__doc__}, + {"SaveKey", (PyCFunction)(void(*)(void))winreg_SaveKey, METH_FASTCALL, winreg_SaveKey__doc__}, static PyObject * winreg_SaveKey_impl(PyObject *module, HKEY key, Py_UNICODE *file_name); @@ -893,7 +893,7 @@ PyDoc_STRVAR(winreg_SetValue__doc__, "KEY_SET_VALUE access."); #define WINREG_SETVALUE_METHODDEF \ - {"SetValue", (PyCFunction)winreg_SetValue, METH_FASTCALL, winreg_SetValue__doc__}, + {"SetValue", (PyCFunction)(void(*)(void))winreg_SetValue, METH_FASTCALL, winreg_SetValue__doc__}, static PyObject * winreg_SetValue_impl(PyObject *module, HKEY key, Py_UNICODE *sub_key, @@ -964,7 +964,7 @@ PyDoc_STRVAR(winreg_SetValueEx__doc__, "the configuration registry to help the registry perform efficiently."); #define WINREG_SETVALUEEX_METHODDEF \ - {"SetValueEx", (PyCFunction)winreg_SetValueEx, METH_FASTCALL, winreg_SetValueEx__doc__}, + {"SetValueEx", (PyCFunction)(void(*)(void))winreg_SetValueEx, METH_FASTCALL, winreg_SetValueEx__doc__}, static PyObject * winreg_SetValueEx_impl(PyObject *module, HKEY key, Py_UNICODE *value_name, @@ -1091,4 +1091,4 @@ winreg_QueryReflectionKey(PyObject *module, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=d1c8e2678015dd7d input=a9049054013a1b77]*/ +/*[clinic end generated code: output=45a9aec9f9258c0a input=a9049054013a1b77]*/ diff --git a/PC/clinic/winsound.c.h b/PC/clinic/winsound.c.h index 61be17dee19a..86514f5cfe96 100644 --- a/PC/clinic/winsound.c.h +++ b/PC/clinic/winsound.c.h @@ -14,7 +14,7 @@ PyDoc_STRVAR(winsound_PlaySound__doc__, " Flag values, ored together. See module documentation."); #define WINSOUND_PLAYSOUND_METHODDEF \ - {"PlaySound", (PyCFunction)winsound_PlaySound, METH_FASTCALL|METH_KEYWORDS, winsound_PlaySound__doc__}, + {"PlaySound", (PyCFunction)(void(*)(void))winsound_PlaySound, METH_FASTCALL|METH_KEYWORDS, winsound_PlaySound__doc__}, static PyObject * winsound_PlaySound_impl(PyObject *module, PyObject *sound, int flags); @@ -51,7 +51,7 @@ PyDoc_STRVAR(winsound_Beep__doc__, " How long the sound should play, in milliseconds."); #define WINSOUND_BEEP_METHODDEF \ - {"Beep", (PyCFunction)winsound_Beep, METH_FASTCALL|METH_KEYWORDS, winsound_Beep__doc__}, + {"Beep", (PyCFunction)(void(*)(void))winsound_Beep, METH_FASTCALL|METH_KEYWORDS, winsound_Beep__doc__}, static PyObject * winsound_Beep_impl(PyObject *module, int frequency, int duration); @@ -84,7 +84,7 @@ PyDoc_STRVAR(winsound_MessageBeep__doc__, "x defaults to MB_OK."); #define WINSOUND_MESSAGEBEEP_METHODDEF \ - {"MessageBeep", (PyCFunction)winsound_MessageBeep, METH_FASTCALL|METH_KEYWORDS, winsound_MessageBeep__doc__}, + {"MessageBeep", (PyCFunction)(void(*)(void))winsound_MessageBeep, METH_FASTCALL|METH_KEYWORDS, winsound_MessageBeep__doc__}, static PyObject * winsound_MessageBeep_impl(PyObject *module, int type); @@ -106,4 +106,4 @@ winsound_MessageBeep(PyObject *module, PyObject *const *args, Py_ssize_t nargs, exit: return return_value; } -/*[clinic end generated code: output=beeee8be95667b7d input=a9049054013a1b77]*/ +/*[clinic end generated code: output=19e5f0fb15bcd5bc input=a9049054013a1b77]*/ diff --git a/Python/clinic/_warnings.c.h b/Python/clinic/_warnings.c.h index 68fad2300659..d1e50de7d9da 100644 --- a/Python/clinic/_warnings.c.h +++ b/Python/clinic/_warnings.c.h @@ -9,7 +9,7 @@ PyDoc_STRVAR(warnings_warn__doc__, "Issue a warning, or maybe ignore it or raise an exception."); #define WARNINGS_WARN_METHODDEF \ - {"warn", (PyCFunction)warnings_warn, METH_FASTCALL|METH_KEYWORDS, warnings_warn__doc__}, + {"warn", (PyCFunction)(void(*)(void))warnings_warn, METH_FASTCALL|METH_KEYWORDS, warnings_warn__doc__}, static PyObject * warnings_warn_impl(PyObject *module, PyObject *message, PyObject *category, @@ -35,4 +35,4 @@ warnings_warn(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec exit: return return_value; } -/*[clinic end generated code: output=86369ece63001d78 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a4fbe6e2d1cc2091 input=a9049054013a1b77]*/ diff --git a/Python/clinic/bltinmodule.c.h b/Python/clinic/bltinmodule.c.h index 121bbd4e65c1..4a798611b7c4 100644 --- a/Python/clinic/bltinmodule.c.h +++ b/Python/clinic/bltinmodule.c.h @@ -82,7 +82,7 @@ PyDoc_STRVAR(builtin_format__doc__, "details."); #define BUILTIN_FORMAT_METHODDEF \ - {"format", (PyCFunction)builtin_format, METH_FASTCALL, builtin_format__doc__}, + {"format", (PyCFunction)(void(*)(void))builtin_format, METH_FASTCALL, builtin_format__doc__}, static PyObject * builtin_format_impl(PyObject *module, PyObject *value, PyObject *format_spec); @@ -150,7 +150,7 @@ PyDoc_STRVAR(builtin_compile__doc__, "in addition to any features explicitly specified."); #define BUILTIN_COMPILE_METHODDEF \ - {"compile", (PyCFunction)builtin_compile, METH_FASTCALL|METH_KEYWORDS, builtin_compile__doc__}, + {"compile", (PyCFunction)(void(*)(void))builtin_compile, METH_FASTCALL|METH_KEYWORDS, builtin_compile__doc__}, static PyObject * builtin_compile_impl(PyObject *module, PyObject *source, PyObject *filename, @@ -187,7 +187,7 @@ PyDoc_STRVAR(builtin_divmod__doc__, "Return the tuple (x//y, x%y). Invariant: div*y + mod == x."); #define BUILTIN_DIVMOD_METHODDEF \ - {"divmod", (PyCFunction)builtin_divmod, METH_FASTCALL, builtin_divmod__doc__}, + {"divmod", (PyCFunction)(void(*)(void))builtin_divmod, METH_FASTCALL, builtin_divmod__doc__}, static PyObject * builtin_divmod_impl(PyObject *module, PyObject *x, PyObject *y); @@ -223,7 +223,7 @@ PyDoc_STRVAR(builtin_eval__doc__, "If only globals is given, locals defaults to it."); #define BUILTIN_EVAL_METHODDEF \ - {"eval", (PyCFunction)builtin_eval, METH_FASTCALL, builtin_eval__doc__}, + {"eval", (PyCFunction)(void(*)(void))builtin_eval, METH_FASTCALL, builtin_eval__doc__}, static PyObject * builtin_eval_impl(PyObject *module, PyObject *source, PyObject *globals, @@ -261,7 +261,7 @@ PyDoc_STRVAR(builtin_exec__doc__, "If only globals is given, locals defaults to it."); #define BUILTIN_EXEC_METHODDEF \ - {"exec", (PyCFunction)builtin_exec, METH_FASTCALL, builtin_exec__doc__}, + {"exec", (PyCFunction)(void(*)(void))builtin_exec, METH_FASTCALL, builtin_exec__doc__}, static PyObject * builtin_exec_impl(PyObject *module, PyObject *source, PyObject *globals, @@ -316,7 +316,7 @@ PyDoc_STRVAR(builtin_hasattr__doc__, "This is done by calling getattr(obj, name) and catching AttributeError."); #define BUILTIN_HASATTR_METHODDEF \ - {"hasattr", (PyCFunction)builtin_hasattr, METH_FASTCALL, builtin_hasattr__doc__}, + {"hasattr", (PyCFunction)(void(*)(void))builtin_hasattr, METH_FASTCALL, builtin_hasattr__doc__}, static PyObject * builtin_hasattr_impl(PyObject *module, PyObject *obj, PyObject *name); @@ -360,7 +360,7 @@ PyDoc_STRVAR(builtin_setattr__doc__, "setattr(x, \'y\', v) is equivalent to ``x.y = v\'\'"); #define BUILTIN_SETATTR_METHODDEF \ - {"setattr", (PyCFunction)builtin_setattr, METH_FASTCALL, builtin_setattr__doc__}, + {"setattr", (PyCFunction)(void(*)(void))builtin_setattr, METH_FASTCALL, builtin_setattr__doc__}, static PyObject * builtin_setattr_impl(PyObject *module, PyObject *obj, PyObject *name, @@ -394,7 +394,7 @@ PyDoc_STRVAR(builtin_delattr__doc__, "delattr(x, \'y\') is equivalent to ``del x.y\'\'"); #define BUILTIN_DELATTR_METHODDEF \ - {"delattr", (PyCFunction)builtin_delattr, METH_FASTCALL, builtin_delattr__doc__}, + {"delattr", (PyCFunction)(void(*)(void))builtin_delattr, METH_FASTCALL, builtin_delattr__doc__}, static PyObject * builtin_delattr_impl(PyObject *module, PyObject *obj, PyObject *name); @@ -503,7 +503,7 @@ PyDoc_STRVAR(builtin_pow__doc__, "invoked using the three argument form."); #define BUILTIN_POW_METHODDEF \ - {"pow", (PyCFunction)builtin_pow, METH_FASTCALL, builtin_pow__doc__}, + {"pow", (PyCFunction)(void(*)(void))builtin_pow, METH_FASTCALL, builtin_pow__doc__}, static PyObject * builtin_pow_impl(PyObject *module, PyObject *x, PyObject *y, PyObject *z); @@ -540,7 +540,7 @@ PyDoc_STRVAR(builtin_input__doc__, "On *nix systems, readline is used if available."); #define BUILTIN_INPUT_METHODDEF \ - {"input", (PyCFunction)builtin_input, METH_FASTCALL, builtin_input__doc__}, + {"input", (PyCFunction)(void(*)(void))builtin_input, METH_FASTCALL, builtin_input__doc__}, static PyObject * builtin_input_impl(PyObject *module, PyObject *prompt); @@ -583,7 +583,7 @@ PyDoc_STRVAR(builtin_round__doc__, "the return value has the same type as the number. ndigits may be negative."); #define BUILTIN_ROUND_METHODDEF \ - {"round", (PyCFunction)builtin_round, METH_FASTCALL|METH_KEYWORDS, builtin_round__doc__}, + {"round", (PyCFunction)(void(*)(void))builtin_round, METH_FASTCALL|METH_KEYWORDS, builtin_round__doc__}, static PyObject * builtin_round_impl(PyObject *module, PyObject *number, PyObject *ndigits); @@ -618,7 +618,7 @@ PyDoc_STRVAR(builtin_sum__doc__, "reject non-numeric types."); #define BUILTIN_SUM_METHODDEF \ - {"sum", (PyCFunction)builtin_sum, METH_FASTCALL|METH_KEYWORDS, builtin_sum__doc__}, + {"sum", (PyCFunction)(void(*)(void))builtin_sum, METH_FASTCALL|METH_KEYWORDS, builtin_sum__doc__}, static PyObject * builtin_sum_impl(PyObject *module, PyObject *iterable, PyObject *start); @@ -653,7 +653,7 @@ PyDoc_STRVAR(builtin_isinstance__doc__, "or ...`` etc."); #define BUILTIN_ISINSTANCE_METHODDEF \ - {"isinstance", (PyCFunction)builtin_isinstance, METH_FASTCALL, builtin_isinstance__doc__}, + {"isinstance", (PyCFunction)(void(*)(void))builtin_isinstance, METH_FASTCALL, builtin_isinstance__doc__}, static PyObject * builtin_isinstance_impl(PyObject *module, PyObject *obj, @@ -688,7 +688,7 @@ PyDoc_STRVAR(builtin_issubclass__doc__, "or ...`` etc."); #define BUILTIN_ISSUBCLASS_METHODDEF \ - {"issubclass", (PyCFunction)builtin_issubclass, METH_FASTCALL, builtin_issubclass__doc__}, + {"issubclass", (PyCFunction)(void(*)(void))builtin_issubclass, METH_FASTCALL, builtin_issubclass__doc__}, static PyObject * builtin_issubclass_impl(PyObject *module, PyObject *cls, @@ -711,4 +711,4 @@ builtin_issubclass(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=eb6d08a32e7c83b6 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=fa8d97ac8695363b input=a9049054013a1b77]*/ diff --git a/Python/clinic/context.c.h b/Python/clinic/context.c.h index 683b9d7902f7..32b1883ebe68 100644 --- a/Python/clinic/context.c.h +++ b/Python/clinic/context.c.h @@ -12,7 +12,7 @@ PyDoc_STRVAR(_contextvars_Context_get__doc__, "return None."); #define _CONTEXTVARS_CONTEXT_GET_METHODDEF \ - {"get", (PyCFunction)_contextvars_Context_get, METH_FASTCALL, _contextvars_Context_get__doc__}, + {"get", (PyCFunction)(void(*)(void))_contextvars_Context_get, METH_FASTCALL, _contextvars_Context_get__doc__}, static PyObject * _contextvars_Context_get_impl(PyContext *self, PyObject *key, @@ -123,7 +123,7 @@ PyDoc_STRVAR(_contextvars_ContextVar_get__doc__, " * raise a LookupError."); #define _CONTEXTVARS_CONTEXTVAR_GET_METHODDEF \ - {"get", (PyCFunction)_contextvars_ContextVar_get, METH_FASTCALL, _contextvars_ContextVar_get__doc__}, + {"get", (PyCFunction)(void(*)(void))_contextvars_ContextVar_get, METH_FASTCALL, _contextvars_ContextVar_get__doc__}, static PyObject * _contextvars_ContextVar_get_impl(PyContextVar *self, PyObject *default_value); @@ -170,4 +170,4 @@ PyDoc_STRVAR(_contextvars_ContextVar_reset__doc__, #define _CONTEXTVARS_CONTEXTVAR_RESET_METHODDEF \ {"reset", (PyCFunction)_contextvars_ContextVar_reset, METH_O, _contextvars_ContextVar_reset__doc__}, -/*[clinic end generated code: output=33414d13716d0648 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=9c93e22bcadbaa2b input=a9049054013a1b77]*/ diff --git a/Python/clinic/import.c.h b/Python/clinic/import.c.h index 27b83ecc00a7..1eae8f2ee262 100644 --- a/Python/clinic/import.c.h +++ b/Python/clinic/import.c.h @@ -75,7 +75,7 @@ PyDoc_STRVAR(_imp__fix_co_filename__doc__, " File path to use."); #define _IMP__FIX_CO_FILENAME_METHODDEF \ - {"_fix_co_filename", (PyCFunction)_imp__fix_co_filename, METH_FASTCALL, _imp__fix_co_filename__doc__}, + {"_fix_co_filename", (PyCFunction)(void(*)(void))_imp__fix_co_filename, METH_FASTCALL, _imp__fix_co_filename__doc__}, static PyObject * _imp__fix_co_filename_impl(PyObject *module, PyCodeObject *code, @@ -269,7 +269,7 @@ PyDoc_STRVAR(_imp_create_dynamic__doc__, "Create an extension module."); #define _IMP_CREATE_DYNAMIC_METHODDEF \ - {"create_dynamic", (PyCFunction)_imp_create_dynamic, METH_FASTCALL, _imp_create_dynamic__doc__}, + {"create_dynamic", (PyCFunction)(void(*)(void))_imp_create_dynamic, METH_FASTCALL, _imp_create_dynamic__doc__}, static PyObject * _imp_create_dynamic_impl(PyObject *module, PyObject *spec, PyObject *file); @@ -360,7 +360,7 @@ PyDoc_STRVAR(_imp_source_hash__doc__, "\n"); #define _IMP_SOURCE_HASH_METHODDEF \ - {"source_hash", (PyCFunction)_imp_source_hash, METH_FASTCALL|METH_KEYWORDS, _imp_source_hash__doc__}, + {"source_hash", (PyCFunction)(void(*)(void))_imp_source_hash, METH_FASTCALL|METH_KEYWORDS, _imp_source_hash__doc__}, static PyObject * _imp_source_hash_impl(PyObject *module, long key, Py_buffer *source); @@ -396,4 +396,4 @@ _imp_source_hash(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb #ifndef _IMP_EXEC_DYNAMIC_METHODDEF #define _IMP_EXEC_DYNAMIC_METHODDEF #endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */ -/*[clinic end generated code: output=f0660cd1de6b3a73 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ad747b76e105fff2 input=a9049054013a1b77]*/ diff --git a/Python/clinic/marshal.c.h b/Python/clinic/marshal.c.h index 1ae9332fd3f7..0df4935893c0 100644 --- a/Python/clinic/marshal.c.h +++ b/Python/clinic/marshal.c.h @@ -20,7 +20,7 @@ PyDoc_STRVAR(marshal_dump__doc__, "to the file. The object will not be properly read back by load()."); #define MARSHAL_DUMP_METHODDEF \ - {"dump", (PyCFunction)marshal_dump, METH_FASTCALL, marshal_dump__doc__}, + {"dump", (PyCFunction)(void(*)(void))marshal_dump, METH_FASTCALL, marshal_dump__doc__}, static PyObject * marshal_dump_impl(PyObject *module, PyObject *value, PyObject *file, @@ -78,7 +78,7 @@ PyDoc_STRVAR(marshal_dumps__doc__, "unsupported type."); #define MARSHAL_DUMPS_METHODDEF \ - {"dumps", (PyCFunction)marshal_dumps, METH_FASTCALL, marshal_dumps__doc__}, + {"dumps", (PyCFunction)(void(*)(void))marshal_dumps, METH_FASTCALL, marshal_dumps__doc__}, static PyObject * marshal_dumps_impl(PyObject *module, PyObject *value, int version); @@ -134,4 +134,4 @@ marshal_loads(PyObject *module, PyObject *arg) return return_value; } -/*[clinic end generated code: output=584eb2222d86fdc3 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=cbb6128201bee7e0 input=a9049054013a1b77]*/ diff --git a/Python/clinic/sysmodule.c.h b/Python/clinic/sysmodule.c.h index 3e1480513f6c..f9415aea70fc 100644 --- a/Python/clinic/sysmodule.c.h +++ b/Python/clinic/sysmodule.c.h @@ -13,7 +13,7 @@ PyDoc_STRVAR(sys_set_coroutine_origin_tracking_depth__doc__, "to disable."); #define SYS_SET_COROUTINE_ORIGIN_TRACKING_DEPTH_METHODDEF \ - {"set_coroutine_origin_tracking_depth", (PyCFunction)sys_set_coroutine_origin_tracking_depth, METH_FASTCALL|METH_KEYWORDS, sys_set_coroutine_origin_tracking_depth__doc__}, + {"set_coroutine_origin_tracking_depth", (PyCFunction)(void(*)(void))sys_set_coroutine_origin_tracking_depth, METH_FASTCALL|METH_KEYWORDS, sys_set_coroutine_origin_tracking_depth__doc__}, static PyObject * sys_set_coroutine_origin_tracking_depth_impl(PyObject *module, int depth); @@ -63,4 +63,4 @@ sys_get_coroutine_origin_tracking_depth(PyObject *module, PyObject *Py_UNUSED(ig exit: return return_value; } -/*[clinic end generated code: output=4a3ac42b97d710ff input=a9049054013a1b77]*/ +/*[clinic end generated code: output=dfd3eb5b137a9861 input=a9049054013a1b77]*/ diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index ca8096f43a6f..2df807144073 100755 --- a/Tools/clinic/clinic.py +++ b/Tools/clinic/clinic.py @@ -680,7 +680,7 @@ def output_templates(self, f): methoddef_define = normalize_snippet(""" #define {methoddef_name} \\ - {{"{name}", (PyCFunction){c_basename}, {methoddef_flags}, {c_basename}__doc__}}, + {{"{name}", {methoddef_cast}{c_basename}, {methoddef_flags}, {c_basename}__doc__}}, """) if new_or_init and not f.docstring: docstring_prototype = docstring_definition = '' @@ -944,10 +944,16 @@ def insert_keywords(s): parser_definition = insert_keywords(parser_definition) + if flags in ('METH_NOARGS', 'METH_O', 'METH_VARARGS'): + methoddef_cast = "(PyCFunction)" + else: + methoddef_cast = "(PyCFunction)(void(*)(void))" + if f.methoddef_flags: flags += '|' + f.methoddef_flags methoddef_define = methoddef_define.replace('{methoddef_flags}', flags) + methoddef_define = methoddef_define.replace('{methoddef_cast}', methoddef_cast) methoddef_ifndef = '' conditional = self.cpp.condition() From webhook-mailer at python.org Tue Nov 27 06:05:07 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Tue, 27 Nov 2018 11:05:07 -0000 Subject: [Python-checkins] bpo-33012: Fix signatures of METH_NOARGS funstions. (GH-10736) Message-ID: https://github.com/python/cpython/commit/81524022d0c0df7a41f9b2b2df41e2ebe140e610 commit: 81524022d0c0df7a41f9b2b2df41e2ebe140e610 branch: master author: Serhiy Storchaka committer: GitHub date: 2018-11-27T13:05:02+02:00 summary: bpo-33012: Fix signatures of METH_NOARGS funstions. (GH-10736) files: M Modules/_collectionsmodule.c M Modules/_cursesmodule.c M Modules/_testcapimodule.c M Objects/dictobject.c M Objects/odictobject.c diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c index 267cf07f1f72..a495e5f718f8 100644 --- a/Modules/_collectionsmodule.c +++ b/Modules/_collectionsmodule.c @@ -1310,7 +1310,7 @@ deque_traverse(dequeobject *deque, visitproc visit, void *arg) } static PyObject * -deque_reduce(dequeobject *deque) +deque_reduce(dequeobject *deque, PyObject *Py_UNUSED(ignored)) { PyObject *dict, *it; _Py_IDENTIFIER(__dict__); diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index c8f564a31dbd..cd3241208a27 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -412,26 +412,26 @@ PyTypeObject PyCursesWindow_Type; PARSESTR - format string for argument parsing */ -#define Window_NoArgNoReturnFunction(X) \ - static PyObject *PyCursesWindow_ ## X \ - (PyCursesWindowObject *self, PyObject *args) \ +#define Window_NoArgNoReturnFunction(X) \ + static PyObject *PyCursesWindow_ ## X \ + (PyCursesWindowObject *self, PyObject *Py_UNUSED(ignored)) \ { return PyCursesCheckERR(X(self->win), # X); } #define Window_NoArgTrueFalseFunction(X) \ static PyObject * PyCursesWindow_ ## X \ - (PyCursesWindowObject *self) \ + (PyCursesWindowObject *self, PyObject *Py_UNUSED(ignored)) \ { \ return PyBool_FromLong(X(self->win)); } #define Window_NoArgNoReturnVoidFunction(X) \ static PyObject * PyCursesWindow_ ## X \ - (PyCursesWindowObject *self) \ + (PyCursesWindowObject *self, PyObject *Py_UNUSED(ignored)) \ { \ X(self->win); Py_RETURN_NONE; } #define Window_NoArg2TupleReturnFunction(X, TYPE, ERGSTR) \ static PyObject * PyCursesWindow_ ## X \ - (PyCursesWindowObject *self) \ + (PyCursesWindowObject *self, PyObject *Py_UNUSED(ignored)) \ { \ TYPE arg1, arg2; \ X(self->win,arg1,arg2); return Py_BuildValue(ERGSTR, arg1, arg2); } diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index 0dc4d7a36b76..4715f39e6db9 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -947,7 +947,7 @@ test_buildvalue_N_error(const char *fmt) } static PyObject * -test_buildvalue_N(PyObject *self, PyObject *noargs) +test_buildvalue_N(PyObject *self, PyObject *Py_UNUSED(ignored)) { PyObject *arg, *res; @@ -2457,7 +2457,7 @@ pending_threadfunc(PyObject *self, PyObject *arg) /* Some tests of PyUnicode_FromFormat(). This needs more tests. */ static PyObject * -test_string_from_format(PyObject *self, PyObject *args) +test_string_from_format(PyObject *self, PyObject *Py_UNUSED(ignored)) { PyObject *result; char *msg; @@ -2597,7 +2597,7 @@ typedef struct { } known_capsule; static PyObject * -test_capsule(PyObject *self, PyObject *args) +test_capsule(PyObject *self, PyObject *Py_UNUSED(ignored)) { PyObject *object; const char *error = NULL; @@ -2968,7 +2968,7 @@ make_memoryview_from_NULL_pointer(PyObject *self, PyObject *Py_UNUSED(ignored)) } static PyObject * -test_from_contiguous(PyObject* self, PyObject *noargs) +test_from_contiguous(PyObject* self, PyObject *Py_UNUSED(ignored)) { int data[9] = {-1,-1,-1,-1,-1,-1,-1,-1,-1}; int init[5] = {0, 1, 2, 3, 4}; @@ -3021,7 +3021,7 @@ test_from_contiguous(PyObject* self, PyObject *noargs) extern PyTypeObject _PyBytesIOBuffer_Type; static PyObject * -test_pep3118_obsolete_write_locks(PyObject* self, PyObject *noargs) +test_pep3118_obsolete_write_locks(PyObject* self, PyObject *Py_UNUSED(ignored)) { PyTypeObject *type = &_PyBytesIOBuffer_Type; PyObject *b; diff --git a/Objects/dictobject.c b/Objects/dictobject.c index 24561dd42c2e..2f108bd48d00 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -4201,7 +4201,7 @@ dictviews_isdisjoint(PyObject *self, PyObject *other) PyDoc_STRVAR(isdisjoint_doc, "Return True if the view and the given iterable have a null intersection."); -static PyObject* dictkeys_reversed(_PyDictViewObject *dv); +static PyObject* dictkeys_reversed(_PyDictViewObject *dv, PyObject *Py_UNUSED(ignored)); PyDoc_STRVAR(reversed_keys_doc, "Return a reverse iterator over the dict keys."); @@ -4254,7 +4254,7 @@ dictkeys_new(PyObject *dict, PyObject *Py_UNUSED(ignored)) } static PyObject * -dictkeys_reversed(_PyDictViewObject *dv) +dictkeys_reversed(_PyDictViewObject *dv, PyObject *Py_UNUSED(ignored)) { if (dv->dv_dict == NULL) { Py_RETURN_NONE; diff --git a/Objects/odictobject.c b/Objects/odictobject.c index bdd61080d18b..0f542006c694 100644 --- a/Objects/odictobject.c +++ b/Objects/odictobject.c @@ -1804,7 +1804,7 @@ odictiter_iternext(odictiterobject *di) PyDoc_STRVAR(reduce_doc, "Return state information for pickling"); static PyObject * -odictiter_reduce(odictiterobject *di) +odictiter_reduce(odictiterobject *di, PyObject *Py_UNUSED(ignored)) { /* copy the iterator state */ odictiterobject tmp = *di; From webhook-mailer at python.org Tue Nov 27 06:27:35 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Tue, 27 Nov 2018 11:27:35 -0000 Subject: [Python-checkins] bpo-33012: Fix invalid function cast warnings with gcc 8. (GH-6749) Message-ID: https://github.com/python/cpython/commit/62be74290aca26d16f3f55ece7ff6dad14e60e8d commit: 62be74290aca26d16f3f55ece7ff6dad14e60e8d branch: master author: Serhiy Storchaka committer: GitHub date: 2018-11-27T13:27:31+02:00 summary: bpo-33012: Fix invalid function cast warnings with gcc 8. (GH-6749) Fix invalid function cast warnings with gcc 8 for method conventions different from METH_NOARGS, METH_O and METH_VARARGS excluding Argument Clinic generated code. files: M Doc/extending/extending.rst M Modules/_bisectmodule.c M Modules/_collectionsmodule.c M Modules/_csv.c M Modules/_datetimemodule.c M Modules/_decimal/_decimal.c M Modules/_elementtree.c M Modules/_functoolsmodule.c M Modules/_hashopenssl.c M Modules/_lsprof.c M Modules/_multiprocessing/semaphore.c M Modules/_sqlite/connection.c M Modules/_sqlite/cursor.c M Modules/_sqlite/module.c M Modules/_struct.c M Modules/_testbuffer.c M Modules/_testcapimodule.c M Modules/_threadmodule.c M Modules/_xxsubinterpretersmodule.c M Modules/atexitmodule.c M Modules/faulthandler.c M Modules/nismodule.c M Modules/parsermodule.c M Modules/posixmodule.c M Modules/signalmodule.c M Modules/socketmodule.c M Modules/syslogmodule.c M Modules/xxsubtype.c M Objects/call.c M Objects/dictobject.c M Objects/memoryobject.c M Objects/odictobject.c M Objects/typeobject.c M Objects/unicodeobject.c M Python/_warnings.c M Python/bltinmodule.c M Python/context.c M Python/sysmodule.c diff --git a/Doc/extending/extending.rst b/Doc/extending/extending.rst index b788a5575b3f..9fbd91f6a034 100644 --- a/Doc/extending/extending.rst +++ b/Doc/extending/extending.rst @@ -757,7 +757,7 @@ Philbrick (philbrick at hks.com):: * only take two PyObject* parameters, and keywdarg_parrot() takes * three. */ - {"parrot", (PyCFunction)keywdarg_parrot, METH_VARARGS | METH_KEYWORDS, + {"parrot", (PyCFunction)(void(*)(void))keywdarg_parrot, METH_VARARGS | METH_KEYWORDS, "Print a lovely skit to standard output."}, {NULL, NULL, 0, NULL} /* sentinel */ }; diff --git a/Modules/_bisectmodule.c b/Modules/_bisectmodule.c index 7dd73f94750b..461a11f5099d 100644 --- a/Modules/_bisectmodule.c +++ b/Modules/_bisectmodule.c @@ -241,13 +241,13 @@ Optional args lo (default 0) and hi (default len(a)) bound the\n\ slice of a to be searched.\n"); static PyMethodDef bisect_methods[] = { - {"bisect_right", (PyCFunction)bisect_right, + {"bisect_right", (PyCFunction)(void(*)(void))bisect_right, METH_VARARGS|METH_KEYWORDS, bisect_right_doc}, - {"insort_right", (PyCFunction)insort_right, + {"insort_right", (PyCFunction)(void(*)(void))insort_right, METH_VARARGS|METH_KEYWORDS, insort_right_doc}, - {"bisect_left", (PyCFunction)bisect_left, + {"bisect_left", (PyCFunction)(void(*)(void))bisect_left, METH_VARARGS|METH_KEYWORDS, bisect_left_doc}, - {"insort_left", (PyCFunction)insort_left, + {"insort_left", (PyCFunction)(void(*)(void))insort_left, METH_VARARGS|METH_KEYWORDS, insort_left_doc}, {NULL, NULL} /* sentinel */ }; diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c index a495e5f718f8..1ad4a03467c2 100644 --- a/Modules/_collectionsmodule.c +++ b/Modules/_collectionsmodule.c @@ -1573,9 +1573,9 @@ static PyMethodDef deque_methods[] = { METH_O, extend_doc}, {"extendleft", (PyCFunction)deque_extendleft, METH_O, extendleft_doc}, - {"index", (PyCFunction)deque_index, + {"index", (PyCFunction)(void(*)(void))deque_index, METH_FASTCALL, index_doc}, - {"insert", (PyCFunction)deque_insert, + {"insert", (PyCFunction)(void(*)(void))deque_insert, METH_FASTCALL, insert_doc}, {"pop", (PyCFunction)deque_pop, METH_NOARGS, pop_doc}, @@ -1589,7 +1589,7 @@ static PyMethodDef deque_methods[] = { METH_NOARGS, reversed_doc}, {"reverse", (PyCFunction)deque_reverse, METH_NOARGS, reverse_doc}, - {"rotate", (PyCFunction)deque_rotate, + {"rotate", (PyCFunction)(void(*)(void))deque_rotate, METH_FASTCALL, rotate_doc}, {"__sizeof__", (PyCFunction)deque_sizeof, METH_NOARGS, sizeof_doc}, diff --git a/Modules/_csv.c b/Modules/_csv.c index 4cc1f7c88d87..b4e92de27a97 100644 --- a/Modules/_csv.c +++ b/Modules/_csv.c @@ -1583,13 +1583,13 @@ PyDoc_STRVAR(csv_field_size_limit_doc, "the old limit is returned"); static struct PyMethodDef csv_methods[] = { - { "reader", (PyCFunction)csv_reader, + { "reader", (PyCFunction)(void(*)(void))csv_reader, METH_VARARGS | METH_KEYWORDS, csv_reader_doc}, - { "writer", (PyCFunction)csv_writer, + { "writer", (PyCFunction)(void(*)(void))csv_writer, METH_VARARGS | METH_KEYWORDS, csv_writer_doc}, { "list_dialects", (PyCFunction)csv_list_dialects, METH_NOARGS, csv_list_dialects_doc}, - { "register_dialect", (PyCFunction)csv_register_dialect, + { "register_dialect", (PyCFunction)(void(*)(void))csv_register_dialect, METH_VARARGS | METH_KEYWORDS, csv_register_dialect_doc}, { "unregister_dialect", (PyCFunction)csv_unregister_dialect, METH_O, csv_unregister_dialect_doc}, diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c index 0054ea83c462..eb9c35d02d4e 100644 --- a/Modules/_datetimemodule.c +++ b/Modules/_datetimemodule.c @@ -3255,7 +3255,7 @@ static PyMethodDef date_methods[] = { {"ctime", (PyCFunction)date_ctime, METH_NOARGS, PyDoc_STR("Return ctime() style string.")}, - {"strftime", (PyCFunction)date_strftime, METH_VARARGS | METH_KEYWORDS, + {"strftime", (PyCFunction)(void(*)(void))date_strftime, METH_VARARGS | METH_KEYWORDS, PyDoc_STR("format -> strftime() style string.")}, {"__format__", (PyCFunction)date_format, METH_VARARGS, @@ -3283,7 +3283,7 @@ static PyMethodDef date_methods[] = { PyDoc_STR("Return the day of the week represented by the date.\n" "Monday == 0 ... Sunday == 6")}, - {"replace", (PyCFunction)date_replace, METH_VARARGS | METH_KEYWORDS, + {"replace", (PyCFunction)(void(*)(void))date_replace, METH_VARARGS | METH_KEYWORDS, PyDoc_STR("Return date with new specified fields.")}, {"__reduce__", (PyCFunction)date_reduce, METH_NOARGS, @@ -4392,12 +4392,12 @@ time_reduce(PyDateTime_Time *self, PyObject *arg) static PyMethodDef time_methods[] = { - {"isoformat", (PyCFunction)time_isoformat, METH_VARARGS | METH_KEYWORDS, + {"isoformat", (PyCFunction)(void(*)(void))time_isoformat, METH_VARARGS | METH_KEYWORDS, PyDoc_STR("Return string in ISO 8601 format, [HH[:MM[:SS[.mmm[uuu]]]]]" "[+HH:MM].\n\n" "timespec specifies what components of the time to include.\n")}, - {"strftime", (PyCFunction)time_strftime, METH_VARARGS | METH_KEYWORDS, + {"strftime", (PyCFunction)(void(*)(void))time_strftime, METH_VARARGS | METH_KEYWORDS, PyDoc_STR("format -> strftime() style string.")}, {"__format__", (PyCFunction)date_format, METH_VARARGS, @@ -4412,7 +4412,7 @@ static PyMethodDef time_methods[] = { {"dst", (PyCFunction)time_dst, METH_NOARGS, PyDoc_STR("Return self.tzinfo.dst(self).")}, - {"replace", (PyCFunction)time_replace, METH_VARARGS | METH_KEYWORDS, + {"replace", (PyCFunction)(void(*)(void))time_replace, METH_VARARGS | METH_KEYWORDS, PyDoc_STR("Return time with new specified fields.")}, {"fromisoformat", (PyCFunction)time_fromisoformat, METH_O | METH_CLASS, @@ -6025,7 +6025,7 @@ static PyMethodDef datetime_methods[] = { METH_NOARGS | METH_CLASS, PyDoc_STR("Return a new datetime representing UTC day and time.")}, - {"fromtimestamp", (PyCFunction)datetime_fromtimestamp, + {"fromtimestamp", (PyCFunction)(void(*)(void))datetime_fromtimestamp, METH_VARARGS | METH_KEYWORDS | METH_CLASS, PyDoc_STR("timestamp[, tz] -> tz's local time from POSIX timestamp.")}, @@ -6038,7 +6038,7 @@ static PyMethodDef datetime_methods[] = { PyDoc_STR("string, format -> new datetime parsed from a string " "(like time.strptime()).")}, - {"combine", (PyCFunction)datetime_combine, + {"combine", (PyCFunction)(void(*)(void))datetime_combine, METH_VARARGS | METH_KEYWORDS | METH_CLASS, PyDoc_STR("date, time -> datetime with same date and time fields")}, @@ -6069,7 +6069,7 @@ static PyMethodDef datetime_methods[] = { {"utctimetuple", (PyCFunction)datetime_utctimetuple, METH_NOARGS, PyDoc_STR("Return UTC time tuple, compatible with time.localtime().")}, - {"isoformat", (PyCFunction)datetime_isoformat, METH_VARARGS | METH_KEYWORDS, + {"isoformat", (PyCFunction)(void(*)(void))datetime_isoformat, METH_VARARGS | METH_KEYWORDS, PyDoc_STR("[sep] -> string in ISO 8601 format, " "YYYY-MM-DDT[HH[:MM[:SS[.mmm[uuu]]]]][+HH:MM].\n" "sep is used to separate the year from the time, and " @@ -6087,10 +6087,10 @@ static PyMethodDef datetime_methods[] = { {"dst", (PyCFunction)datetime_dst, METH_NOARGS, PyDoc_STR("Return self.tzinfo.dst(self).")}, - {"replace", (PyCFunction)datetime_replace, METH_VARARGS | METH_KEYWORDS, + {"replace", (PyCFunction)(void(*)(void))datetime_replace, METH_VARARGS | METH_KEYWORDS, PyDoc_STR("Return datetime with new specified fields.")}, - {"astimezone", (PyCFunction)datetime_astimezone, METH_VARARGS | METH_KEYWORDS, + {"astimezone", (PyCFunction)(void(*)(void))datetime_astimezone, METH_VARARGS | METH_KEYWORDS, PyDoc_STR("tz -> convert to local time in new timezone tz\n")}, {"__reduce_ex__", (PyCFunction)datetime_reduce_ex, METH_VARARGS, diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c index 1e58d3d5b779..51aed2c67dc6 100644 --- a/Modules/_decimal/_decimal.c +++ b/Modules/_decimal/_decimal.c @@ -4598,30 +4598,30 @@ static PyNumberMethods dec_number_methods = static PyMethodDef dec_methods [] = { /* Unary arithmetic functions, optional context arg */ - { "exp", (PyCFunction)dec_mpd_qexp, METH_VARARGS|METH_KEYWORDS, doc_exp }, - { "ln", (PyCFunction)dec_mpd_qln, METH_VARARGS|METH_KEYWORDS, doc_ln }, - { "log10", (PyCFunction)dec_mpd_qlog10, METH_VARARGS|METH_KEYWORDS, doc_log10 }, - { "next_minus", (PyCFunction)dec_mpd_qnext_minus, METH_VARARGS|METH_KEYWORDS, doc_next_minus }, - { "next_plus", (PyCFunction)dec_mpd_qnext_plus, METH_VARARGS|METH_KEYWORDS, doc_next_plus }, - { "normalize", (PyCFunction)dec_mpd_qreduce, METH_VARARGS|METH_KEYWORDS, doc_normalize }, - { "to_integral", (PyCFunction)PyDec_ToIntegralValue, METH_VARARGS|METH_KEYWORDS, doc_to_integral }, - { "to_integral_exact", (PyCFunction)PyDec_ToIntegralExact, METH_VARARGS|METH_KEYWORDS, doc_to_integral_exact }, - { "to_integral_value", (PyCFunction)PyDec_ToIntegralValue, METH_VARARGS|METH_KEYWORDS, doc_to_integral_value }, - { "sqrt", (PyCFunction)dec_mpd_qsqrt, METH_VARARGS|METH_KEYWORDS, doc_sqrt }, + { "exp", (PyCFunction)(void(*)(void))dec_mpd_qexp, METH_VARARGS|METH_KEYWORDS, doc_exp }, + { "ln", (PyCFunction)(void(*)(void))dec_mpd_qln, METH_VARARGS|METH_KEYWORDS, doc_ln }, + { "log10", (PyCFunction)(void(*)(void))dec_mpd_qlog10, METH_VARARGS|METH_KEYWORDS, doc_log10 }, + { "next_minus", (PyCFunction)(void(*)(void))dec_mpd_qnext_minus, METH_VARARGS|METH_KEYWORDS, doc_next_minus }, + { "next_plus", (PyCFunction)(void(*)(void))dec_mpd_qnext_plus, METH_VARARGS|METH_KEYWORDS, doc_next_plus }, + { "normalize", (PyCFunction)(void(*)(void))dec_mpd_qreduce, METH_VARARGS|METH_KEYWORDS, doc_normalize }, + { "to_integral", (PyCFunction)(void(*)(void))PyDec_ToIntegralValue, METH_VARARGS|METH_KEYWORDS, doc_to_integral }, + { "to_integral_exact", (PyCFunction)(void(*)(void))PyDec_ToIntegralExact, METH_VARARGS|METH_KEYWORDS, doc_to_integral_exact }, + { "to_integral_value", (PyCFunction)(void(*)(void))PyDec_ToIntegralValue, METH_VARARGS|METH_KEYWORDS, doc_to_integral_value }, + { "sqrt", (PyCFunction)(void(*)(void))dec_mpd_qsqrt, METH_VARARGS|METH_KEYWORDS, doc_sqrt }, /* Binary arithmetic functions, optional context arg */ - { "compare", (PyCFunction)dec_mpd_qcompare, METH_VARARGS|METH_KEYWORDS, doc_compare }, - { "compare_signal", (PyCFunction)dec_mpd_qcompare_signal, METH_VARARGS|METH_KEYWORDS, doc_compare_signal }, - { "max", (PyCFunction)dec_mpd_qmax, METH_VARARGS|METH_KEYWORDS, doc_max }, - { "max_mag", (PyCFunction)dec_mpd_qmax_mag, METH_VARARGS|METH_KEYWORDS, doc_max_mag }, - { "min", (PyCFunction)dec_mpd_qmin, METH_VARARGS|METH_KEYWORDS, doc_min }, - { "min_mag", (PyCFunction)dec_mpd_qmin_mag, METH_VARARGS|METH_KEYWORDS, doc_min_mag }, - { "next_toward", (PyCFunction)dec_mpd_qnext_toward, METH_VARARGS|METH_KEYWORDS, doc_next_toward }, - { "quantize", (PyCFunction)dec_mpd_qquantize, METH_VARARGS|METH_KEYWORDS, doc_quantize }, - { "remainder_near", (PyCFunction)dec_mpd_qrem_near, METH_VARARGS|METH_KEYWORDS, doc_remainder_near }, + { "compare", (PyCFunction)(void(*)(void))dec_mpd_qcompare, METH_VARARGS|METH_KEYWORDS, doc_compare }, + { "compare_signal", (PyCFunction)(void(*)(void))dec_mpd_qcompare_signal, METH_VARARGS|METH_KEYWORDS, doc_compare_signal }, + { "max", (PyCFunction)(void(*)(void))dec_mpd_qmax, METH_VARARGS|METH_KEYWORDS, doc_max }, + { "max_mag", (PyCFunction)(void(*)(void))dec_mpd_qmax_mag, METH_VARARGS|METH_KEYWORDS, doc_max_mag }, + { "min", (PyCFunction)(void(*)(void))dec_mpd_qmin, METH_VARARGS|METH_KEYWORDS, doc_min }, + { "min_mag", (PyCFunction)(void(*)(void))dec_mpd_qmin_mag, METH_VARARGS|METH_KEYWORDS, doc_min_mag }, + { "next_toward", (PyCFunction)(void(*)(void))dec_mpd_qnext_toward, METH_VARARGS|METH_KEYWORDS, doc_next_toward }, + { "quantize", (PyCFunction)(void(*)(void))dec_mpd_qquantize, METH_VARARGS|METH_KEYWORDS, doc_quantize }, + { "remainder_near", (PyCFunction)(void(*)(void))dec_mpd_qrem_near, METH_VARARGS|METH_KEYWORDS, doc_remainder_near }, /* Ternary arithmetic functions, optional context arg */ - { "fma", (PyCFunction)dec_mpd_qfma, METH_VARARGS|METH_KEYWORDS, doc_fma }, + { "fma", (PyCFunction)(void(*)(void))dec_mpd_qfma, METH_VARARGS|METH_KEYWORDS, doc_fma }, /* Boolean functions, no context arg */ { "is_canonical", dec_mpd_iscanonical, METH_NOARGS, doc_is_canonical }, @@ -4634,8 +4634,8 @@ static PyMethodDef dec_methods [] = { "is_zero", dec_mpd_iszero, METH_NOARGS, doc_is_zero }, /* Boolean functions, optional context arg */ - { "is_normal", (PyCFunction)dec_mpd_isnormal, METH_VARARGS|METH_KEYWORDS, doc_is_normal }, - { "is_subnormal", (PyCFunction)dec_mpd_issubnormal, METH_VARARGS|METH_KEYWORDS, doc_is_subnormal }, + { "is_normal", (PyCFunction)(void(*)(void))dec_mpd_isnormal, METH_VARARGS|METH_KEYWORDS, doc_is_normal }, + { "is_subnormal", (PyCFunction)(void(*)(void))dec_mpd_issubnormal, METH_VARARGS|METH_KEYWORDS, doc_is_subnormal }, /* Unary functions, no context arg */ { "adjusted", dec_mpd_adjexp, METH_NOARGS, doc_adjusted }, @@ -4648,24 +4648,24 @@ static PyMethodDef dec_methods [] = { "copy_negate", dec_mpd_qcopy_negate, METH_NOARGS, doc_copy_negate }, /* Unary functions, optional context arg */ - { "logb", (PyCFunction)dec_mpd_qlogb, METH_VARARGS|METH_KEYWORDS, doc_logb }, - { "logical_invert", (PyCFunction)dec_mpd_qinvert, METH_VARARGS|METH_KEYWORDS, doc_logical_invert }, - { "number_class", (PyCFunction)dec_mpd_class, METH_VARARGS|METH_KEYWORDS, doc_number_class }, - { "to_eng_string", (PyCFunction)dec_mpd_to_eng, METH_VARARGS|METH_KEYWORDS, doc_to_eng_string }, + { "logb", (PyCFunction)(void(*)(void))dec_mpd_qlogb, METH_VARARGS|METH_KEYWORDS, doc_logb }, + { "logical_invert", (PyCFunction)(void(*)(void))dec_mpd_qinvert, METH_VARARGS|METH_KEYWORDS, doc_logical_invert }, + { "number_class", (PyCFunction)(void(*)(void))dec_mpd_class, METH_VARARGS|METH_KEYWORDS, doc_number_class }, + { "to_eng_string", (PyCFunction)(void(*)(void))dec_mpd_to_eng, METH_VARARGS|METH_KEYWORDS, doc_to_eng_string }, /* Binary functions, optional context arg for conversion errors */ - { "compare_total", (PyCFunction)dec_mpd_compare_total, METH_VARARGS|METH_KEYWORDS, doc_compare_total }, - { "compare_total_mag", (PyCFunction)dec_mpd_compare_total_mag, METH_VARARGS|METH_KEYWORDS, doc_compare_total_mag }, - { "copy_sign", (PyCFunction)dec_mpd_qcopy_sign, METH_VARARGS|METH_KEYWORDS, doc_copy_sign }, - { "same_quantum", (PyCFunction)dec_mpd_same_quantum, METH_VARARGS|METH_KEYWORDS, doc_same_quantum }, + { "compare_total", (PyCFunction)(void(*)(void))dec_mpd_compare_total, METH_VARARGS|METH_KEYWORDS, doc_compare_total }, + { "compare_total_mag", (PyCFunction)(void(*)(void))dec_mpd_compare_total_mag, METH_VARARGS|METH_KEYWORDS, doc_compare_total_mag }, + { "copy_sign", (PyCFunction)(void(*)(void))dec_mpd_qcopy_sign, METH_VARARGS|METH_KEYWORDS, doc_copy_sign }, + { "same_quantum", (PyCFunction)(void(*)(void))dec_mpd_same_quantum, METH_VARARGS|METH_KEYWORDS, doc_same_quantum }, /* Binary functions, optional context arg */ - { "logical_and", (PyCFunction)dec_mpd_qand, METH_VARARGS|METH_KEYWORDS, doc_logical_and }, - { "logical_or", (PyCFunction)dec_mpd_qor, METH_VARARGS|METH_KEYWORDS, doc_logical_or }, - { "logical_xor", (PyCFunction)dec_mpd_qxor, METH_VARARGS|METH_KEYWORDS, doc_logical_xor }, - { "rotate", (PyCFunction)dec_mpd_qrotate, METH_VARARGS|METH_KEYWORDS, doc_rotate }, - { "scaleb", (PyCFunction)dec_mpd_qscaleb, METH_VARARGS|METH_KEYWORDS, doc_scaleb }, - { "shift", (PyCFunction)dec_mpd_qshift, METH_VARARGS|METH_KEYWORDS, doc_shift }, + { "logical_and", (PyCFunction)(void(*)(void))dec_mpd_qand, METH_VARARGS|METH_KEYWORDS, doc_logical_and }, + { "logical_or", (PyCFunction)(void(*)(void))dec_mpd_qor, METH_VARARGS|METH_KEYWORDS, doc_logical_or }, + { "logical_xor", (PyCFunction)(void(*)(void))dec_mpd_qxor, METH_VARARGS|METH_KEYWORDS, doc_logical_xor }, + { "rotate", (PyCFunction)(void(*)(void))dec_mpd_qrotate, METH_VARARGS|METH_KEYWORDS, doc_rotate }, + { "scaleb", (PyCFunction)(void(*)(void))dec_mpd_qscaleb, METH_VARARGS|METH_KEYWORDS, doc_scaleb }, + { "shift", (PyCFunction)(void(*)(void))dec_mpd_qshift, METH_VARARGS|METH_KEYWORDS, doc_shift }, /* Miscellaneous */ { "from_float", dec_from_float, METH_O|METH_CLASS, doc_from_float }, @@ -5303,7 +5303,7 @@ static PyMethodDef context_methods [] = { "subtract", ctx_mpd_qsub, METH_VARARGS, doc_ctx_subtract }, /* Binary or ternary arithmetic functions */ - { "power", (PyCFunction)ctx_mpd_qpow, METH_VARARGS|METH_KEYWORDS, doc_ctx_power }, + { "power", (PyCFunction)(void(*)(void))ctx_mpd_qpow, METH_VARARGS|METH_KEYWORDS, doc_ctx_power }, /* Ternary arithmetic functions */ { "fma", ctx_mpd_qfma, METH_VARARGS, doc_ctx_fma }, @@ -5421,7 +5421,7 @@ static PyMethodDef _decimal_methods [] = { { "getcontext", (PyCFunction)PyDec_GetCurrentContext, METH_NOARGS, doc_getcontext}, { "setcontext", (PyCFunction)PyDec_SetCurrentContext, METH_O, doc_setcontext}, - { "localcontext", (PyCFunction)ctxmanager_new, METH_VARARGS|METH_KEYWORDS, doc_localcontext}, + { "localcontext", (PyCFunction)(void(*)(void))ctxmanager_new, METH_VARARGS|METH_KEYWORDS, doc_localcontext}, #ifdef EXTRA_FUNCTIONALITY { "IEEEContext", (PyCFunction)ieee_context, METH_O, doc_ieee_context}, #endif diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index 2f1c4c02e82a..62374d887c76 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -3968,7 +3968,7 @@ static PyTypeObject XMLParser_Type = { /* python module interface */ static PyMethodDef _functions[] = { - {"SubElement", (PyCFunction) subelement, METH_VARARGS | METH_KEYWORDS}, + {"SubElement", (PyCFunction)(void(*)(void)) subelement, METH_VARARGS | METH_KEYWORDS}, {NULL, NULL} }; diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c index 8701f6c89d71..0fb4847af9c3 100644 --- a/Modules/_functoolsmodule.c +++ b/Modules/_functoolsmodule.c @@ -1236,7 +1236,7 @@ PyDoc_STRVAR(module_doc, static PyMethodDef module_methods[] = { {"reduce", functools_reduce, METH_VARARGS, functools_reduce_doc}, - {"cmp_to_key", (PyCFunction)functools_cmp_to_key, + {"cmp_to_key", (PyCFunction)(void(*)(void))functools_cmp_to_key, METH_VARARGS | METH_KEYWORDS, functools_cmp_to_key_doc}, {NULL, NULL} /* sentinel */ }; diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c index 42ea9974b952..d7e613c886c3 100644 --- a/Modules/_hashopenssl.c +++ b/Modules/_hashopenssl.c @@ -1011,7 +1011,7 @@ generate_hash_name_list(void) /* a PyMethodDef structure for the constructor */ #define CONSTRUCTOR_METH_DEF(NAME) \ - {"openssl_" #NAME, (PyCFunction)EVP_new_ ## NAME, METH_FASTCALL, \ + {"openssl_" #NAME, (PyCFunction)(void(*)(void))EVP_new_ ## NAME, METH_FASTCALL, \ PyDoc_STR("Returns a " #NAME \ " hash object; optionally initialized with a string") \ } @@ -1034,9 +1034,9 @@ GEN_CONSTRUCTOR(sha512) /* List of functions exported by this module */ static struct PyMethodDef EVP_functions[] = { - {"new", (PyCFunction)EVP_new, METH_VARARGS|METH_KEYWORDS, EVP_new__doc__}, + {"new", (PyCFunction)(void(*)(void))EVP_new, METH_VARARGS|METH_KEYWORDS, EVP_new__doc__}, #ifdef PY_PBKDF2_HMAC - {"pbkdf2_hmac", (PyCFunction)pbkdf2_hmac, METH_VARARGS|METH_KEYWORDS, + {"pbkdf2_hmac", (PyCFunction)(void(*)(void))pbkdf2_hmac, METH_VARARGS|METH_KEYWORDS, pbkdf2_hmac__doc__}, #endif _HASHLIB_SCRYPT_METHODDEF diff --git a/Modules/_lsprof.c b/Modules/_lsprof.c index 233f62fe2f14..4508f5e65695 100644 --- a/Modules/_lsprof.c +++ b/Modules/_lsprof.c @@ -778,7 +778,7 @@ profiler_init(ProfilerObject *pObj, PyObject *args, PyObject *kw) static PyMethodDef profiler_methods[] = { {"getstats", (PyCFunction)profiler_getstats, METH_NOARGS, getstats_doc}, - {"enable", (PyCFunction)profiler_enable, + {"enable", (PyCFunction)(void(*)(void))profiler_enable, METH_VARARGS | METH_KEYWORDS, enable_doc}, {"disable", (PyCFunction)profiler_disable, METH_NOARGS, disable_doc}, diff --git a/Modules/_multiprocessing/semaphore.c b/Modules/_multiprocessing/semaphore.c index b1d3a216cbe8..e15adfbd6b19 100644 --- a/Modules/_multiprocessing/semaphore.c +++ b/Modules/_multiprocessing/semaphore.c @@ -581,11 +581,11 @@ semlock_afterfork(SemLockObject *self, PyObject *Py_UNUSED(ignored)) */ static PyMethodDef semlock_methods[] = { - {"acquire", (PyCFunction)semlock_acquire, METH_VARARGS | METH_KEYWORDS, + {"acquire", (PyCFunction)(void(*)(void))semlock_acquire, METH_VARARGS | METH_KEYWORDS, "acquire the semaphore/lock"}, {"release", (PyCFunction)semlock_release, METH_NOARGS, "release the semaphore/lock"}, - {"__enter__", (PyCFunction)semlock_acquire, METH_VARARGS | METH_KEYWORDS, + {"__enter__", (PyCFunction)(void(*)(void))semlock_acquire, METH_VARARGS | METH_KEYWORDS, "enter the semaphore/lock"}, {"__exit__", (PyCFunction)semlock_release, METH_VARARGS, "exit the semaphore/lock"}, diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c index 89a875189780..65e8df4f7c61 100644 --- a/Modules/_sqlite/connection.c +++ b/Modules/_sqlite/connection.c @@ -1764,7 +1764,7 @@ static PyGetSetDef connection_getset[] = { }; static PyMethodDef connection_methods[] = { - {"cursor", (PyCFunction)pysqlite_connection_cursor, METH_VARARGS|METH_KEYWORDS, + {"cursor", (PyCFunction)(void(*)(void))pysqlite_connection_cursor, METH_VARARGS|METH_KEYWORDS, PyDoc_STR("Return a cursor for the connection.")}, {"close", (PyCFunction)pysqlite_connection_close, METH_NOARGS, PyDoc_STR("Closes the connection.")}, @@ -1772,11 +1772,11 @@ static PyMethodDef connection_methods[] = { PyDoc_STR("Commit the current transaction.")}, {"rollback", (PyCFunction)pysqlite_connection_rollback, METH_NOARGS, PyDoc_STR("Roll back the current transaction.")}, - {"create_function", (PyCFunction)pysqlite_connection_create_function, METH_VARARGS|METH_KEYWORDS, + {"create_function", (PyCFunction)(void(*)(void))pysqlite_connection_create_function, METH_VARARGS|METH_KEYWORDS, PyDoc_STR("Creates a new function. Non-standard.")}, - {"create_aggregate", (PyCFunction)pysqlite_connection_create_aggregate, METH_VARARGS|METH_KEYWORDS, + {"create_aggregate", (PyCFunction)(void(*)(void))pysqlite_connection_create_aggregate, METH_VARARGS|METH_KEYWORDS, PyDoc_STR("Creates a new aggregate. Non-standard.")}, - {"set_authorizer", (PyCFunction)pysqlite_connection_set_authorizer, METH_VARARGS|METH_KEYWORDS, + {"set_authorizer", (PyCFunction)(void(*)(void))pysqlite_connection_set_authorizer, METH_VARARGS|METH_KEYWORDS, PyDoc_STR("Sets authorizer callback. Non-standard.")}, #ifdef HAVE_LOAD_EXTENSION {"enable_load_extension", (PyCFunction)pysqlite_enable_load_extension, METH_VARARGS, @@ -1784,9 +1784,9 @@ static PyMethodDef connection_methods[] = { {"load_extension", (PyCFunction)pysqlite_load_extension, METH_VARARGS, PyDoc_STR("Load SQLite extension module. Non-standard.")}, #endif - {"set_progress_handler", (PyCFunction)pysqlite_connection_set_progress_handler, METH_VARARGS|METH_KEYWORDS, + {"set_progress_handler", (PyCFunction)(void(*)(void))pysqlite_connection_set_progress_handler, METH_VARARGS|METH_KEYWORDS, PyDoc_STR("Sets progress handler callback. Non-standard.")}, - {"set_trace_callback", (PyCFunction)pysqlite_connection_set_trace_callback, METH_VARARGS|METH_KEYWORDS, + {"set_trace_callback", (PyCFunction)(void(*)(void))pysqlite_connection_set_trace_callback, METH_VARARGS|METH_KEYWORDS, PyDoc_STR("Sets a trace callback called for each SQL statement (passed as unicode). Non-standard.")}, {"execute", (PyCFunction)pysqlite_connection_execute, METH_VARARGS, PyDoc_STR("Executes a SQL statement. Non-standard.")}, @@ -1801,7 +1801,7 @@ static PyMethodDef connection_methods[] = { {"iterdump", (PyCFunction)pysqlite_connection_iterdump, METH_NOARGS, PyDoc_STR("Returns iterator to the dump of the database in an SQL text format. Non-standard.")}, #ifdef HAVE_BACKUP_API - {"backup", (PyCFunction)pysqlite_connection_backup, METH_VARARGS | METH_KEYWORDS, + {"backup", (PyCFunction)(void(*)(void))pysqlite_connection_backup, METH_VARARGS | METH_KEYWORDS, PyDoc_STR("Makes a backup of the database. Non-standard.")}, #endif {"__enter__", (PyCFunction)pysqlite_connection_enter, METH_NOARGS, diff --git a/Modules/_sqlite/cursor.c b/Modules/_sqlite/cursor.c index c62ad5d64eec..8a46e5cf2eb0 100644 --- a/Modules/_sqlite/cursor.c +++ b/Modules/_sqlite/cursor.c @@ -908,7 +908,7 @@ static PyMethodDef cursor_methods[] = { PyDoc_STR("Executes a multiple SQL statements at once. Non-standard.")}, {"fetchone", (PyCFunction)pysqlite_cursor_fetchone, METH_NOARGS, PyDoc_STR("Fetches one row from the resultset.")}, - {"fetchmany", (PyCFunction)pysqlite_cursor_fetchmany, METH_VARARGS|METH_KEYWORDS, + {"fetchmany", (PyCFunction)(void(*)(void))pysqlite_cursor_fetchmany, METH_VARARGS|METH_KEYWORDS, PyDoc_STR("Fetches several rows from the resultset.")}, {"fetchall", (PyCFunction)pysqlite_cursor_fetchall, METH_NOARGS, PyDoc_STR("Fetches all rows from the resultset.")}, diff --git a/Modules/_sqlite/module.c b/Modules/_sqlite/module.c index db2b4958b146..274ee13c375e 100644 --- a/Modules/_sqlite/module.c +++ b/Modules/_sqlite/module.c @@ -245,12 +245,12 @@ static void converters_init(PyObject* dict) } static PyMethodDef module_methods[] = { - {"connect", (PyCFunction)module_connect, + {"connect", (PyCFunction)(void(*)(void))module_connect, METH_VARARGS | METH_KEYWORDS, module_connect_doc}, - {"complete_statement", (PyCFunction)module_complete, + {"complete_statement", (PyCFunction)(void(*)(void))module_complete, METH_VARARGS | METH_KEYWORDS, module_complete_doc}, #ifdef HAVE_SHARED_CACHE - {"enable_shared_cache", (PyCFunction)module_enable_shared_cache, + {"enable_shared_cache", (PyCFunction)(void(*)(void))module_enable_shared_cache, METH_VARARGS | METH_KEYWORDS, module_enable_shared_cache_doc}, #endif {"register_adapter", (PyCFunction)module_register_adapter, diff --git a/Modules/_struct.c b/Modules/_struct.c index 0be52d9ab94b..67673300e0e3 100644 --- a/Modules/_struct.c +++ b/Modules/_struct.c @@ -2006,8 +2006,8 @@ s_sizeof(PyStructObject *self, void *unused) static struct PyMethodDef s_methods[] = { STRUCT_ITER_UNPACK_METHODDEF - {"pack", (PyCFunction)s_pack, METH_FASTCALL, s_pack__doc__}, - {"pack_into", (PyCFunction)s_pack_into, METH_FASTCALL, s_pack_into__doc__}, + {"pack", (PyCFunction)(void(*)(void))s_pack, METH_FASTCALL, s_pack__doc__}, + {"pack_into", (PyCFunction)(void(*)(void))s_pack_into, METH_FASTCALL, s_pack_into__doc__}, STRUCT_UNPACK_METHODDEF STRUCT_UNPACK_FROM_METHODDEF {"__sizeof__", (PyCFunction)s_sizeof, METH_NOARGS, s_sizeof__doc__}, @@ -2264,8 +2264,8 @@ static struct PyMethodDef module_functions[] = { _CLEARCACHE_METHODDEF CALCSIZE_METHODDEF ITER_UNPACK_METHODDEF - {"pack", (PyCFunction)pack, METH_FASTCALL, pack_doc}, - {"pack_into", (PyCFunction)pack_into, METH_FASTCALL, pack_into_doc}, + {"pack", (PyCFunction)(void(*)(void))pack, METH_FASTCALL, pack_doc}, + {"pack_into", (PyCFunction)(void(*)(void))pack_into, METH_FASTCALL, pack_into_doc}, UNPACK_METHODDEF UNPACK_FROM_METHODDEF {NULL, NULL} /* sentinel */ diff --git a/Modules/_testbuffer.c b/Modules/_testbuffer.c index b1b8ff370151..4ff44f91a6ab 100644 --- a/Modules/_testbuffer.c +++ b/Modules/_testbuffer.c @@ -2635,7 +2635,7 @@ static PyMethodDef ndarray_methods [] = { { "tolist", ndarray_tolist, METH_NOARGS, NULL }, { "tobytes", ndarray_tobytes, METH_NOARGS, NULL }, - { "push", (PyCFunction)ndarray_push, METH_VARARGS|METH_KEYWORDS, NULL }, + { "push", (PyCFunction)(void(*)(void))ndarray_push, METH_VARARGS|METH_KEYWORDS, NULL }, { "pop", ndarray_pop, METH_NOARGS, NULL }, { "add_suboffsets", ndarray_add_suboffsets, METH_NOARGS, NULL }, { "memoryview_from_buffer", ndarray_memoryview_from_buffer, METH_NOARGS, NULL }, diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index 4715f39e6db9..4933ef3b61c4 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -4787,14 +4787,14 @@ static PyMethodDef TestMethods[] = { {"getbuffer_with_null_view", getbuffer_with_null_view, METH_O}, {"test_buildvalue_N", test_buildvalue_N, METH_NOARGS}, {"get_args", get_args, METH_VARARGS}, - {"get_kwargs", (PyCFunction)get_kwargs, METH_VARARGS|METH_KEYWORDS}, + {"get_kwargs", (PyCFunction)(void(*)(void))get_kwargs, METH_VARARGS|METH_KEYWORDS}, {"getargs_tuple", getargs_tuple, METH_VARARGS}, - {"getargs_keywords", (PyCFunction)getargs_keywords, + {"getargs_keywords", (PyCFunction)(void(*)(void))getargs_keywords, METH_VARARGS|METH_KEYWORDS}, - {"getargs_keyword_only", (PyCFunction)getargs_keyword_only, + {"getargs_keyword_only", (PyCFunction)(void(*)(void))getargs_keyword_only, METH_VARARGS|METH_KEYWORDS}, {"getargs_positional_only_and_keywords", - (PyCFunction)getargs_positional_only_and_keywords, + (PyCFunction)(void(*)(void))getargs_positional_only_and_keywords, METH_VARARGS|METH_KEYWORDS}, {"getargs_b", getargs_b, METH_VARARGS}, {"getargs_B", getargs_B, METH_VARARGS}, @@ -4863,7 +4863,7 @@ static PyMethodDef TestMethods[] = { {"set_exc_info", test_set_exc_info, METH_VARARGS}, {"argparsing", argparsing, METH_VARARGS}, {"code_newempty", code_newempty, METH_VARARGS}, - {"make_exception_with_doc", (PyCFunction)make_exception_with_doc, + {"make_exception_with_doc", (PyCFunction)(void(*)(void))make_exception_with_doc, METH_VARARGS | METH_KEYWORDS}, {"make_memoryview_from_NULL_pointer", make_memoryview_from_NULL_pointer, METH_NOARGS}, @@ -4960,7 +4960,7 @@ static PyMethodDef TestMethods[] = { {"get_mapping_items", get_mapping_items, METH_O}, {"test_pythread_tss_key_state", test_pythread_tss_key_state, METH_VARARGS}, {"hamt", new_hamt, METH_NOARGS}, - {"bad_get", (PyCFunction)bad_get, METH_FASTCALL}, + {"bad_get", (PyCFunction)(void(*)(void))bad_get, METH_FASTCALL}, {"EncodeLocaleEx", encode_locale_ex, METH_VARARGS}, {"DecodeLocaleEx", decode_locale_ex, METH_VARARGS}, {"get_global_config", get_global_config, METH_NOARGS}, @@ -5388,7 +5388,7 @@ generic_alias_mro_entries(PyGenericAliasObject *self, PyObject *bases) } static PyMethodDef generic_alias_methods[] = { - {"__mro_entries__", (PyCFunction) generic_alias_mro_entries, METH_O, NULL}, + {"__mro_entries__", (PyCFunction)(void(*)(void))generic_alias_mro_entries, METH_O, NULL}, {NULL} /* sentinel */ }; diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c index a4ddb87e2b7f..d075ef7455db 100644 --- a/Modules/_threadmodule.c +++ b/Modules/_threadmodule.c @@ -204,9 +204,9 @@ lock_repr(lockobject *self) } static PyMethodDef lock_methods[] = { - {"acquire_lock", (PyCFunction)lock_PyThread_acquire_lock, + {"acquire_lock", (PyCFunction)(void(*)(void))lock_PyThread_acquire_lock, METH_VARARGS | METH_KEYWORDS, acquire_doc}, - {"acquire", (PyCFunction)lock_PyThread_acquire_lock, + {"acquire", (PyCFunction)(void(*)(void))lock_PyThread_acquire_lock, METH_VARARGS | METH_KEYWORDS, acquire_doc}, {"release_lock", (PyCFunction)lock_PyThread_release_lock, METH_NOARGS, release_doc}, @@ -216,7 +216,7 @@ static PyMethodDef lock_methods[] = { METH_NOARGS, locked_doc}, {"locked", (PyCFunction)lock_locked_lock, METH_NOARGS, locked_doc}, - {"__enter__", (PyCFunction)lock_PyThread_acquire_lock, + {"__enter__", (PyCFunction)(void(*)(void))lock_PyThread_acquire_lock, METH_VARARGS | METH_KEYWORDS, acquire_doc}, {"__exit__", (PyCFunction)lock_PyThread_release_lock, METH_VARARGS, release_doc}, @@ -466,7 +466,7 @@ rlock_repr(rlockobject *self) static PyMethodDef rlock_methods[] = { - {"acquire", (PyCFunction)rlock_acquire, + {"acquire", (PyCFunction)(void(*)(void))rlock_acquire, METH_VARARGS | METH_KEYWORDS, rlock_acquire_doc}, {"release", (PyCFunction)rlock_release, METH_NOARGS, rlock_release_doc}, @@ -476,7 +476,7 @@ static PyMethodDef rlock_methods[] = { METH_VARARGS, rlock_acquire_restore_doc}, {"_release_save", (PyCFunction)rlock_release_save, METH_NOARGS, rlock_release_save_doc}, - {"__enter__", (PyCFunction)rlock_acquire, + {"__enter__", (PyCFunction)(void(*)(void))rlock_acquire, METH_VARARGS | METH_KEYWORDS, rlock_acquire_doc}, {"__exit__", (PyCFunction)rlock_release, METH_VARARGS, rlock_release_doc}, diff --git a/Modules/_xxsubinterpretersmodule.c b/Modules/_xxsubinterpretersmodule.c index 33509ef4ded5..235df7076f99 100644 --- a/Modules/_xxsubinterpretersmodule.c +++ b/Modules/_xxsubinterpretersmodule.c @@ -2768,7 +2768,7 @@ channel__channel_id(PyObject *self, PyObject *args, PyObject *kwds) static PyMethodDef module_functions[] = { {"create", (PyCFunction)interp_create, METH_VARARGS, create_doc}, - {"destroy", (PyCFunction)interp_destroy, + {"destroy", (PyCFunction)(void(*)(void))interp_destroy, METH_VARARGS | METH_KEYWORDS, destroy_doc}, {"list_all", interp_list_all, METH_NOARGS, list_all_doc}, @@ -2776,29 +2776,29 @@ static PyMethodDef module_functions[] = { METH_NOARGS, get_current_doc}, {"get_main", interp_get_main, METH_NOARGS, get_main_doc}, - {"is_running", (PyCFunction)interp_is_running, + {"is_running", (PyCFunction)(void(*)(void))interp_is_running, METH_VARARGS | METH_KEYWORDS, is_running_doc}, - {"run_string", (PyCFunction)interp_run_string, + {"run_string", (PyCFunction)(void(*)(void))interp_run_string, METH_VARARGS | METH_KEYWORDS, run_string_doc}, - {"is_shareable", (PyCFunction)object_is_shareable, + {"is_shareable", (PyCFunction)(void(*)(void))object_is_shareable, METH_VARARGS | METH_KEYWORDS, is_shareable_doc}, {"channel_create", channel_create, METH_NOARGS, channel_create_doc}, - {"channel_destroy", (PyCFunction)channel_destroy, + {"channel_destroy", (PyCFunction)(void(*)(void))channel_destroy, METH_VARARGS | METH_KEYWORDS, channel_destroy_doc}, {"channel_list_all", channel_list_all, METH_NOARGS, channel_list_all_doc}, - {"channel_send", (PyCFunction)channel_send, + {"channel_send", (PyCFunction)(void(*)(void))channel_send, METH_VARARGS | METH_KEYWORDS, channel_send_doc}, - {"channel_recv", (PyCFunction)channel_recv, + {"channel_recv", (PyCFunction)(void(*)(void))channel_recv, METH_VARARGS | METH_KEYWORDS, channel_recv_doc}, - {"channel_close", (PyCFunction)channel_close, + {"channel_close", (PyCFunction)(void(*)(void))channel_close, METH_VARARGS | METH_KEYWORDS, channel_close_doc}, - {"channel_release", (PyCFunction)channel_release, + {"channel_release", (PyCFunction)(void(*)(void))channel_release, METH_VARARGS | METH_KEYWORDS, channel_release_doc}, - {"_channel_id", (PyCFunction)channel__channel_id, + {"_channel_id", (PyCFunction)(void(*)(void))channel__channel_id, METH_VARARGS | METH_KEYWORDS, NULL}, {NULL, NULL} /* sentinel */ diff --git a/Modules/atexitmodule.c b/Modules/atexitmodule.c index afa1cfad6c41..1d6d6e53cfbf 100644 --- a/Modules/atexitmodule.c +++ b/Modules/atexitmodule.c @@ -291,7 +291,7 @@ atexit_unregister(PyObject *self, PyObject *func) } static PyMethodDef atexit_methods[] = { - {"register", (PyCFunction) atexit_register, METH_VARARGS|METH_KEYWORDS, + {"register", (PyCFunction)(void(*)(void)) atexit_register, METH_VARARGS|METH_KEYWORDS, atexit_register__doc__}, {"_clear", (PyCFunction) atexit_clear, METH_NOARGS, atexit_clear__doc__}, diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c index 17bf3faeefe4..30fe18695fec 100644 --- a/Modules/faulthandler.c +++ b/Modules/faulthandler.c @@ -1175,7 +1175,7 @@ PyDoc_STRVAR(module_doc, static PyMethodDef module_methods[] = { {"enable", - (PyCFunction)faulthandler_py_enable, METH_VARARGS|METH_KEYWORDS, + (PyCFunction)(void(*)(void))faulthandler_py_enable, METH_VARARGS|METH_KEYWORDS, PyDoc_STR("enable(file=sys.stderr, all_threads=True): " "enable the fault handler")}, {"disable", faulthandler_disable_py, METH_NOARGS, @@ -1183,13 +1183,13 @@ static PyMethodDef module_methods[] = { {"is_enabled", faulthandler_is_enabled, METH_NOARGS, PyDoc_STR("is_enabled()->bool: check if the handler is enabled")}, {"dump_traceback", - (PyCFunction)faulthandler_dump_traceback_py, METH_VARARGS|METH_KEYWORDS, + (PyCFunction)(void(*)(void))faulthandler_dump_traceback_py, METH_VARARGS|METH_KEYWORDS, PyDoc_STR("dump_traceback(file=sys.stderr, all_threads=True): " "dump the traceback of the current thread, or of all threads " "if all_threads is True, into file")}, #ifdef FAULTHANDLER_LATER {"dump_traceback_later", - (PyCFunction)faulthandler_dump_traceback_later, METH_VARARGS|METH_KEYWORDS, + (PyCFunction)(void(*)(void))faulthandler_dump_traceback_later, METH_VARARGS|METH_KEYWORDS, PyDoc_STR("dump_traceback_later(timeout, repeat=False, file=sys.stderrn, exit=False):\n" "dump the traceback of all threads in timeout seconds,\n" "or each timeout seconds if repeat is True. If exit is True, " @@ -1202,13 +1202,13 @@ static PyMethodDef module_methods[] = { #ifdef FAULTHANDLER_USER {"register", - (PyCFunction)faulthandler_register_py, METH_VARARGS|METH_KEYWORDS, + (PyCFunction)(void(*)(void))faulthandler_register_py, METH_VARARGS|METH_KEYWORDS, PyDoc_STR("register(signum, file=sys.stderr, all_threads=True, chain=False): " "register a handler for the signal 'signum': dump the " "traceback of the current thread, or of all threads if " "all_threads is True, into file")}, {"unregister", - faulthandler_unregister_py, METH_VARARGS|METH_KEYWORDS, + (PyCFunction)(void(*)(void))faulthandler_unregister_py, METH_VARARGS|METH_KEYWORDS, PyDoc_STR("unregister(signum): unregister the handler of the signal " "'signum' registered by register()")}, #endif diff --git a/Modules/nismodule.c b/Modules/nismodule.c index 1a538dc3b233..bc6796c278ca 100644 --- a/Modules/nismodule.c +++ b/Modules/nismodule.c @@ -423,13 +423,13 @@ nis_maps (PyObject *self, PyObject *args, PyObject *kwdict) } static PyMethodDef nis_methods[] = { - {"match", (PyCFunction)nis_match, + {"match", (PyCFunction)(void(*)(void))nis_match, METH_VARARGS | METH_KEYWORDS, match__doc__}, - {"cat", (PyCFunction)nis_cat, + {"cat", (PyCFunction)(void(*)(void))nis_cat, METH_VARARGS | METH_KEYWORDS, cat__doc__}, - {"maps", (PyCFunction)nis_maps, + {"maps", (PyCFunction)(void(*)(void))nis_maps, METH_VARARGS | METH_KEYWORDS, maps__doc__}, {"get_default_domain", nis_get_default_domain, diff --git a/Modules/parsermodule.c b/Modules/parsermodule.c index c8fb3d21771b..8f88657c00b6 100644 --- a/Modules/parsermodule.c +++ b/Modules/parsermodule.c @@ -206,15 +206,15 @@ static PyObject* parser_st2tuple(PyST_Object *, PyObject *, PyObject *); #define PUBLIC_METHOD_TYPE (METH_VARARGS|METH_KEYWORDS) static PyMethodDef parser_methods[] = { - {"compile", (PyCFunction)parser_compilest, PUBLIC_METHOD_TYPE, + {"compile", (PyCFunction)(void(*)(void))parser_compilest, PUBLIC_METHOD_TYPE, PyDoc_STR("Compile this ST object into a code object.")}, - {"isexpr", (PyCFunction)parser_isexpr, PUBLIC_METHOD_TYPE, + {"isexpr", (PyCFunction)(void(*)(void))parser_isexpr, PUBLIC_METHOD_TYPE, PyDoc_STR("Determines if this ST object was created from an expression.")}, - {"issuite", (PyCFunction)parser_issuite, PUBLIC_METHOD_TYPE, + {"issuite", (PyCFunction)(void(*)(void))parser_issuite, PUBLIC_METHOD_TYPE, PyDoc_STR("Determines if this ST object was created from a suite.")}, - {"tolist", (PyCFunction)parser_st2list, PUBLIC_METHOD_TYPE, + {"tolist", (PyCFunction)(void(*)(void))parser_st2list, PUBLIC_METHOD_TYPE, PyDoc_STR("Creates a list-tree representation of this ST.")}, - {"totuple", (PyCFunction)parser_st2tuple, PUBLIC_METHOD_TYPE, + {"totuple", (PyCFunction)(void(*)(void))parser_st2tuple, PUBLIC_METHOD_TYPE, PyDoc_STR("Creates a tuple-tree representation of this ST.")}, {"__sizeof__", (PyCFunction)parser_sizeof, METH_NOARGS, PyDoc_STR("Returns size in memory, in bytes.")}, @@ -1087,23 +1087,23 @@ parser__pickler(PyObject *self, PyObject *args) * inheritance. */ static PyMethodDef parser_functions[] = { - {"compilest", (PyCFunction)parser_compilest, PUBLIC_METHOD_TYPE, + {"compilest", (PyCFunction)(void(*)(void))parser_compilest, PUBLIC_METHOD_TYPE, PyDoc_STR("Compiles an ST object into a code object.")}, - {"expr", (PyCFunction)parser_expr, PUBLIC_METHOD_TYPE, + {"expr", (PyCFunction)(void(*)(void))parser_expr, PUBLIC_METHOD_TYPE, PyDoc_STR("Creates an ST object from an expression.")}, - {"isexpr", (PyCFunction)parser_isexpr, PUBLIC_METHOD_TYPE, + {"isexpr", (PyCFunction)(void(*)(void))parser_isexpr, PUBLIC_METHOD_TYPE, PyDoc_STR("Determines if an ST object was created from an expression.")}, - {"issuite", (PyCFunction)parser_issuite, PUBLIC_METHOD_TYPE, + {"issuite", (PyCFunction)(void(*)(void))parser_issuite, PUBLIC_METHOD_TYPE, PyDoc_STR("Determines if an ST object was created from a suite.")}, - {"suite", (PyCFunction)parser_suite, PUBLIC_METHOD_TYPE, + {"suite", (PyCFunction)(void(*)(void))parser_suite, PUBLIC_METHOD_TYPE, PyDoc_STR("Creates an ST object from a suite.")}, - {"sequence2st", (PyCFunction)parser_tuple2st, PUBLIC_METHOD_TYPE, + {"sequence2st", (PyCFunction)(void(*)(void))parser_tuple2st, PUBLIC_METHOD_TYPE, PyDoc_STR("Creates an ST object from a tree representation.")}, - {"st2tuple", (PyCFunction)parser_st2tuple, PUBLIC_METHOD_TYPE, + {"st2tuple", (PyCFunction)(void(*)(void))parser_st2tuple, PUBLIC_METHOD_TYPE, PyDoc_STR("Creates a tuple-tree representation of an ST.")}, - {"st2list", (PyCFunction)parser_st2list, PUBLIC_METHOD_TYPE, + {"st2list", (PyCFunction)(void(*)(void))parser_st2list, PUBLIC_METHOD_TYPE, PyDoc_STR("Creates a list-tree representation of an ST.")}, - {"tuple2st", (PyCFunction)parser_tuple2st, PUBLIC_METHOD_TYPE, + {"tuple2st", (PyCFunction)(void(*)(void))parser_tuple2st, PUBLIC_METHOD_TYPE, PyDoc_STR("Creates an ST object from a tree representation.")}, /* private stuff: support pickle module */ diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 44d6009bda71..d42e40f243e2 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -13175,7 +13175,7 @@ static PyMethodDef posix_methods[] = { OS_PWRITE_METHODDEF OS_PWRITEV_METHODDEF #ifdef HAVE_SENDFILE - {"sendfile", (PyCFunction)posix_sendfile, METH_VARARGS | METH_KEYWORDS, + {"sendfile", (PyCFunction)(void(*)(void))posix_sendfile, METH_VARARGS | METH_KEYWORDS, posix_sendfile__doc__}, #endif OS_FSTAT_METHODDEF diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index 1915fd9be456..52ab4e998a97 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -1210,7 +1210,7 @@ static PyMethodDef signal_methods[] = { SIGNAL_SIGNAL_METHODDEF SIGNAL_STRSIGNAL_METHODDEF SIGNAL_GETSIGNAL_METHODDEF - {"set_wakeup_fd", (PyCFunction)signal_set_wakeup_fd, METH_VARARGS | METH_KEYWORDS, set_wakeup_fd_doc}, + {"set_wakeup_fd", (PyCFunction)(void(*)(void))signal_set_wakeup_fd, METH_VARARGS | METH_KEYWORDS, set_wakeup_fd_doc}, SIGNAL_SIGINTERRUPT_METHODDEF SIGNAL_PAUSE_METHODDEF SIGNAL_PTHREAD_KILL_METHODDEF diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index a47f0314605c..04bfdafeb323 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -4810,11 +4810,11 @@ static PyMethodDef sock_methods[] = { listen_doc}, {"recv", (PyCFunction)sock_recv, METH_VARARGS, recv_doc}, - {"recv_into", (PyCFunction)sock_recv_into, METH_VARARGS | METH_KEYWORDS, + {"recv_into", (PyCFunction)(void(*)(void))sock_recv_into, METH_VARARGS | METH_KEYWORDS, recv_into_doc}, {"recvfrom", (PyCFunction)sock_recvfrom, METH_VARARGS, recvfrom_doc}, - {"recvfrom_into", (PyCFunction)sock_recvfrom_into, METH_VARARGS | METH_KEYWORDS, + {"recvfrom_into", (PyCFunction)(void(*)(void))sock_recvfrom_into, METH_VARARGS | METH_KEYWORDS, recvfrom_into_doc}, {"send", (PyCFunction)sock_send, METH_VARARGS, send_doc}, @@ -4843,7 +4843,7 @@ static PyMethodDef sock_methods[] = { sendmsg_doc}, #endif #ifdef HAVE_SOCKADDR_ALG - {"sendmsg_afalg", (PyCFunction)sock_sendmsg_afalg, METH_VARARGS | METH_KEYWORDS, + {"sendmsg_afalg", (PyCFunction)(void(*)(void))sock_sendmsg_afalg, METH_VARARGS | METH_KEYWORDS, sendmsg_afalg_doc}, #endif {NULL, NULL} /* sentinel */ @@ -6741,7 +6741,7 @@ static PyMethodDef socket_methods[] = { {"inet_ntop", socket_inet_ntop, METH_VARARGS, inet_ntop_doc}, #endif - {"getaddrinfo", (PyCFunction)socket_getaddrinfo, + {"getaddrinfo", (PyCFunction)(void(*)(void))socket_getaddrinfo, METH_VARARGS | METH_KEYWORDS, getaddrinfo_doc}, {"getnameinfo", socket_getnameinfo, METH_VARARGS, getnameinfo_doc}, diff --git a/Modules/syslogmodule.c b/Modules/syslogmodule.c index a5807dcce9ce..b2ea73baa1be 100644 --- a/Modules/syslogmodule.c +++ b/Modules/syslogmodule.c @@ -238,7 +238,7 @@ syslog_log_upto(PyObject *self, PyObject *args) /* List of functions defined in the module */ static PyMethodDef syslog_methods[] = { - {"openlog", (PyCFunction) syslog_openlog, METH_VARARGS | METH_KEYWORDS}, + {"openlog", (PyCFunction)(void(*)(void)) syslog_openlog, METH_VARARGS | METH_KEYWORDS}, {"closelog", syslog_closelog, METH_NOARGS}, {"syslog", syslog_syslog, METH_VARARGS}, {"setlogmask", syslog_setlogmask, METH_VARARGS}, diff --git a/Modules/xxsubtype.c b/Modules/xxsubtype.c index 11242d739138..d9cb4cdb902f 100644 --- a/Modules/xxsubtype.c +++ b/Modules/xxsubtype.c @@ -70,10 +70,10 @@ static PyMethodDef spamlist_methods[] = { PyDoc_STR("setstate(state)")}, /* These entries differ only in the flags; they are used by the tests in test.test_descr. */ - {"classmeth", (PyCFunction)spamlist_specialmeth, + {"classmeth", (PyCFunction)(void(*)(void))spamlist_specialmeth, METH_VARARGS | METH_KEYWORDS | METH_CLASS, PyDoc_STR("classmeth(*args, **kw)")}, - {"staticmeth", (PyCFunction)spamlist_specialmeth, + {"staticmeth", (PyCFunction)(void(*)(void))spamlist_specialmeth, METH_VARARGS | METH_KEYWORDS | METH_STATIC, PyDoc_STR("staticmeth(*args, **kw)")}, {NULL, NULL}, diff --git a/Objects/call.c b/Objects/call.c index ba2ddcb35b9b..be8e90d03d66 100644 --- a/Objects/call.c +++ b/Objects/call.c @@ -514,7 +514,7 @@ _PyMethodDef_RawFastCallDict(PyMethodDef *method, PyObject *self, } if (flags & METH_KEYWORDS) { - result = (*(PyCFunctionWithKeywords)meth) (self, argstuple, kwargs); + result = (*(PyCFunctionWithKeywords)(void(*)(void))meth) (self, argstuple, kwargs); } else { result = (*meth) (self, argstuple); @@ -529,7 +529,7 @@ _PyMethodDef_RawFastCallDict(PyMethodDef *method, PyObject *self, goto no_keyword_error; } - result = (*(_PyCFunctionFast)meth) (self, args, nargs); + result = (*(_PyCFunctionFast)(void(*)(void))meth) (self, args, nargs); break; } @@ -537,7 +537,7 @@ _PyMethodDef_RawFastCallDict(PyMethodDef *method, PyObject *self, { PyObject *const *stack; PyObject *kwnames; - _PyCFunctionFastWithKeywords fastmeth = (_PyCFunctionFastWithKeywords)meth; + _PyCFunctionFastWithKeywords fastmeth = (_PyCFunctionFastWithKeywords)(void(*)(void))meth; if (_PyStack_UnpackDict(args, nargs, kwargs, &stack, &kwnames) < 0) { goto exit; @@ -650,12 +650,12 @@ _PyMethodDef_RawFastCallKeywords(PyMethodDef *method, PyObject *self, if (nkwargs) { goto no_keyword_error; } - result = ((_PyCFunctionFast)meth) (self, args, nargs); + result = ((_PyCFunctionFast)(void(*)(void))meth) (self, args, nargs); break; case METH_FASTCALL | METH_KEYWORDS: /* Fast-path: avoid temporary dict to pass keyword arguments */ - result = ((_PyCFunctionFastWithKeywords)meth) (self, args, nargs, kwnames); + result = ((_PyCFunctionFastWithKeywords)(void(*)(void))meth) (self, args, nargs, kwnames); break; case METH_VARARGS: @@ -689,7 +689,7 @@ _PyMethodDef_RawFastCallKeywords(PyMethodDef *method, PyObject *self, kwdict = NULL; } - result = (*(PyCFunctionWithKeywords)meth) (self, argtuple, kwdict); + result = (*(PyCFunctionWithKeywords)(void(*)(void))meth) (self, argtuple, kwdict); Py_XDECREF(kwdict); } else { @@ -752,7 +752,7 @@ cfunction_call_varargs(PyObject *func, PyObject *args, PyObject *kwargs) return NULL; } - result = (*(PyCFunctionWithKeywords)meth)(self, args, kwargs); + result = (*(PyCFunctionWithKeywords)(void(*)(void))meth)(self, args, kwargs); Py_LeaveRecursiveCall(); } diff --git a/Objects/dictobject.c b/Objects/dictobject.c index 2f108bd48d00..72cb4c5d666f 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -3095,15 +3095,15 @@ PyDoc_STRVAR(values__doc__, static PyMethodDef mapp_methods[] = { DICT___CONTAINS___METHODDEF - {"__getitem__", (PyCFunction)dict_subscript, METH_O | METH_COEXIST, + {"__getitem__", (PyCFunction)(void(*)(void))dict_subscript, METH_O | METH_COEXIST, getitem__doc__}, - {"__sizeof__", (PyCFunction)dict_sizeof, METH_NOARGS, + {"__sizeof__", (PyCFunction)(void(*)(void))dict_sizeof, METH_NOARGS, sizeof__doc__}, DICT_GET_METHODDEF DICT_SETDEFAULT_METHODDEF {"pop", (PyCFunction)dict_pop, METH_VARARGS, pop__doc__}, - {"popitem", (PyCFunction)dict_popitem, METH_NOARGS, + {"popitem", (PyCFunction)(void(*)(void))dict_popitem, METH_NOARGS, popitem__doc__}, {"keys", dictkeys_new, METH_NOARGS, keys__doc__}, @@ -3111,7 +3111,7 @@ static PyMethodDef mapp_methods[] = { items__doc__}, {"values", dictvalues_new, METH_NOARGS, values__doc__}, - {"update", (PyCFunction)dict_update, METH_VARARGS | METH_KEYWORDS, + {"update", (PyCFunction)(void(*)(void))dict_update, METH_VARARGS | METH_KEYWORDS, update__doc__}, DICT_FROMKEYS_METHODDEF {"clear", (PyCFunction)dict_clear, METH_NOARGS, @@ -3420,9 +3420,9 @@ dictiter_reduce(dictiterobject *di, PyObject *Py_UNUSED(ignored)); PyDoc_STRVAR(reduce_doc, "Return state information for pickling."); static PyMethodDef dictiter_methods[] = { - {"__length_hint__", (PyCFunction)dictiter_len, METH_NOARGS, + {"__length_hint__", (PyCFunction)(void(*)(void))dictiter_len, METH_NOARGS, length_hint_doc}, - {"__reduce__", (PyCFunction)dictiter_reduce, METH_NOARGS, + {"__reduce__", (PyCFunction)(void(*)(void))dictiter_reduce, METH_NOARGS, reduce_doc}, {NULL, NULL} /* sentinel */ }; @@ -4209,7 +4209,7 @@ PyDoc_STRVAR(reversed_keys_doc, static PyMethodDef dictkeys_methods[] = { {"isdisjoint", (PyCFunction)dictviews_isdisjoint, METH_O, isdisjoint_doc}, - {"__reversed__", (PyCFunction)dictkeys_reversed, METH_NOARGS, + {"__reversed__", (PyCFunction)(void(*)(void))dictkeys_reversed, METH_NOARGS, reversed_keys_doc}, {NULL, NULL} /* sentinel */ }; @@ -4315,7 +4315,7 @@ PyDoc_STRVAR(reversed_items_doc, static PyMethodDef dictitems_methods[] = { {"isdisjoint", (PyCFunction)dictviews_isdisjoint, METH_O, isdisjoint_doc}, - {"__reversed__", (PyCFunction)dictitems_reversed, METH_NOARGS, + {"__reversed__", (PyCFunction)(void(*)(void))dictitems_reversed, METH_NOARGS, reversed_items_doc}, {NULL, NULL} /* sentinel */ }; @@ -4396,7 +4396,7 @@ PyDoc_STRVAR(reversed_values_doc, "Return a reverse iterator over the dict values."); static PyMethodDef dictvalues_methods[] = { - {"__reversed__", (PyCFunction)dictvalues_reversed, METH_NOARGS, + {"__reversed__", (PyCFunction)(void(*)(void))dictvalues_reversed, METH_NOARGS, reversed_values_doc}, {NULL, NULL} /* sentinel */ }; diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c index 0f528eec68bc..c1350b7dc37d 100644 --- a/Objects/memoryobject.c +++ b/Objects/memoryobject.c @@ -3086,7 +3086,7 @@ static PyMethodDef memory_methods[] = { {"tobytes", (PyCFunction)memory_tobytes, METH_NOARGS, memory_tobytes_doc}, {"hex", (PyCFunction)memory_hex, METH_NOARGS, memory_hex_doc}, {"tolist", (PyCFunction)memory_tolist, METH_NOARGS, memory_tolist_doc}, - {"cast", (PyCFunction)memory_cast, METH_VARARGS|METH_KEYWORDS, memory_cast_doc}, + {"cast", (PyCFunction)(void(*)(void))memory_cast, METH_VARARGS|METH_KEYWORDS, memory_cast_doc}, {"toreadonly", (PyCFunction)memory_toreadonly, METH_NOARGS, memory_toreadonly_doc}, {"__enter__", memory_enter, METH_NOARGS, NULL}, {"__exit__", memory_exit, METH_VARARGS, NULL}, diff --git a/Objects/odictobject.c b/Objects/odictobject.c index 0f542006c694..689062c95ddc 100644 --- a/Objects/odictobject.c +++ b/Objects/odictobject.c @@ -1311,7 +1311,7 @@ static PyMethodDef odict_methods[] = { {"__reduce__", (PyCFunction)odict_reduce, METH_NOARGS, odict_reduce__doc__}, ORDEREDDICT_SETDEFAULT_METHODDEF - {"pop", (PyCFunction)odict_pop, + {"pop", (PyCFunction)(void(*)(void))odict_pop, METH_VARARGS | METH_KEYWORDS, odict_pop__doc__}, ORDEREDDICT_POPITEM_METHODDEF {"keys", odictkeys_new, METH_NOARGS, @@ -1320,7 +1320,7 @@ static PyMethodDef odict_methods[] = { odict_values__doc__}, {"items", odictitems_new, METH_NOARGS, odict_items__doc__}, - {"update", (PyCFunction)odict_update, METH_VARARGS | METH_KEYWORDS, + {"update", (PyCFunction)(void(*)(void))odict_update, METH_VARARGS | METH_KEYWORDS, odict_update__doc__}, {"clear", (PyCFunction)odict_clear, METH_NOARGS, odict_clear__doc__}, diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 2345b7c07dc5..73d385b0f8a0 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -3481,7 +3481,7 @@ type___sizeof___impl(PyTypeObject *self) static PyMethodDef type_methods[] = { TYPE_MRO_METHODDEF TYPE___SUBCLASSES___METHODDEF - {"__prepare__", (PyCFunction)type_prepare, + {"__prepare__", (PyCFunction)(void(*)(void))type_prepare, METH_FASTCALL | METH_KEYWORDS | METH_CLASS, PyDoc_STR("__prepare__() -> dict\n" "used to create the namespace for the class statement")}, @@ -5944,7 +5944,7 @@ tp_new_wrapper(PyObject *self, PyObject *args, PyObject *kwds) } static struct PyMethodDef tp_new_methoddef[] = { - {"__new__", (PyCFunction)tp_new_wrapper, METH_VARARGS|METH_KEYWORDS, + {"__new__", (PyCFunction)(void(*)(void))tp_new_wrapper, METH_VARARGS|METH_KEYWORDS, PyDoc_STR("__new__($type, *args, **kwargs)\n--\n\n" "Create and return a new object. " "See help(type) for accurate signature.")}, @@ -7140,7 +7140,7 @@ update_one_slot(PyTypeObject *type, slotdef *p) } else if (Py_TYPE(descr) == &PyCFunction_Type && PyCFunction_GET_FUNCTION(descr) == - (PyCFunction)tp_new_wrapper && + (PyCFunction)(void(*)(void))tp_new_wrapper && ptr == (void**)&type->tp_new) { /* The __new__ wrapper is not a wrapper descriptor, diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 3da40ddc5898..cdfc2f6f2199 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -13948,7 +13948,7 @@ static PyMethodDef unicode_methods[] = { UNICODE_ISIDENTIFIER_METHODDEF UNICODE_ISPRINTABLE_METHODDEF UNICODE_ZFILL_METHODDEF - {"format", (PyCFunction) do_string_format, METH_VARARGS | METH_KEYWORDS, format__doc__}, + {"format", (PyCFunction)(void(*)(void)) do_string_format, METH_VARARGS | METH_KEYWORDS, format__doc__}, {"format_map", (PyCFunction) do_string_format_map, METH_O, format_map__doc__}, UNICODE___FORMAT___METHODDEF UNICODE_MAKETRANS_METHODDEF diff --git a/Python/_warnings.c b/Python/_warnings.c index 4065005354b8..ccbc73f54e4f 100644 --- a/Python/_warnings.c +++ b/Python/_warnings.c @@ -1150,7 +1150,7 @@ PyDoc_STRVAR(warn_explicit_doc, static PyMethodDef warnings_functions[] = { WARNINGS_WARN_METHODDEF - {"warn_explicit", (PyCFunction)warnings_warn_explicit, + {"warn_explicit", (PyCFunction)(void(*)(void))warnings_warn_explicit, METH_VARARGS | METH_KEYWORDS, warn_explicit_doc}, {"_filters_mutated", (PyCFunction)warnings_filters_mutated, METH_NOARGS, NULL}, diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index f0d342ae92d2..e19bc5604ba1 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -2195,7 +2195,7 @@ PyDoc_STRVAR(builtin_sorted__doc__, "reverse flag can be set to request the result in descending order."); #define BUILTIN_SORTED_METHODDEF \ - {"sorted", (PyCFunction)builtin_sorted, METH_FASTCALL | METH_KEYWORDS, builtin_sorted__doc__}, + {"sorted", (PyCFunction)(void(*)(void))builtin_sorted, METH_FASTCALL | METH_KEYWORDS, builtin_sorted__doc__}, static PyObject * builtin_sorted(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) @@ -2691,15 +2691,15 @@ PyTypeObject PyZip_Type = { static PyMethodDef builtin_methods[] = { - {"__build_class__", (PyCFunction)builtin___build_class__, + {"__build_class__", (PyCFunction)(void(*)(void))builtin___build_class__, METH_FASTCALL | METH_KEYWORDS, build_class_doc}, - {"__import__", (PyCFunction)builtin___import__, METH_VARARGS | METH_KEYWORDS, import_doc}, + {"__import__", (PyCFunction)(void(*)(void))builtin___import__, METH_VARARGS | METH_KEYWORDS, import_doc}, BUILTIN_ABS_METHODDEF BUILTIN_ALL_METHODDEF BUILTIN_ANY_METHODDEF BUILTIN_ASCII_METHODDEF BUILTIN_BIN_METHODDEF - {"breakpoint", (PyCFunction)builtin_breakpoint, METH_FASTCALL | METH_KEYWORDS, breakpoint_doc}, + {"breakpoint", (PyCFunction)(void(*)(void))builtin_breakpoint, METH_FASTCALL | METH_KEYWORDS, breakpoint_doc}, BUILTIN_CALLABLE_METHODDEF BUILTIN_CHR_METHODDEF BUILTIN_COMPILE_METHODDEF @@ -2709,7 +2709,7 @@ static PyMethodDef builtin_methods[] = { BUILTIN_EVAL_METHODDEF BUILTIN_EXEC_METHODDEF BUILTIN_FORMAT_METHODDEF - {"getattr", (PyCFunction)builtin_getattr, METH_FASTCALL, getattr_doc}, + {"getattr", (PyCFunction)(void(*)(void))builtin_getattr, METH_FASTCALL, getattr_doc}, BUILTIN_GLOBALS_METHODDEF BUILTIN_HASATTR_METHODDEF BUILTIN_HASH_METHODDEF @@ -2721,13 +2721,13 @@ static PyMethodDef builtin_methods[] = { {"iter", builtin_iter, METH_VARARGS, iter_doc}, BUILTIN_LEN_METHODDEF BUILTIN_LOCALS_METHODDEF - {"max", (PyCFunction)builtin_max, METH_VARARGS | METH_KEYWORDS, max_doc}, - {"min", (PyCFunction)builtin_min, METH_VARARGS | METH_KEYWORDS, min_doc}, - {"next", (PyCFunction)builtin_next, METH_FASTCALL, next_doc}, + {"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_OCT_METHODDEF BUILTIN_ORD_METHODDEF BUILTIN_POW_METHODDEF - {"print", (PyCFunction)builtin_print, METH_FASTCALL | METH_KEYWORDS, print_doc}, + {"print", (PyCFunction)(void(*)(void))builtin_print, METH_FASTCALL | METH_KEYWORDS, print_doc}, BUILTIN_REPR_METHODDEF BUILTIN_ROUND_METHODDEF BUILTIN_SETATTR_METHODDEF diff --git a/Python/context.c b/Python/context.c index 302f7696bb6b..d6ef5b337ca3 100644 --- a/Python/context.c +++ b/Python/context.c @@ -648,7 +648,7 @@ static PyMethodDef PyContext_methods[] = { _CONTEXTVARS_CONTEXT_KEYS_METHODDEF _CONTEXTVARS_CONTEXT_VALUES_METHODDEF _CONTEXTVARS_CONTEXT_COPY_METHODDEF - {"run", (PyCFunction)context_run, METH_FASTCALL | METH_KEYWORDS, NULL}, + {"run", (PyCFunction)(void(*)(void))context_run, METH_FASTCALL | METH_KEYWORDS, NULL}, {NULL, NULL} }; diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 2284e88d4c11..0ca3de39f8bd 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -1521,7 +1521,7 @@ sys_getandroidapilevel(PyObject *self) static PyMethodDef sys_methods[] = { /* Might as well keep this in alphabetic order */ - {"breakpointhook", (PyCFunction)sys_breakpointhook, + {"breakpointhook", (PyCFunction)(void(*)(void))sys_breakpointhook, METH_FASTCALL | METH_KEYWORDS, breakpointhook_doc}, {"callstats", sys_callstats, METH_NOARGS, callstats_doc}, @@ -1560,7 +1560,7 @@ static PyMethodDef sys_methods[] = { {"getrefcount", (PyCFunction)sys_getrefcount, METH_O, getrefcount_doc}, {"getrecursionlimit", sys_getrecursionlimit, METH_NOARGS, getrecursionlimit_doc}, - {"getsizeof", (PyCFunction)sys_getsizeof, + {"getsizeof", (PyCFunction)(void(*)(void))sys_getsizeof, METH_VARARGS | METH_KEYWORDS, getsizeof_doc}, {"_getframe", sys_getframe, METH_VARARGS, getframe_doc}, #ifdef MS_WINDOWS @@ -1601,7 +1601,7 @@ static PyMethodDef sys_methods[] = { set_coroutine_wrapper_doc}, {"get_coroutine_wrapper", sys_get_coroutine_wrapper, METH_NOARGS, get_coroutine_wrapper_doc}, - {"set_asyncgen_hooks", (PyCFunction)sys_set_asyncgen_hooks, + {"set_asyncgen_hooks", (PyCFunction)(void(*)(void))sys_set_asyncgen_hooks, METH_VARARGS | METH_KEYWORDS, set_asyncgen_hooks_doc}, {"get_asyncgen_hooks", sys_get_asyncgen_hooks, METH_NOARGS, get_asyncgen_hooks_doc}, From webhook-mailer at python.org Tue Nov 27 06:40:55 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 27 Nov 2018 11:40:55 -0000 Subject: [Python-checkins] bpo-35317: Fix mktime() error in test_email (GH-10721) Message-ID: https://github.com/python/cpython/commit/cfaafda8e3e19764682abb4bd4c574accb784c42 commit: cfaafda8e3e19764682abb4bd4c574accb784c42 branch: master author: Victor Stinner committer: GitHub date: 2018-11-27T12:40:50+01:00 summary: bpo-35317: Fix mktime() error in test_email (GH-10721) Fix mktime() overflow error in test_email: run test_localtime_daylight_true_dst_true() and test_localtime_daylight_false_dst_true() with a specific timezone. files: A Misc/NEWS.d/next/Tests/2018-11-26-16-54-21.bpo-35317.jByGP2.rst M Lib/test/test_email/test_utils.py diff --git a/Lib/test/test_email/test_utils.py b/Lib/test/test_email/test_utils.py index 6dcb3bbe7aab..4e3c3f3a195f 100644 --- a/Lib/test/test_email/test_utils.py +++ b/Lib/test/test_email/test_utils.py @@ -75,6 +75,7 @@ def test_localtime_daylight_false_dst_false(self): t2 = utils.localtime(t1) self.assertEqual(t1, t2) + @test.support.run_with_tz('Europe/Minsk') def test_localtime_daylight_true_dst_true(self): test.support.patch(self, time, 'daylight', True) t0 = datetime.datetime(2012, 3, 12, 1, 1) @@ -82,6 +83,7 @@ def test_localtime_daylight_true_dst_true(self): t2 = utils.localtime(t1) self.assertEqual(t1, t2) + @test.support.run_with_tz('Europe/Minsk') def test_localtime_daylight_false_dst_true(self): test.support.patch(self, time, 'daylight', False) t0 = datetime.datetime(2012, 3, 12, 1, 1) diff --git a/Misc/NEWS.d/next/Tests/2018-11-26-16-54-21.bpo-35317.jByGP2.rst b/Misc/NEWS.d/next/Tests/2018-11-26-16-54-21.bpo-35317.jByGP2.rst new file mode 100644 index 000000000000..73a30f71927f --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2018-11-26-16-54-21.bpo-35317.jByGP2.rst @@ -0,0 +1,3 @@ +Fix ``mktime()`` overflow error in ``test_email``: run +``test_localtime_daylight_true_dst_true()`` and +``test_localtime_daylight_false_dst_true()`` with a specific timezone. From webhook-mailer at python.org Tue Nov 27 06:41:21 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 27 Nov 2018 11:41:21 -0000 Subject: [Python-checkins] bpo-33954: Fix compiler warning in _PyUnicode_FastFill() (GH-10737) Message-ID: https://github.com/python/cpython/commit/163403a63e9272fcd14707e344122c2e3c5e0244 commit: 163403a63e9272fcd14707e344122c2e3c5e0244 branch: master author: Victor Stinner committer: GitHub date: 2018-11-27T12:41:17+01:00 summary: bpo-33954: Fix compiler warning in _PyUnicode_FastFill() (GH-10737) 'data' argument of unicode_fill() is modified, so it must not be constant. Add more assertions to unicode_fill(): check the maximum character value. files: M Objects/unicodeobject.c diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index cdfc2f6f2199..2b1db918a154 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -228,12 +228,14 @@ unicode_fill(enum PyUnicode_Kind kind, void *data, Py_UCS4 value, assert(kind != PyUnicode_WCHAR_KIND); switch (kind) { case PyUnicode_1BYTE_KIND: { + assert(value <= 0xff); Py_UCS1 ch = (unsigned char)value; Py_UCS1 *to = (Py_UCS1 *)data + start; memset(to, ch, length); break; } case PyUnicode_2BYTE_KIND: { + assert(value <= 0xffff); Py_UCS2 ch = (Py_UCS2)value; Py_UCS2 *to = (Py_UCS2 *)data + start; const Py_UCS2 *end = to + length; @@ -241,6 +243,7 @@ unicode_fill(enum PyUnicode_Kind kind, void *data, Py_UCS4 value, break; } case PyUnicode_4BYTE_KIND: { + assert(value <= MAX_UNICODE); Py_UCS4 ch = value; Py_UCS4 * to = (Py_UCS4 *)data + start; const Py_UCS4 *end = to + length; @@ -10117,7 +10120,7 @@ _PyUnicode_FastFill(PyObject *unicode, Py_ssize_t start, Py_ssize_t length, Py_UCS4 fill_char) { const enum PyUnicode_Kind kind = PyUnicode_KIND(unicode); - const void *data = PyUnicode_DATA(unicode); + void *data = PyUnicode_DATA(unicode); assert(PyUnicode_IS_READY(unicode)); assert(unicode_modifiable(unicode)); assert(fill_char <= PyUnicode_MAX_CHAR_VALUE(unicode)); From webhook-mailer at python.org Tue Nov 27 06:42:09 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 27 Nov 2018 11:42:09 -0000 Subject: [Python-checkins] bpo-33954: Rewrite FILL() macro of unicodeobject.c (GH-10738) Message-ID: https://github.com/python/cpython/commit/7f9fb0f34555641722be5468b7fbd53dd3c0f1e2 commit: 7f9fb0f34555641722be5468b7fbd53dd3c0f1e2 branch: 3.7 author: Victor Stinner committer: GitHub date: 2018-11-27T12:42:04+01:00 summary: bpo-33954: Rewrite FILL() macro of unicodeobject.c (GH-10738) Copy code from master: add assertions on start and value, replace 'i' iterator with 'end' pointer for the loop stop condition. _PyUnicode_FastFill(): fix type of 'data', it must not be constant, since data is modified by FILL(). files: M Objects/unicodeobject.c diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 8dd7c3b8258c..e6371d2337c3 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -220,22 +220,30 @@ static PyObject *unicode_empty = NULL; #define FILL(kind, data, value, start, length) \ do { \ - Py_ssize_t i_ = 0; \ + assert(0 <= start); \ assert(kind != PyUnicode_WCHAR_KIND); \ - switch ((kind)) { \ + switch (kind) { \ case PyUnicode_1BYTE_KIND: { \ - unsigned char * to_ = (unsigned char *)((data)) + (start); \ - memset(to_, (unsigned char)value, (length)); \ + assert(value <= 0xff); \ + Py_UCS1 ch = (unsigned char)value; \ + Py_UCS1 *to = (Py_UCS1 *)data + start; \ + memset(to, ch, length); \ break; \ } \ case PyUnicode_2BYTE_KIND: { \ - Py_UCS2 * to_ = (Py_UCS2 *)((data)) + (start); \ - for (; i_ < (length); ++i_, ++to_) *to_ = (value); \ + assert(value <= 0xffff); \ + Py_UCS2 ch = (Py_UCS2)value; \ + Py_UCS2 *to = (Py_UCS2 *)data + start; \ + const Py_UCS2 *end = to + length; \ + for (; to < end; ++to) *to = ch; \ break; \ } \ case PyUnicode_4BYTE_KIND: { \ - Py_UCS4 * to_ = (Py_UCS4 *)((data)) + (start); \ - for (; i_ < (length); ++i_, ++to_) *to_ = (value); \ + assert(value <= MAX_UNICODE); \ + Py_UCS4 ch = value; \ + Py_UCS4 * to = (Py_UCS4 *)data + start; \ + const Py_UCS4 *end = to + length; \ + for (; to < end; ++to) *to = ch; \ break; \ } \ default: Py_UNREACHABLE(); \ @@ -10079,7 +10087,7 @@ _PyUnicode_FastFill(PyObject *unicode, Py_ssize_t start, Py_ssize_t length, Py_UCS4 fill_char) { const enum PyUnicode_Kind kind = PyUnicode_KIND(unicode); - const void *data = PyUnicode_DATA(unicode); + void *data = PyUnicode_DATA(unicode); assert(PyUnicode_IS_READY(unicode)); assert(unicode_modifiable(unicode)); assert(fill_char <= PyUnicode_MAX_CHAR_VALUE(unicode)); From webhook-mailer at python.org Tue Nov 27 06:42:28 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 27 Nov 2018 11:42:28 -0000 Subject: [Python-checkins] bpo-35134: Update "make tags": add Include/cpython/ (GH-10739) Message-ID: https://github.com/python/cpython/commit/480833808e918a1dcebbbcfd07d5a8de3c5c2a66 commit: 480833808e918a1dcebbbcfd07d5a8de3c5c2a66 branch: master author: Victor Stinner committer: GitHub date: 2018-11-27T12:42:25+01:00 summary: bpo-35134: Update "make tags": add Include/cpython/ (GH-10739) "make tags" and "make TAGS" now also parse Include/cpython/ header files. files: M Makefile.pre.in diff --git a/Makefile.pre.in b/Makefile.pre.in index 17007aef5623..eee64a75f785 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1667,7 +1667,7 @@ autoconf: # Create a tags file for vi tags:: - ctags -w $(srcdir)/Include/*.h $(srcdir)/Include/internal/*.h + ctags -w $(srcdir)/Include/*.h $(srcdir)/Include/cpython/*.h $(srcdir)/Include/internal/*.h for i in $(SRCDIRS); do ctags -f tags -w -a $(srcdir)/$$i/*.[ch]; done ctags -f tags -w -a $(srcdir)/Modules/_ctypes/*.[ch] LC_ALL=C sort -o tags tags @@ -1675,7 +1675,7 @@ tags:: # Create a tags file for GNU Emacs TAGS:: cd $(srcdir); \ - etags Include/*.h Include/internal/*.h; \ + etags Include/*.h Include/cpython/*.h Include/internal/*.h; \ for i in $(SRCDIRS); do etags -a $$i/*.[ch]; done # Sanitation targets -- clean leaves libraries, executables and tags From webhook-mailer at python.org Tue Nov 27 06:58:01 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 27 Nov 2018 11:58:01 -0000 Subject: [Python-checkins] bpo-35317: Fix mktime() error in test_email (GH-10721) Message-ID: https://github.com/python/cpython/commit/d669154ee52048f98ac63ba177f3fd1cf62f0174 commit: d669154ee52048f98ac63ba177f3fd1cf62f0174 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-27T03:57:56-08:00 summary: bpo-35317: Fix mktime() error in test_email (GH-10721) Fix mktime() overflow error in test_email: run test_localtime_daylight_true_dst_true() and test_localtime_daylight_false_dst_true() with a specific timezone. (cherry picked from commit cfaafda8e3e19764682abb4bd4c574accb784c42) Co-authored-by: Victor Stinner files: A Misc/NEWS.d/next/Tests/2018-11-26-16-54-21.bpo-35317.jByGP2.rst M Lib/test/test_email/test_utils.py diff --git a/Lib/test/test_email/test_utils.py b/Lib/test/test_email/test_utils.py index 6dcb3bbe7aab..4e3c3f3a195f 100644 --- a/Lib/test/test_email/test_utils.py +++ b/Lib/test/test_email/test_utils.py @@ -75,6 +75,7 @@ def test_localtime_daylight_false_dst_false(self): t2 = utils.localtime(t1) self.assertEqual(t1, t2) + @test.support.run_with_tz('Europe/Minsk') def test_localtime_daylight_true_dst_true(self): test.support.patch(self, time, 'daylight', True) t0 = datetime.datetime(2012, 3, 12, 1, 1) @@ -82,6 +83,7 @@ def test_localtime_daylight_true_dst_true(self): t2 = utils.localtime(t1) self.assertEqual(t1, t2) + @test.support.run_with_tz('Europe/Minsk') def test_localtime_daylight_false_dst_true(self): test.support.patch(self, time, 'daylight', False) t0 = datetime.datetime(2012, 3, 12, 1, 1) diff --git a/Misc/NEWS.d/next/Tests/2018-11-26-16-54-21.bpo-35317.jByGP2.rst b/Misc/NEWS.d/next/Tests/2018-11-26-16-54-21.bpo-35317.jByGP2.rst new file mode 100644 index 000000000000..73a30f71927f --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2018-11-26-16-54-21.bpo-35317.jByGP2.rst @@ -0,0 +1,3 @@ +Fix ``mktime()`` overflow error in ``test_email``: run +``test_localtime_daylight_true_dst_true()`` and +``test_localtime_daylight_false_dst_true()`` with a specific timezone. From webhook-mailer at python.org Tue Nov 27 07:01:04 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 27 Nov 2018 12:01:04 -0000 Subject: [Python-checkins] bpo-35317: Fix mktime() error in test_email (GH-10721) Message-ID: https://github.com/python/cpython/commit/b59fc311609aadaafaae68240127b4997b85859d commit: b59fc311609aadaafaae68240127b4997b85859d branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-27T04:01:00-08:00 summary: bpo-35317: Fix mktime() error in test_email (GH-10721) Fix mktime() overflow error in test_email: run test_localtime_daylight_true_dst_true() and test_localtime_daylight_false_dst_true() with a specific timezone. (cherry picked from commit cfaafda8e3e19764682abb4bd4c574accb784c42) Co-authored-by: Victor Stinner files: A Misc/NEWS.d/next/Tests/2018-11-26-16-54-21.bpo-35317.jByGP2.rst M Lib/test/test_email/test_utils.py diff --git a/Lib/test/test_email/test_utils.py b/Lib/test/test_email/test_utils.py index 6dcb3bbe7aab..4e3c3f3a195f 100644 --- a/Lib/test/test_email/test_utils.py +++ b/Lib/test/test_email/test_utils.py @@ -75,6 +75,7 @@ def test_localtime_daylight_false_dst_false(self): t2 = utils.localtime(t1) self.assertEqual(t1, t2) + @test.support.run_with_tz('Europe/Minsk') def test_localtime_daylight_true_dst_true(self): test.support.patch(self, time, 'daylight', True) t0 = datetime.datetime(2012, 3, 12, 1, 1) @@ -82,6 +83,7 @@ def test_localtime_daylight_true_dst_true(self): t2 = utils.localtime(t1) self.assertEqual(t1, t2) + @test.support.run_with_tz('Europe/Minsk') def test_localtime_daylight_false_dst_true(self): test.support.patch(self, time, 'daylight', False) t0 = datetime.datetime(2012, 3, 12, 1, 1) diff --git a/Misc/NEWS.d/next/Tests/2018-11-26-16-54-21.bpo-35317.jByGP2.rst b/Misc/NEWS.d/next/Tests/2018-11-26-16-54-21.bpo-35317.jByGP2.rst new file mode 100644 index 000000000000..73a30f71927f --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2018-11-26-16-54-21.bpo-35317.jByGP2.rst @@ -0,0 +1,3 @@ +Fix ``mktime()`` overflow error in ``test_email``: run +``test_localtime_daylight_true_dst_true()`` and +``test_localtime_daylight_false_dst_true()`` with a specific timezone. From webhook-mailer at python.org Tue Nov 27 08:31:01 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 27 Nov 2018 13:31:01 -0000 Subject: [Python-checkins] bpo-33954: Rewrite FILL() macro of unicodeobject.c (GH-10740) Message-ID: https://github.com/python/cpython/commit/54fa83e0a3f3b077763cb50705d7a7dbe4a40a4a commit: 54fa83e0a3f3b077763cb50705d7a7dbe4a40a4a branch: 3.6 author: Victor Stinner committer: GitHub date: 2018-11-27T14:30:55+01:00 summary: bpo-33954: Rewrite FILL() macro of unicodeobject.c (GH-10740) Copy code from master: add assertions on start and value, replace 'i' iterator with 'end' pointer for the loop stop condition. _PyUnicode_FastFill(): fix type of 'data', it must not be constant, since data is modified by FILL(). files: M Objects/unicodeobject.c diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 6bfcddaa64e4..29b019887ac0 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -205,22 +205,30 @@ static PyObject *unicode_empty = NULL; #define FILL(kind, data, value, start, length) \ do { \ - Py_ssize_t i_ = 0; \ + assert(0 <= start); \ assert(kind != PyUnicode_WCHAR_KIND); \ - switch ((kind)) { \ + switch (kind) { \ case PyUnicode_1BYTE_KIND: { \ - unsigned char * to_ = (unsigned char *)((data)) + (start); \ - memset(to_, (unsigned char)value, (length)); \ + assert(value <= 0xff); \ + Py_UCS1 ch = (unsigned char)value; \ + Py_UCS1 *to = (Py_UCS1 *)data + start; \ + memset(to, ch, length); \ break; \ } \ case PyUnicode_2BYTE_KIND: { \ - Py_UCS2 * to_ = (Py_UCS2 *)((data)) + (start); \ - for (; i_ < (length); ++i_, ++to_) *to_ = (value); \ + assert(value <= 0xffff); \ + Py_UCS2 ch = (Py_UCS2)value; \ + Py_UCS2 *to = (Py_UCS2 *)data + start; \ + const Py_UCS2 *end = to + length; \ + for (; to < end; ++to) *to = ch; \ break; \ } \ case PyUnicode_4BYTE_KIND: { \ - Py_UCS4 * to_ = (Py_UCS4 *)((data)) + (start); \ - for (; i_ < (length); ++i_, ++to_) *to_ = (value); \ + assert(value <= MAX_UNICODE); \ + Py_UCS4 ch = value; \ + Py_UCS4 * to = (Py_UCS4 *)data + start; \ + const Py_UCS4 *end = to + length; \ + for (; to < end; ++to) *to = ch; \ break; \ } \ default: assert(0); \ @@ -10262,7 +10270,7 @@ _PyUnicode_FastFill(PyObject *unicode, Py_ssize_t start, Py_ssize_t length, Py_UCS4 fill_char) { const enum PyUnicode_Kind kind = PyUnicode_KIND(unicode); - const void *data = PyUnicode_DATA(unicode); + void *data = PyUnicode_DATA(unicode); assert(PyUnicode_IS_READY(unicode)); assert(unicode_modifiable(unicode)); assert(fill_char <= PyUnicode_MAX_CHAR_VALUE(unicode)); From webhook-mailer at python.org Tue Nov 27 09:12:52 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 27 Nov 2018 14:12:52 -0000 Subject: [Python-checkins] bpo-34100: Partially revert merge_consts_recursive() (GH-10743) Message-ID: https://github.com/python/cpython/commit/1005c84535191a72ebb7587d8c5636a065b7ed79 commit: 1005c84535191a72ebb7587d8c5636a065b7ed79 branch: master author: Victor Stinner committer: GitHub date: 2018-11-27T15:12:47+01:00 summary: bpo-34100: Partially revert merge_consts_recursive() (GH-10743) Partically revert commit c2e1607a51d7a17f143b5a34e8cff7c6fc58a091 to fix a reference leak. 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 58bd9b5e4c7a..a086ef65b44a 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -615,16 +615,6 @@ def check_same_constant(const): self.check_constant(f1, Ellipsis) self.assertEqual(repr(f1()), repr(Ellipsis)) - # Merge constants in tuple or frozenset - # NOTE: frozenset can't reuse previous const, but frozenset - # item can be reused later. - f3 = lambda x: x in {("not a name",)} - f1, f2 = lambda: "not a name", lambda: ("not a name",) - self.assertIs(next(iter(f3.__code__.co_consts[1])), - f2.__code__.co_consts[1]) - self.assertIs(f1.__code__.co_consts[1], - f2.__code__.co_consts[1][0]) - # {0} is converted to a constant frozenset({0}) by the peephole # optimizer f1, f2 = lambda x: x in {0}, lambda x: x in {0} diff --git a/Python/compile.c b/Python/compile.c index acb5cfe29b42..7d51819e00f0 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -1240,56 +1240,6 @@ merge_consts_recursive(struct compiler *c, PyObject *o) Py_DECREF(u); } } - else if (PyFrozenSet_CheckExact(o)) { - // We register items in the frozenset, but don't rewrite - // the frozenset when the item is already registered - // because frozenset is rare and difficult. - - // *key* is tuple. And it's first item is frozenset of - // constant keys. - // See _PyCode_ConstantKey() for detail. - assert(PyTuple_CheckExact(key)); - assert(PyTuple_GET_SIZE(key) == 2); - - Py_ssize_t len = PySet_GET_SIZE(o); - if (len == 0) { - return key; - } - PyObject *tuple = PyTuple_New(len); - if (tuple == NULL) { - Py_DECREF(key); - return NULL; - } - Py_ssize_t i = 0, pos = 0; - PyObject *item; - Py_hash_t hash; - while (_PySet_NextEntry(o, &pos, &item, &hash)) { - PyObject *k = merge_consts_recursive(c, item); - if (k == NULL) { - Py_DECREF(tuple); - Py_DECREF(key); - return NULL; - } - PyObject *u; - if (PyTuple_CheckExact(k)) { - u = PyTuple_GET_ITEM(k, 1); - } - else { - u = k; - } - Py_INCREF(u); - PyTuple_SET_ITEM(tuple, i, u); - i++; - } - - PyObject *new = PyFrozenSet_New(tuple); - Py_DECREF(tuple); - if (new == NULL) { - Py_DECREF(key); - return NULL; - } - PyTuple_SET_ITEM(key, 1, new); - } return key; } From webhook-mailer at python.org Tue Nov 27 12:34:39 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Tue, 27 Nov 2018 17:34:39 -0000 Subject: [Python-checkins] bpo-33029: Fix signatures of getter and setter functions. (GH-10746) Message-ID: https://github.com/python/cpython/commit/d4f9cf5545d6d8844e0726552ef2e366f5cc3abd commit: d4f9cf5545d6d8844e0726552ef2e366f5cc3abd branch: master author: Serhiy Storchaka committer: GitHub date: 2018-11-27T19:34:35+02:00 summary: bpo-33029: Fix signatures of getter and setter functions. (GH-10746) Fix also return type for few other functions (clear, releasebuffer). files: M Modules/_asynciomodule.c M Modules/_collectionsmodule.c M Modules/_csv.c M Modules/_ctypes/_ctypes.c M Modules/_cursesmodule.c M Modules/_io/bytesio.c M Modules/_pickle.c M Modules/_sqlite/connection.c M Modules/_sqlite/row.c M Modules/_sre.c M Modules/_testbuffer.c M Modules/_tkinter.c M Modules/cjkcodecs/multibytecodec.c M Modules/mmapmodule.c M Modules/selectmodule.c M Modules/xxsubtype.c M Objects/cellobject.c M Objects/descrobject.c M Objects/exceptions.c M Objects/frameobject.c M Objects/funcobject.c M Objects/genobject.c M Objects/memoryobject.c M Python/context.c M Python/traceback.c diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c index 88986718905e..0998cc103880 100644 --- a/Modules/_asynciomodule.c +++ b/Modules/_asynciomodule.c @@ -1097,7 +1097,7 @@ _asyncio_Future_get_loop_impl(FutureObj *self) } static PyObject * -FutureObj_get_blocking(FutureObj *fut) +FutureObj_get_blocking(FutureObj *fut, void *Py_UNUSED(ignored)) { if (future_is_alive(fut) && fut->fut_blocking) { Py_RETURN_TRUE; @@ -1108,7 +1108,7 @@ FutureObj_get_blocking(FutureObj *fut) } static int -FutureObj_set_blocking(FutureObj *fut, PyObject *val) +FutureObj_set_blocking(FutureObj *fut, PyObject *val, void *Py_UNUSED(ignored)) { if (future_ensure_alive(fut)) { return -1; @@ -1123,7 +1123,7 @@ FutureObj_set_blocking(FutureObj *fut, PyObject *val) } static PyObject * -FutureObj_get_log_traceback(FutureObj *fut) +FutureObj_get_log_traceback(FutureObj *fut, void *Py_UNUSED(ignored)) { ENSURE_FUTURE_ALIVE(fut) if (fut->fut_log_tb) { @@ -1135,7 +1135,7 @@ FutureObj_get_log_traceback(FutureObj *fut) } static int -FutureObj_set_log_traceback(FutureObj *fut, PyObject *val) +FutureObj_set_log_traceback(FutureObj *fut, PyObject *val, void *Py_UNUSED(ignored)) { int is_true = PyObject_IsTrue(val); if (is_true < 0) { @@ -1151,7 +1151,7 @@ FutureObj_set_log_traceback(FutureObj *fut, PyObject *val) } static PyObject * -FutureObj_get_loop(FutureObj *fut) +FutureObj_get_loop(FutureObj *fut, void *Py_UNUSED(ignored)) { if (!future_is_alive(fut)) { Py_RETURN_NONE; @@ -1161,7 +1161,7 @@ FutureObj_get_loop(FutureObj *fut) } static PyObject * -FutureObj_get_callbacks(FutureObj *fut) +FutureObj_get_callbacks(FutureObj *fut, void *Py_UNUSED(ignored)) { Py_ssize_t i; @@ -1213,7 +1213,7 @@ FutureObj_get_callbacks(FutureObj *fut) } static PyObject * -FutureObj_get_result(FutureObj *fut) +FutureObj_get_result(FutureObj *fut, void *Py_UNUSED(ignored)) { ENSURE_FUTURE_ALIVE(fut) if (fut->fut_result == NULL) { @@ -1224,7 +1224,7 @@ FutureObj_get_result(FutureObj *fut) } static PyObject * -FutureObj_get_exception(FutureObj *fut) +FutureObj_get_exception(FutureObj *fut, void *Py_UNUSED(ignored)) { ENSURE_FUTURE_ALIVE(fut) if (fut->fut_exception == NULL) { @@ -1235,7 +1235,7 @@ FutureObj_get_exception(FutureObj *fut) } static PyObject * -FutureObj_get_source_traceback(FutureObj *fut) +FutureObj_get_source_traceback(FutureObj *fut, void *Py_UNUSED(ignored)) { if (!future_is_alive(fut) || fut->fut_source_tb == NULL) { Py_RETURN_NONE; @@ -1245,7 +1245,7 @@ FutureObj_get_source_traceback(FutureObj *fut) } static PyObject * -FutureObj_get_state(FutureObj *fut) +FutureObj_get_state(FutureObj *fut, void *Py_UNUSED(ignored)) { _Py_IDENTIFIER(PENDING); _Py_IDENTIFIER(CANCELLED); @@ -1714,7 +1714,7 @@ TaskStepMethWrapper_traverse(TaskStepMethWrapper *o, } static PyObject * -TaskStepMethWrapper_get___self__(TaskStepMethWrapper *o) +TaskStepMethWrapper_get___self__(TaskStepMethWrapper *o, void *Py_UNUSED(ignored)) { if (o->sw_task) { Py_INCREF(o->sw_task); @@ -2002,7 +2002,7 @@ TaskObj_traverse(TaskObj *task, visitproc visit, void *arg) } static PyObject * -TaskObj_get_log_destroy_pending(TaskObj *task) +TaskObj_get_log_destroy_pending(TaskObj *task, void *Py_UNUSED(ignored)) { if (task->task_log_destroy_pending) { Py_RETURN_TRUE; @@ -2013,7 +2013,7 @@ TaskObj_get_log_destroy_pending(TaskObj *task) } static int -TaskObj_set_log_destroy_pending(TaskObj *task, PyObject *val) +TaskObj_set_log_destroy_pending(TaskObj *task, PyObject *val, void *Py_UNUSED(ignored)) { int is_true = PyObject_IsTrue(val); if (is_true < 0) { @@ -2024,7 +2024,7 @@ TaskObj_set_log_destroy_pending(TaskObj *task, PyObject *val) } static PyObject * -TaskObj_get_must_cancel(TaskObj *task) +TaskObj_get_must_cancel(TaskObj *task, void *Py_UNUSED(ignored)) { if (task->task_must_cancel) { Py_RETURN_TRUE; @@ -2035,7 +2035,7 @@ TaskObj_get_must_cancel(TaskObj *task) } static PyObject * -TaskObj_get_coro(TaskObj *task) +TaskObj_get_coro(TaskObj *task, void *Py_UNUSED(ignored)) { if (task->task_coro) { Py_INCREF(task->task_coro); @@ -2046,7 +2046,7 @@ TaskObj_get_coro(TaskObj *task) } static PyObject * -TaskObj_get_fut_waiter(TaskObj *task) +TaskObj_get_fut_waiter(TaskObj *task, void *Py_UNUSED(ignored)) { if (task->task_fut_waiter) { Py_INCREF(task->task_fut_waiter); diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c index 1ad4a03467c2..4da0662f0c7f 100644 --- a/Modules/_collectionsmodule.c +++ b/Modules/_collectionsmodule.c @@ -1508,7 +1508,7 @@ deque_bool(dequeobject *deque) } static PyObject * -deque_get_maxlen(dequeobject *deque) +deque_get_maxlen(dequeobject *deque, void *Py_UNUSED(ignored)) { if (deque->maxlen < 0) Py_RETURN_NONE; diff --git a/Modules/_csv.c b/Modules/_csv.c index b4e92de27a97..6c009749b058 100644 --- a/Modules/_csv.c +++ b/Modules/_csv.c @@ -160,31 +160,31 @@ get_nullchar_as_None(Py_UCS4 c) } static PyObject * -Dialect_get_lineterminator(DialectObj *self) +Dialect_get_lineterminator(DialectObj *self, void *Py_UNUSED(ignored)) { return get_string(self->lineterminator); } static PyObject * -Dialect_get_delimiter(DialectObj *self) +Dialect_get_delimiter(DialectObj *self, void *Py_UNUSED(ignored)) { return get_nullchar_as_None(self->delimiter); } static PyObject * -Dialect_get_escapechar(DialectObj *self) +Dialect_get_escapechar(DialectObj *self, void *Py_UNUSED(ignored)) { return get_nullchar_as_None(self->escapechar); } static PyObject * -Dialect_get_quotechar(DialectObj *self) +Dialect_get_quotechar(DialectObj *self, void *Py_UNUSED(ignored)) { return get_nullchar_as_None(self->quotechar); } static PyObject * -Dialect_get_quoting(DialectObj *self) +Dialect_get_quoting(DialectObj *self, void *Py_UNUSED(ignored)) { return PyLong_FromLong(self->quoting); } diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index 60f6985a6646..36ef5d9b67fc 100644 --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -1161,7 +1161,7 @@ PyTypeObject PyCPointerType_Type = { */ static int -CharArray_set_raw(CDataObject *self, PyObject *value) +CharArray_set_raw(CDataObject *self, PyObject *value, void *Py_UNUSED(ignored)) { char *ptr; Py_ssize_t size; @@ -1187,13 +1187,13 @@ CharArray_set_raw(CDataObject *self, PyObject *value) } static PyObject * -CharArray_get_raw(CDataObject *self) +CharArray_get_raw(CDataObject *self, void *Py_UNUSED(ignored)) { return PyBytes_FromStringAndSize(self->b_ptr, self->b_size); } static PyObject * -CharArray_get_value(CDataObject *self) +CharArray_get_value(CDataObject *self, void *Py_UNUSED(ignored)) { Py_ssize_t i; char *ptr = self->b_ptr; @@ -1204,7 +1204,7 @@ CharArray_get_value(CDataObject *self) } static int -CharArray_set_value(CDataObject *self, PyObject *value) +CharArray_set_value(CDataObject *self, PyObject *value, void *Py_UNUSED(ignored)) { char *ptr; Py_ssize_t size; @@ -1249,7 +1249,7 @@ static PyGetSetDef CharArray_getsets[] = { #ifdef CTYPES_UNICODE static PyObject * -WCharArray_get_value(CDataObject *self) +WCharArray_get_value(CDataObject *self, void *Py_UNUSED(ignored)) { Py_ssize_t i; wchar_t *ptr = (wchar_t *)self->b_ptr; @@ -1260,7 +1260,7 @@ WCharArray_get_value(CDataObject *self) } static int -WCharArray_set_value(CDataObject *self, PyObject *value) +WCharArray_set_value(CDataObject *self, PyObject *value, void *Py_UNUSED(ignored)) { Py_ssize_t result = 0; Py_UNICODE *wstr; @@ -3060,7 +3060,7 @@ GenericPyCData_new(PyTypeObject *type, PyObject *args, PyObject *kwds) */ static int -PyCFuncPtr_set_errcheck(PyCFuncPtrObject *self, PyObject *ob) +PyCFuncPtr_set_errcheck(PyCFuncPtrObject *self, PyObject *ob, void *Py_UNUSED(ignored)) { if (ob && !PyCallable_Check(ob)) { PyErr_SetString(PyExc_TypeError, @@ -3073,7 +3073,7 @@ PyCFuncPtr_set_errcheck(PyCFuncPtrObject *self, PyObject *ob) } static PyObject * -PyCFuncPtr_get_errcheck(PyCFuncPtrObject *self) +PyCFuncPtr_get_errcheck(PyCFuncPtrObject *self, void *Py_UNUSED(ignored)) { if (self->errcheck) { Py_INCREF(self->errcheck); @@ -3083,7 +3083,7 @@ PyCFuncPtr_get_errcheck(PyCFuncPtrObject *self) } static int -PyCFuncPtr_set_restype(PyCFuncPtrObject *self, PyObject *ob) +PyCFuncPtr_set_restype(PyCFuncPtrObject *self, PyObject *ob, void *Py_UNUSED(ignored)) { if (ob == NULL) { Py_CLEAR(self->restype); @@ -3104,7 +3104,7 @@ PyCFuncPtr_set_restype(PyCFuncPtrObject *self, PyObject *ob) } static PyObject * -PyCFuncPtr_get_restype(PyCFuncPtrObject *self) +PyCFuncPtr_get_restype(PyCFuncPtrObject *self, void *Py_UNUSED(ignored)) { StgDictObject *dict; if (self->restype) { @@ -3122,7 +3122,7 @@ PyCFuncPtr_get_restype(PyCFuncPtrObject *self) } static int -PyCFuncPtr_set_argtypes(PyCFuncPtrObject *self, PyObject *ob) +PyCFuncPtr_set_argtypes(PyCFuncPtrObject *self, PyObject *ob, void *Py_UNUSED(ignored)) { PyObject *converters; @@ -3141,7 +3141,7 @@ PyCFuncPtr_set_argtypes(PyCFuncPtrObject *self, PyObject *ob) } static PyObject * -PyCFuncPtr_get_argtypes(PyCFuncPtrObject *self) +PyCFuncPtr_get_argtypes(PyCFuncPtrObject *self, void *Py_UNUSED(ignored)) { StgDictObject *dict; if (self->argtypes) { @@ -4685,7 +4685,7 @@ PyCArrayType_from_ctype(PyObject *itemtype, Py_ssize_t length) */ static int -Simple_set_value(CDataObject *self, PyObject *value) +Simple_set_value(CDataObject *self, PyObject *value, void *Py_UNUSED(ignored)) { PyObject *result; StgDictObject *dict = PyObject_stgdict((PyObject *)self); @@ -4712,12 +4712,12 @@ Simple_init(CDataObject *self, PyObject *args, PyObject *kw) if (!PyArg_UnpackTuple(args, "__init__", 0, 1, &value)) return -1; if (value) - return Simple_set_value(self, value); + return Simple_set_value(self, value, NULL); return 0; } static PyObject * -Simple_get_value(CDataObject *self) +Simple_get_value(CDataObject *self, void *Py_UNUSED(ignored)) { StgDictObject *dict; dict = PyObject_stgdict((PyObject *)self); @@ -4740,7 +4740,7 @@ Simple_from_outparm(PyObject *self, PyObject *args) return self; } /* call stgdict->getfunc */ - return Simple_get_value((CDataObject *)self); + return Simple_get_value((CDataObject *)self, NULL); } static PyMethodDef Simple_methods[] = { @@ -4777,7 +4777,7 @@ Simple_repr(CDataObject *self) Py_TYPE(self)->tp_name, self); } - val = Simple_get_value(self); + val = Simple_get_value(self, NULL); if (val == NULL) return NULL; diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index cd3241208a27..9a1d2efd256e 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -2288,7 +2288,7 @@ PyCursesWindow_get_encoding(PyCursesWindowObject *self, void *closure) } static int -PyCursesWindow_set_encoding(PyCursesWindowObject *self, PyObject *value) +PyCursesWindow_set_encoding(PyCursesWindowObject *self, PyObject *value, void *Py_UNUSED(ignored)) { PyObject *ascii; char *encoding; diff --git a/Modules/_io/bytesio.c b/Modules/_io/bytesio.c index 8e54ec8e99c3..55e34c677670 100644 --- a/Modules/_io/bytesio.c +++ b/Modules/_io/bytesio.c @@ -202,7 +202,7 @@ write_bytes(bytesio *self, const char *bytes, Py_ssize_t len) } static PyObject * -bytesio_get_closed(bytesio *self) +bytesio_get_closed(bytesio *self, void *Py_UNUSED(ignored)) { if (self->buf == NULL) { Py_RETURN_TRUE; diff --git a/Modules/_pickle.c b/Modules/_pickle.c index 3a7700553397..39f8b750ed64 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -4561,13 +4561,13 @@ PicklerMemoProxy_New(PicklerObject *pickler) /*****************************************************************************/ static PyObject * -Pickler_get_memo(PicklerObject *self) +Pickler_get_memo(PicklerObject *self, void *Py_UNUSED(ignored)) { return PicklerMemoProxy_New(self); } static int -Pickler_set_memo(PicklerObject *self, PyObject *obj) +Pickler_set_memo(PicklerObject *self, PyObject *obj, void *Py_UNUSED(ignored)) { PyMemoTable *new_memo = NULL; @@ -4629,7 +4629,7 @@ Pickler_set_memo(PicklerObject *self, PyObject *obj) } static PyObject * -Pickler_get_persid(PicklerObject *self) +Pickler_get_persid(PicklerObject *self, void *Py_UNUSED(ignored)) { if (self->pers_func == NULL) { PyErr_SetString(PyExc_AttributeError, "persistent_id"); @@ -4639,7 +4639,7 @@ Pickler_get_persid(PicklerObject *self) } static int -Pickler_set_persid(PicklerObject *self, PyObject *value) +Pickler_set_persid(PicklerObject *self, PyObject *value, void *Py_UNUSED(ignored)) { if (value == NULL) { PyErr_SetString(PyExc_TypeError, @@ -6999,13 +6999,13 @@ UnpicklerMemoProxy_New(UnpicklerObject *unpickler) static PyObject * -Unpickler_get_memo(UnpicklerObject *self) +Unpickler_get_memo(UnpicklerObject *self, void *Py_UNUSED(ignored)) { return UnpicklerMemoProxy_New(self); } static int -Unpickler_set_memo(UnpicklerObject *self, PyObject *obj) +Unpickler_set_memo(UnpicklerObject *self, PyObject *obj, void *Py_UNUSED(ignored)) { PyObject **new_memo; size_t new_memo_size = 0; @@ -7082,7 +7082,7 @@ Unpickler_set_memo(UnpicklerObject *self, PyObject *obj) } static PyObject * -Unpickler_get_persload(UnpicklerObject *self) +Unpickler_get_persload(UnpicklerObject *self, void *Py_UNUSED(ignored)) { if (self->pers_func == NULL) { PyErr_SetString(PyExc_AttributeError, "persistent_load"); @@ -7092,7 +7092,7 @@ Unpickler_get_persload(UnpicklerObject *self) } static int -Unpickler_set_persload(UnpicklerObject *self, PyObject *value) +Unpickler_set_persload(UnpicklerObject *self, PyObject *value, void *Py_UNUSED(ignored)) { if (value == NULL) { PyErr_SetString(PyExc_TypeError, diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c index 65e8df4f7c61..b59d7d28cfd5 100644 --- a/Modules/_sqlite/connection.c +++ b/Modules/_sqlite/connection.c @@ -55,7 +55,7 @@ static const char * const begin_statements[] = { NULL }; -static int pysqlite_connection_set_isolation_level(pysqlite_Connection* self, PyObject* isolation_level); +static int pysqlite_connection_set_isolation_level(pysqlite_Connection* self, PyObject* isolation_level, void *Py_UNUSED(ignored)); static void _pysqlite_drop_unused_cursor_references(pysqlite_Connection* self); @@ -147,7 +147,7 @@ int pysqlite_connection_init(pysqlite_Connection* self, PyObject* args, PyObject Py_INCREF(isolation_level); } Py_CLEAR(self->isolation_level); - if (pysqlite_connection_set_isolation_level(self, isolation_level) < 0) { + if (pysqlite_connection_set_isolation_level(self, isolation_level, NULL) < 0) { Py_DECREF(isolation_level); return -1; } @@ -1163,7 +1163,8 @@ static PyObject* pysqlite_connection_get_in_transaction(pysqlite_Connection* sel Py_RETURN_FALSE; } -static int pysqlite_connection_set_isolation_level(pysqlite_Connection* self, PyObject* isolation_level) +static int +pysqlite_connection_set_isolation_level(pysqlite_Connection* self, PyObject* isolation_level, void *Py_UNUSED(ignored)) { if (isolation_level == Py_None) { PyObject *res = pysqlite_connection_commit(self, NULL); diff --git a/Modules/_sqlite/row.c b/Modules/_sqlite/row.c index 2fc26a8822dc..3cfbeeb93bba 100644 --- a/Modules/_sqlite/row.c +++ b/Modules/_sqlite/row.c @@ -150,7 +150,8 @@ PyObject* pysqlite_row_subscript(pysqlite_Row* self, PyObject* idx) } } -Py_ssize_t pysqlite_row_length(pysqlite_Row* self, PyObject* args, PyObject* kwargs) +static Py_ssize_t +pysqlite_row_length(pysqlite_Row* self) { return PyTuple_GET_SIZE(self->data); } diff --git a/Modules/_sre.c b/Modules/_sre.c index c3509796f3a1..75f030cfaa8f 100644 --- a/Modules/_sre.c +++ b/Modules/_sre.c @@ -1305,7 +1305,7 @@ PyDoc_STRVAR(pattern_doc, "Compiled regular expression object."); /* PatternObject's 'groupindex' method. */ static PyObject * -pattern_groupindex(PatternObject *self) +pattern_groupindex(PatternObject *self, void *Py_UNUSED(ignored)) { if (self->groupindex == NULL) return PyDict_New(); @@ -2272,7 +2272,7 @@ PyDoc_STRVAR(match_group_doc, For 0 returns the entire match."); static PyObject * -match_lastindex_get(MatchObject *self) +match_lastindex_get(MatchObject *self, void *Py_UNUSED(ignored)) { if (self->lastindex >= 0) return PyLong_FromSsize_t(self->lastindex); @@ -2280,7 +2280,7 @@ match_lastindex_get(MatchObject *self) } static PyObject * -match_lastgroup_get(MatchObject *self) +match_lastgroup_get(MatchObject *self, void *Py_UNUSED(ignored)) { if (self->pattern->indexgroup && self->lastindex >= 0 && @@ -2295,7 +2295,7 @@ match_lastgroup_get(MatchObject *self) } static PyObject * -match_regs_get(MatchObject *self) +match_regs_get(MatchObject *self, void *Py_UNUSED(ignored)) { if (self->regs) { Py_INCREF(self->regs); diff --git a/Modules/_testbuffer.c b/Modules/_testbuffer.c index 4ff44f91a6ab..9d7b3e8b0b3f 100644 --- a/Modules/_testbuffer.c +++ b/Modules/_testbuffer.c @@ -1531,7 +1531,7 @@ ndarray_getbuf(NDArrayObject *self, Py_buffer *view, int flags) return 0; } -static int +static void ndarray_releasebuf(NDArrayObject *self, Py_buffer *view) { if (!ND_IS_CONSUMER(self)) { @@ -1539,8 +1539,6 @@ ndarray_releasebuf(NDArrayObject *self, Py_buffer *view) if (--ndbuf->exports == 0 && ndbuf != self->head) ndbuf_delete(self, ndbuf); } - - return 0; } static PyBufferProcs ndarray_as_buffer = { diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index fa268599876a..a96924c9c6e7 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -842,7 +842,7 @@ PyTclObject_string(PyTclObject *self, void *ignored) } static PyObject * -PyTclObject_str(PyTclObject *self, void *ignored) +PyTclObject_str(PyTclObject *self) { if (self->string) { Py_INCREF(self->string); @@ -855,7 +855,7 @@ PyTclObject_str(PyTclObject *self, void *ignored) static PyObject * PyTclObject_repr(PyTclObject *self) { - PyObject *repr, *str = PyTclObject_str(self, NULL); + PyObject *repr, *str = PyTclObject_str(self); if (str == NULL) return NULL; repr = PyUnicode_FromFormat("<%s object: %R>", diff --git a/Modules/cjkcodecs/multibytecodec.c b/Modules/cjkcodecs/multibytecodec.c index 8a0ac870f15e..938a774f05cb 100644 --- a/Modules/cjkcodecs/multibytecodec.c +++ b/Modules/cjkcodecs/multibytecodec.c @@ -108,7 +108,7 @@ call_error_callback(PyObject *errors, PyObject *exc) } static PyObject * -codecctx_errors_get(MultibyteStatefulCodecContext *self) +codecctx_errors_get(MultibyteStatefulCodecContext *self, void *Py_UNUSED(ignored)) { const char *errors; diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c index 86632358b7fc..f4caf8799f10 100644 --- a/Modules/mmapmodule.c +++ b/Modules/mmapmodule.c @@ -656,7 +656,7 @@ mmap_move_method(mmap_object *self, PyObject *args) } static PyObject * -mmap_closed_get(mmap_object *self) +mmap_closed_get(mmap_object *self, void *Py_UNUSED(ignored)) { #ifdef MS_WINDOWS return PyBool_FromLong(self->map_handle == NULL ? 1 : 0); diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c index d86727a8978d..5a6b13466c80 100644 --- a/Modules/selectmodule.c +++ b/Modules/selectmodule.c @@ -1031,7 +1031,7 @@ select_devpoll_close_impl(devpollObject *self) } static PyObject* -devpoll_get_closed(devpollObject *self) +devpoll_get_closed(devpollObject *self, void *Py_UNUSED(ignored)) { if (self->fd_devpoll < 0) Py_RETURN_TRUE; @@ -1333,7 +1333,7 @@ select_epoll_close_impl(pyEpoll_Object *self) static PyObject* -pyepoll_get_closed(pyEpoll_Object *self) +pyepoll_get_closed(pyEpoll_Object *self, void *Py_UNUSED(ignored)) { if (self->epfd < 0) Py_RETURN_TRUE; @@ -1979,7 +1979,7 @@ select_kqueue_close_impl(kqueue_queue_Object *self) } static PyObject* -kqueue_queue_get_closed(kqueue_queue_Object *self) +kqueue_queue_get_closed(kqueue_queue_Object *self, void *Py_UNUSED(ignored)) { if (self->kqfd < 0) Py_RETURN_TRUE; diff --git a/Modules/xxsubtype.c b/Modules/xxsubtype.c index d9cb4cdb902f..bacbdf153618 100644 --- a/Modules/xxsubtype.c +++ b/Modules/xxsubtype.c @@ -89,7 +89,7 @@ spamlist_init(spamlistobject *self, PyObject *args, PyObject *kwds) } static PyObject * -spamlist_state_get(spamlistobject *self) +spamlist_state_get(spamlistobject *self, void *Py_UNUSED(ignored)) { return PyLong_FromLong(self->state); } diff --git a/Objects/cellobject.c b/Objects/cellobject.c index 6b7136c41270..86bebb9604a5 100644 --- a/Objects/cellobject.c +++ b/Objects/cellobject.c @@ -112,7 +112,7 @@ cell_get_contents(PyCellObject *op, void *closure) } static int -cell_set_contents(PyCellObject *op, PyObject *obj) +cell_set_contents(PyCellObject *op, PyObject *obj, void *Py_UNUSED(ignored)) { Py_XINCREF(obj); Py_XSETREF(op->ob_ref, obj); diff --git a/Objects/descrobject.c b/Objects/descrobject.c index 23d4b1a29e6f..d8dbfa9a4792 100644 --- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -441,7 +441,7 @@ calculate_qualname(PyDescrObject *descr) } static PyObject * -descr_get_qualname(PyDescrObject *descr) +descr_get_qualname(PyDescrObject *descr, void *Py_UNUSED(ignored)) { if (descr->d_qualname == NULL) descr->d_qualname = calculate_qualname(descr); @@ -1107,7 +1107,7 @@ static PyMemberDef wrapper_members[] = { }; static PyObject * -wrapper_objclass(wrapperobject *wp) +wrapper_objclass(wrapperobject *wp, void *Py_UNUSED(ignored)) { PyObject *c = (PyObject *)PyDescr_TYPE(wp->descr); @@ -1116,7 +1116,7 @@ wrapper_objclass(wrapperobject *wp) } static PyObject * -wrapper_name(wrapperobject *wp) +wrapper_name(wrapperobject *wp, void *Py_UNUSED(ignored)) { const char *s = wp->descr->d_base->name; @@ -1124,21 +1124,21 @@ wrapper_name(wrapperobject *wp) } static PyObject * -wrapper_doc(wrapperobject *wp, void *closure) +wrapper_doc(wrapperobject *wp, void *Py_UNUSED(ignored)) { return _PyType_GetDocFromInternalDoc(wp->descr->d_base->name, wp->descr->d_base->doc); } static PyObject * -wrapper_text_signature(wrapperobject *wp, void *closure) +wrapper_text_signature(wrapperobject *wp, void *Py_UNUSED(ignored)) { return _PyType_GetTextSignatureFromInternalDoc(wp->descr->d_base->name, wp->descr->d_base->doc); } static PyObject * -wrapper_qualname(wrapperobject *wp) +wrapper_qualname(wrapperobject *wp, void *Py_UNUSED(ignored)) { - return descr_get_qualname((PyDescrObject *)wp->descr); + return descr_get_qualname((PyDescrObject *)wp->descr, NULL); } static PyGetSetDef wrapper_getsets[] = { diff --git a/Objects/exceptions.c b/Objects/exceptions.c index cecbf977a327..05578d4a6aad 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -182,7 +182,7 @@ static PyMethodDef BaseException_methods[] = { }; static PyObject * -BaseException_get_args(PyBaseExceptionObject *self) +BaseException_get_args(PyBaseExceptionObject *self, void *Py_UNUSED(ignored)) { if (self->args == NULL) { Py_RETURN_NONE; @@ -192,7 +192,7 @@ BaseException_get_args(PyBaseExceptionObject *self) } static int -BaseException_set_args(PyBaseExceptionObject *self, PyObject *val) +BaseException_set_args(PyBaseExceptionObject *self, PyObject *val, void *Py_UNUSED(ignored)) { PyObject *seq; if (val == NULL) { @@ -207,7 +207,7 @@ BaseException_set_args(PyBaseExceptionObject *self, PyObject *val) } static PyObject * -BaseException_get_tb(PyBaseExceptionObject *self) +BaseException_get_tb(PyBaseExceptionObject *self, void *Py_UNUSED(ignored)) { if (self->traceback == NULL) { Py_RETURN_NONE; @@ -217,7 +217,7 @@ BaseException_get_tb(PyBaseExceptionObject *self) } static int -BaseException_set_tb(PyBaseExceptionObject *self, PyObject *tb) +BaseException_set_tb(PyBaseExceptionObject *self, PyObject *tb, void *Py_UNUSED(ignored)) { if (tb == NULL) { PyErr_SetString(PyExc_TypeError, "__traceback__ may not be deleted"); @@ -235,7 +235,8 @@ BaseException_set_tb(PyBaseExceptionObject *self, PyObject *tb) } static PyObject * -BaseException_get_context(PyObject *self) { +BaseException_get_context(PyObject *self, void *Py_UNUSED(ignored)) +{ PyObject *res = PyException_GetContext(self); if (res) return res; /* new reference already returned above */ @@ -243,7 +244,8 @@ BaseException_get_context(PyObject *self) { } static int -BaseException_set_context(PyObject *self, PyObject *arg) { +BaseException_set_context(PyObject *self, PyObject *arg, void *Py_UNUSED(ignored)) +{ if (arg == NULL) { PyErr_SetString(PyExc_TypeError, "__context__ may not be deleted"); return -1; @@ -262,7 +264,8 @@ BaseException_set_context(PyObject *self, PyObject *arg) { } static PyObject * -BaseException_get_cause(PyObject *self) { +BaseException_get_cause(PyObject *self, void *Py_UNUSED(ignored)) +{ PyObject *res = PyException_GetCause(self); if (res) return res; /* new reference already returned above */ @@ -270,7 +273,8 @@ BaseException_get_cause(PyObject *self) { } static int -BaseException_set_cause(PyObject *self, PyObject *arg) { +BaseException_set_cause(PyObject *self, PyObject *arg, void *Py_UNUSED(ignored)) +{ if (arg == NULL) { PyErr_SetString(PyExc_TypeError, "__cause__ may not be deleted"); return -1; @@ -293,10 +297,10 @@ static PyGetSetDef BaseException_getset[] = { {"__dict__", PyObject_GenericGetDict, PyObject_GenericSetDict}, {"args", (getter)BaseException_get_args, (setter)BaseException_set_args}, {"__traceback__", (getter)BaseException_get_tb, (setter)BaseException_set_tb}, - {"__context__", (getter)BaseException_get_context, - (setter)BaseException_set_context, PyDoc_STR("exception context")}, - {"__cause__", (getter)BaseException_get_cause, - (setter)BaseException_set_cause, PyDoc_STR("exception cause")}, + {"__context__", BaseException_get_context, + BaseException_set_context, PyDoc_STR("exception context")}, + {"__cause__", BaseException_get_cause, + BaseException_set_cause, PyDoc_STR("exception cause")}, {NULL}, }; @@ -311,7 +315,7 @@ PyException_GetTraceback(PyObject *self) { int PyException_SetTraceback(PyObject *self, PyObject *tb) { - return BaseException_set_tb((PyBaseExceptionObject *)self, tb); + return BaseException_set_tb((PyBaseExceptionObject *)self, tb, NULL); } PyObject * diff --git a/Objects/frameobject.c b/Objects/frameobject.c index b1a83d82a398..400f99f6c963 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -87,7 +87,7 @@ get_arg(const _Py_CODEUNIT *codestr, Py_ssize_t i) * that time. */ static int -frame_setlineno(PyFrameObject *f, PyObject* p_new_lineno) +frame_setlineno(PyFrameObject *f, PyObject* p_new_lineno, void *Py_UNUSED(ignored)) { int new_lineno = 0; /* The new value of f_lineno */ long l_new_lineno; @@ -470,7 +470,7 @@ frame_traverse(PyFrameObject *f, visitproc visit, void *arg) return 0; } -static void +static int frame_tp_clear(PyFrameObject *f) { PyObject **fastlocals, **p, **oldtop; @@ -498,6 +498,7 @@ frame_tp_clear(PyFrameObject *f) for (p = f->f_valuestack; p < oldtop; p++) Py_CLEAR(*p); } + return 0; } static PyObject * @@ -512,7 +513,7 @@ frame_clear(PyFrameObject *f, PyObject *Py_UNUSED(ignored)) _PyGen_Finalize(f->f_gen); assert(f->f_gen == NULL); } - frame_tp_clear(f); + (void)frame_tp_clear(f); Py_RETURN_NONE; } diff --git a/Objects/funcobject.c b/Objects/funcobject.c index c77e4e9f4e89..2add874fced6 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c @@ -244,14 +244,14 @@ static PyMemberDef func_memberlist[] = { }; static PyObject * -func_get_code(PyFunctionObject *op) +func_get_code(PyFunctionObject *op, void *Py_UNUSED(ignored)) { Py_INCREF(op->func_code); return op->func_code; } static int -func_set_code(PyFunctionObject *op, PyObject *value) +func_set_code(PyFunctionObject *op, PyObject *value, void *Py_UNUSED(ignored)) { Py_ssize_t nfree, nclosure; @@ -279,14 +279,14 @@ func_set_code(PyFunctionObject *op, PyObject *value) } static PyObject * -func_get_name(PyFunctionObject *op) +func_get_name(PyFunctionObject *op, void *Py_UNUSED(ignored)) { Py_INCREF(op->func_name); return op->func_name; } static int -func_set_name(PyFunctionObject *op, PyObject *value) +func_set_name(PyFunctionObject *op, PyObject *value, void *Py_UNUSED(ignored)) { /* Not legal to del f.func_name or to set it to anything * other than a string object. */ @@ -301,14 +301,14 @@ func_set_name(PyFunctionObject *op, PyObject *value) } static PyObject * -func_get_qualname(PyFunctionObject *op) +func_get_qualname(PyFunctionObject *op, void *Py_UNUSED(ignored)) { Py_INCREF(op->func_qualname); return op->func_qualname; } static int -func_set_qualname(PyFunctionObject *op, PyObject *value) +func_set_qualname(PyFunctionObject *op, PyObject *value, void *Py_UNUSED(ignored)) { /* Not legal to del f.__qualname__ or to set it to anything * other than a string object. */ @@ -323,7 +323,7 @@ func_set_qualname(PyFunctionObject *op, PyObject *value) } static PyObject * -func_get_defaults(PyFunctionObject *op) +func_get_defaults(PyFunctionObject *op, void *Py_UNUSED(ignored)) { if (op->func_defaults == NULL) { Py_RETURN_NONE; @@ -333,7 +333,7 @@ func_get_defaults(PyFunctionObject *op) } static int -func_set_defaults(PyFunctionObject *op, PyObject *value) +func_set_defaults(PyFunctionObject *op, PyObject *value, void *Py_UNUSED(ignored)) { /* Legal to del f.func_defaults. * Can only set func_defaults to NULL or a tuple. */ @@ -350,7 +350,7 @@ func_set_defaults(PyFunctionObject *op, PyObject *value) } static PyObject * -func_get_kwdefaults(PyFunctionObject *op) +func_get_kwdefaults(PyFunctionObject *op, void *Py_UNUSED(ignored)) { if (op->func_kwdefaults == NULL) { Py_RETURN_NONE; @@ -360,7 +360,7 @@ func_get_kwdefaults(PyFunctionObject *op) } static int -func_set_kwdefaults(PyFunctionObject *op, PyObject *value) +func_set_kwdefaults(PyFunctionObject *op, PyObject *value, void *Py_UNUSED(ignored)) { if (value == Py_None) value = NULL; @@ -377,7 +377,7 @@ func_set_kwdefaults(PyFunctionObject *op, PyObject *value) } static PyObject * -func_get_annotations(PyFunctionObject *op) +func_get_annotations(PyFunctionObject *op, void *Py_UNUSED(ignored)) { if (op->func_annotations == NULL) { op->func_annotations = PyDict_New(); @@ -389,7 +389,7 @@ func_get_annotations(PyFunctionObject *op) } static int -func_set_annotations(PyFunctionObject *op, PyObject *value) +func_set_annotations(PyFunctionObject *op, PyObject *value, void *Py_UNUSED(ignored)) { if (value == Py_None) value = NULL; diff --git a/Objects/genobject.c b/Objects/genobject.c index 3279a0947e8f..e2def38af541 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -645,14 +645,14 @@ gen_repr(PyGenObject *gen) } static PyObject * -gen_get_name(PyGenObject *op) +gen_get_name(PyGenObject *op, void *Py_UNUSED(ignored)) { Py_INCREF(op->gi_name); return op->gi_name; } static int -gen_set_name(PyGenObject *op, PyObject *value) +gen_set_name(PyGenObject *op, PyObject *value, void *Py_UNUSED(ignored)) { /* Not legal to del gen.gi_name or to set it to anything * other than a string object. */ @@ -667,14 +667,14 @@ gen_set_name(PyGenObject *op, PyObject *value) } static PyObject * -gen_get_qualname(PyGenObject *op) +gen_get_qualname(PyGenObject *op, void *Py_UNUSED(ignored)) { Py_INCREF(op->gi_qualname); return op->gi_qualname; } static int -gen_set_qualname(PyGenObject *op, PyObject *value) +gen_set_qualname(PyGenObject *op, PyObject *value, void *Py_UNUSED(ignored)) { /* Not legal to del gen.__qualname__ or to set it to anything * other than a string object. */ @@ -689,7 +689,7 @@ gen_set_qualname(PyGenObject *op, PyObject *value) } static PyObject * -gen_getyieldfrom(PyGenObject *gen) +gen_getyieldfrom(PyGenObject *gen, void *Py_UNUSED(ignored)) { PyObject *yf = _PyGen_yf(gen); if (yf == NULL) @@ -926,7 +926,7 @@ coro_await(PyCoroObject *coro) } static PyObject * -coro_get_cr_await(PyCoroObject *coro) +coro_get_cr_await(PyCoroObject *coro, void *Py_UNUSED(ignored)) { PyObject *yf = _PyGen_yf((PyGenObject *) coro); if (yf == NULL) diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c index c1350b7dc37d..40e6308c87ae 100644 --- a/Objects/memoryobject.c +++ b/Objects/memoryobject.c @@ -2920,7 +2920,7 @@ _IntTupleFromSsizet(int len, Py_ssize_t *vals) } static PyObject * -memory_obj_get(PyMemoryViewObject *self) +memory_obj_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored)) { Py_buffer *view = &self->view; @@ -2933,56 +2933,56 @@ memory_obj_get(PyMemoryViewObject *self) } static PyObject * -memory_nbytes_get(PyMemoryViewObject *self) +memory_nbytes_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored)) { CHECK_RELEASED(self); return PyLong_FromSsize_t(self->view.len); } static PyObject * -memory_format_get(PyMemoryViewObject *self) +memory_format_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored)) { CHECK_RELEASED(self); return PyUnicode_FromString(self->view.format); } static PyObject * -memory_itemsize_get(PyMemoryViewObject *self) +memory_itemsize_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored)) { CHECK_RELEASED(self); return PyLong_FromSsize_t(self->view.itemsize); } static PyObject * -memory_shape_get(PyMemoryViewObject *self) +memory_shape_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored)) { CHECK_RELEASED(self); return _IntTupleFromSsizet(self->view.ndim, self->view.shape); } static PyObject * -memory_strides_get(PyMemoryViewObject *self) +memory_strides_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored)) { CHECK_RELEASED(self); return _IntTupleFromSsizet(self->view.ndim, self->view.strides); } static PyObject * -memory_suboffsets_get(PyMemoryViewObject *self) +memory_suboffsets_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored)) { CHECK_RELEASED(self); return _IntTupleFromSsizet(self->view.ndim, self->view.suboffsets); } static PyObject * -memory_readonly_get(PyMemoryViewObject *self) +memory_readonly_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored)) { CHECK_RELEASED(self); return PyBool_FromLong(self->view.readonly); } static PyObject * -memory_ndim_get(PyMemoryViewObject *self) +memory_ndim_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored)) { CHECK_RELEASED(self); return PyLong_FromLong(self->view.ndim); diff --git a/Python/context.c b/Python/context.c index d6ef5b337ca3..7531f1440bce 100644 --- a/Python/context.c +++ b/Python/context.c @@ -1141,14 +1141,14 @@ token_tp_repr(PyContextToken *self) } static PyObject * -token_get_var(PyContextToken *self) +token_get_var(PyContextToken *self, void *Py_UNUSED(ignored)) { Py_INCREF(self->tok_var); return (PyObject *)self->tok_var; } static PyObject * -token_get_old_value(PyContextToken *self) +token_get_old_value(PyContextToken *self, void *Py_UNUSED(ignored)) { if (self->tok_oldval == NULL) { return get_token_missing(); diff --git a/Python/traceback.c b/Python/traceback.c index daaf28775491..bd1061ed43b1 100644 --- a/Python/traceback.c +++ b/Python/traceback.c @@ -178,11 +178,12 @@ tb_traverse(PyTracebackObject *tb, visitproc visit, void *arg) return 0; } -static void +static int tb_clear(PyTracebackObject *tb) { Py_CLEAR(tb->tb_next); Py_CLEAR(tb->tb_frame); + return 0; } PyTypeObject PyTraceBack_Type = { From webhook-mailer at python.org Tue Nov 27 12:58:11 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 27 Nov 2018 17:58:11 -0000 Subject: [Python-checkins] bpo-33029: Fix signatures of getter and setter functions. (GH-10746) Message-ID: https://github.com/python/cpython/commit/5ceb7018dc63fab96f81d05e62bbe704e9f10cb9 commit: 5ceb7018dc63fab96f81d05e62bbe704e9f10cb9 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-27T09:58:07-08:00 summary: bpo-33029: Fix signatures of getter and setter functions. (GH-10746) Fix also return type for few other functions (clear, releasebuffer). (cherry picked from commit d4f9cf5545d6d8844e0726552ef2e366f5cc3abd) Co-authored-by: Serhiy Storchaka files: M Modules/_asynciomodule.c M Modules/_collectionsmodule.c M Modules/_csv.c M Modules/_ctypes/_ctypes.c M Modules/_cursesmodule.c M Modules/_io/bytesio.c M Modules/_pickle.c M Modules/_sqlite/connection.c M Modules/_sqlite/row.c M Modules/_sre.c M Modules/_testbuffer.c M Modules/_tkinter.c M Modules/cjkcodecs/multibytecodec.c M Modules/mmapmodule.c M Modules/selectmodule.c M Modules/xxsubtype.c M Objects/cellobject.c M Objects/descrobject.c M Objects/exceptions.c M Objects/frameobject.c M Objects/funcobject.c M Objects/genobject.c M Objects/memoryobject.c M Python/context.c M Python/traceback.c diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c index 809879ac77d3..5816a6748f66 100644 --- a/Modules/_asynciomodule.c +++ b/Modules/_asynciomodule.c @@ -1094,7 +1094,7 @@ _asyncio_Future_get_loop_impl(FutureObj *self) } static PyObject * -FutureObj_get_blocking(FutureObj *fut) +FutureObj_get_blocking(FutureObj *fut, void *Py_UNUSED(ignored)) { if (future_is_alive(fut) && fut->fut_blocking) { Py_RETURN_TRUE; @@ -1105,7 +1105,7 @@ FutureObj_get_blocking(FutureObj *fut) } static int -FutureObj_set_blocking(FutureObj *fut, PyObject *val) +FutureObj_set_blocking(FutureObj *fut, PyObject *val, void *Py_UNUSED(ignored)) { if (future_ensure_alive(fut)) { return -1; @@ -1120,7 +1120,7 @@ FutureObj_set_blocking(FutureObj *fut, PyObject *val) } static PyObject * -FutureObj_get_log_traceback(FutureObj *fut) +FutureObj_get_log_traceback(FutureObj *fut, void *Py_UNUSED(ignored)) { ENSURE_FUTURE_ALIVE(fut) if (fut->fut_log_tb) { @@ -1132,7 +1132,7 @@ FutureObj_get_log_traceback(FutureObj *fut) } static int -FutureObj_set_log_traceback(FutureObj *fut, PyObject *val) +FutureObj_set_log_traceback(FutureObj *fut, PyObject *val, void *Py_UNUSED(ignored)) { int is_true = PyObject_IsTrue(val); if (is_true < 0) { @@ -1148,7 +1148,7 @@ FutureObj_set_log_traceback(FutureObj *fut, PyObject *val) } static PyObject * -FutureObj_get_loop(FutureObj *fut) +FutureObj_get_loop(FutureObj *fut, void *Py_UNUSED(ignored)) { if (!future_is_alive(fut)) { Py_RETURN_NONE; @@ -1158,7 +1158,7 @@ FutureObj_get_loop(FutureObj *fut) } static PyObject * -FutureObj_get_callbacks(FutureObj *fut) +FutureObj_get_callbacks(FutureObj *fut, void *Py_UNUSED(ignored)) { Py_ssize_t i; @@ -1210,7 +1210,7 @@ FutureObj_get_callbacks(FutureObj *fut) } static PyObject * -FutureObj_get_result(FutureObj *fut) +FutureObj_get_result(FutureObj *fut, void *Py_UNUSED(ignored)) { ENSURE_FUTURE_ALIVE(fut) if (fut->fut_result == NULL) { @@ -1221,7 +1221,7 @@ FutureObj_get_result(FutureObj *fut) } static PyObject * -FutureObj_get_exception(FutureObj *fut) +FutureObj_get_exception(FutureObj *fut, void *Py_UNUSED(ignored)) { ENSURE_FUTURE_ALIVE(fut) if (fut->fut_exception == NULL) { @@ -1232,7 +1232,7 @@ FutureObj_get_exception(FutureObj *fut) } static PyObject * -FutureObj_get_source_traceback(FutureObj *fut) +FutureObj_get_source_traceback(FutureObj *fut, void *Py_UNUSED(ignored)) { if (!future_is_alive(fut) || fut->fut_source_tb == NULL) { Py_RETURN_NONE; @@ -1242,7 +1242,7 @@ FutureObj_get_source_traceback(FutureObj *fut) } static PyObject * -FutureObj_get_state(FutureObj *fut) +FutureObj_get_state(FutureObj *fut, void *Py_UNUSED(ignored)) { _Py_IDENTIFIER(PENDING); _Py_IDENTIFIER(CANCELLED); @@ -1723,7 +1723,7 @@ TaskStepMethWrapper_traverse(TaskStepMethWrapper *o, } static PyObject * -TaskStepMethWrapper_get___self__(TaskStepMethWrapper *o) +TaskStepMethWrapper_get___self__(TaskStepMethWrapper *o, void *Py_UNUSED(ignored)) { if (o->sw_task) { Py_INCREF(o->sw_task); @@ -1995,7 +1995,7 @@ TaskObj_traverse(TaskObj *task, visitproc visit, void *arg) } static PyObject * -TaskObj_get_log_destroy_pending(TaskObj *task) +TaskObj_get_log_destroy_pending(TaskObj *task, void *Py_UNUSED(ignored)) { if (task->task_log_destroy_pending) { Py_RETURN_TRUE; @@ -2006,7 +2006,7 @@ TaskObj_get_log_destroy_pending(TaskObj *task) } static int -TaskObj_set_log_destroy_pending(TaskObj *task, PyObject *val) +TaskObj_set_log_destroy_pending(TaskObj *task, PyObject *val, void *Py_UNUSED(ignored)) { int is_true = PyObject_IsTrue(val); if (is_true < 0) { @@ -2017,7 +2017,7 @@ TaskObj_set_log_destroy_pending(TaskObj *task, PyObject *val) } static PyObject * -TaskObj_get_must_cancel(TaskObj *task) +TaskObj_get_must_cancel(TaskObj *task, void *Py_UNUSED(ignored)) { if (task->task_must_cancel) { Py_RETURN_TRUE; @@ -2028,7 +2028,7 @@ TaskObj_get_must_cancel(TaskObj *task) } static PyObject * -TaskObj_get_coro(TaskObj *task) +TaskObj_get_coro(TaskObj *task, void *Py_UNUSED(ignored)) { if (task->task_coro) { Py_INCREF(task->task_coro); @@ -2039,7 +2039,7 @@ TaskObj_get_coro(TaskObj *task) } static PyObject * -TaskObj_get_fut_waiter(TaskObj *task) +TaskObj_get_fut_waiter(TaskObj *task, void *Py_UNUSED(ignored)) { if (task->task_fut_waiter) { Py_INCREF(task->task_fut_waiter); diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c index cfd8905edeb3..9b875e95e1b5 100644 --- a/Modules/_collectionsmodule.c +++ b/Modules/_collectionsmodule.c @@ -1542,7 +1542,7 @@ deque_bool(dequeobject *deque) } static PyObject * -deque_get_maxlen(dequeobject *deque) +deque_get_maxlen(dequeobject *deque, void *Py_UNUSED(ignored)) { if (deque->maxlen < 0) Py_RETURN_NONE; diff --git a/Modules/_csv.c b/Modules/_csv.c index 180f3be5aa47..dd0b3c8107eb 100644 --- a/Modules/_csv.c +++ b/Modules/_csv.c @@ -159,31 +159,31 @@ get_nullchar_as_None(Py_UCS4 c) } static PyObject * -Dialect_get_lineterminator(DialectObj *self) +Dialect_get_lineterminator(DialectObj *self, void *Py_UNUSED(ignored)) { return get_string(self->lineterminator); } static PyObject * -Dialect_get_delimiter(DialectObj *self) +Dialect_get_delimiter(DialectObj *self, void *Py_UNUSED(ignored)) { return get_nullchar_as_None(self->delimiter); } static PyObject * -Dialect_get_escapechar(DialectObj *self) +Dialect_get_escapechar(DialectObj *self, void *Py_UNUSED(ignored)) { return get_nullchar_as_None(self->escapechar); } static PyObject * -Dialect_get_quotechar(DialectObj *self) +Dialect_get_quotechar(DialectObj *self, void *Py_UNUSED(ignored)) { return get_nullchar_as_None(self->quotechar); } static PyObject * -Dialect_get_quoting(DialectObj *self) +Dialect_get_quoting(DialectObj *self, void *Py_UNUSED(ignored)) { return PyLong_FromLong(self->quoting); } diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index 3ae6348fef43..3bb96774b0c8 100644 --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -1161,7 +1161,7 @@ PyTypeObject PyCPointerType_Type = { */ static int -CharArray_set_raw(CDataObject *self, PyObject *value) +CharArray_set_raw(CDataObject *self, PyObject *value, void *Py_UNUSED(ignored)) { char *ptr; Py_ssize_t size; @@ -1187,13 +1187,13 @@ CharArray_set_raw(CDataObject *self, PyObject *value) } static PyObject * -CharArray_get_raw(CDataObject *self) +CharArray_get_raw(CDataObject *self, void *Py_UNUSED(ignored)) { return PyBytes_FromStringAndSize(self->b_ptr, self->b_size); } static PyObject * -CharArray_get_value(CDataObject *self) +CharArray_get_value(CDataObject *self, void *Py_UNUSED(ignored)) { Py_ssize_t i; char *ptr = self->b_ptr; @@ -1204,7 +1204,7 @@ CharArray_get_value(CDataObject *self) } static int -CharArray_set_value(CDataObject *self, PyObject *value) +CharArray_set_value(CDataObject *self, PyObject *value, void *Py_UNUSED(ignored)) { char *ptr; Py_ssize_t size; @@ -1249,7 +1249,7 @@ static PyGetSetDef CharArray_getsets[] = { #ifdef CTYPES_UNICODE static PyObject * -WCharArray_get_value(CDataObject *self) +WCharArray_get_value(CDataObject *self, void *Py_UNUSED(ignored)) { Py_ssize_t i; wchar_t *ptr = (wchar_t *)self->b_ptr; @@ -1260,7 +1260,7 @@ WCharArray_get_value(CDataObject *self) } static int -WCharArray_set_value(CDataObject *self, PyObject *value) +WCharArray_set_value(CDataObject *self, PyObject *value, void *Py_UNUSED(ignored)) { Py_ssize_t result = 0; Py_UNICODE *wstr; @@ -3045,7 +3045,7 @@ GenericPyCData_new(PyTypeObject *type, PyObject *args, PyObject *kwds) */ static int -PyCFuncPtr_set_errcheck(PyCFuncPtrObject *self, PyObject *ob) +PyCFuncPtr_set_errcheck(PyCFuncPtrObject *self, PyObject *ob, void *Py_UNUSED(ignored)) { if (ob && !PyCallable_Check(ob)) { PyErr_SetString(PyExc_TypeError, @@ -3058,7 +3058,7 @@ PyCFuncPtr_set_errcheck(PyCFuncPtrObject *self, PyObject *ob) } static PyObject * -PyCFuncPtr_get_errcheck(PyCFuncPtrObject *self) +PyCFuncPtr_get_errcheck(PyCFuncPtrObject *self, void *Py_UNUSED(ignored)) { if (self->errcheck) { Py_INCREF(self->errcheck); @@ -3068,7 +3068,7 @@ PyCFuncPtr_get_errcheck(PyCFuncPtrObject *self) } static int -PyCFuncPtr_set_restype(PyCFuncPtrObject *self, PyObject *ob) +PyCFuncPtr_set_restype(PyCFuncPtrObject *self, PyObject *ob, void *Py_UNUSED(ignored)) { if (ob == NULL) { Py_CLEAR(self->restype); @@ -3089,7 +3089,7 @@ PyCFuncPtr_set_restype(PyCFuncPtrObject *self, PyObject *ob) } static PyObject * -PyCFuncPtr_get_restype(PyCFuncPtrObject *self) +PyCFuncPtr_get_restype(PyCFuncPtrObject *self, void *Py_UNUSED(ignored)) { StgDictObject *dict; if (self->restype) { @@ -3107,7 +3107,7 @@ PyCFuncPtr_get_restype(PyCFuncPtrObject *self) } static int -PyCFuncPtr_set_argtypes(PyCFuncPtrObject *self, PyObject *ob) +PyCFuncPtr_set_argtypes(PyCFuncPtrObject *self, PyObject *ob, void *Py_UNUSED(ignored)) { PyObject *converters; @@ -3126,7 +3126,7 @@ PyCFuncPtr_set_argtypes(PyCFuncPtrObject *self, PyObject *ob) } static PyObject * -PyCFuncPtr_get_argtypes(PyCFuncPtrObject *self) +PyCFuncPtr_get_argtypes(PyCFuncPtrObject *self, void *Py_UNUSED(ignored)) { StgDictObject *dict; if (self->argtypes) { @@ -4670,7 +4670,7 @@ PyCArrayType_from_ctype(PyObject *itemtype, Py_ssize_t length) */ static int -Simple_set_value(CDataObject *self, PyObject *value) +Simple_set_value(CDataObject *self, PyObject *value, void *Py_UNUSED(ignored)) { PyObject *result; StgDictObject *dict = PyObject_stgdict((PyObject *)self); @@ -4697,12 +4697,12 @@ Simple_init(CDataObject *self, PyObject *args, PyObject *kw) if (!PyArg_UnpackTuple(args, "__init__", 0, 1, &value)) return -1; if (value) - return Simple_set_value(self, value); + return Simple_set_value(self, value, NULL); return 0; } static PyObject * -Simple_get_value(CDataObject *self) +Simple_get_value(CDataObject *self, void *Py_UNUSED(ignored)) { StgDictObject *dict; dict = PyObject_stgdict((PyObject *)self); @@ -4725,7 +4725,7 @@ Simple_from_outparm(PyObject *self, PyObject *args) return self; } /* call stgdict->getfunc */ - return Simple_get_value((CDataObject *)self); + return Simple_get_value((CDataObject *)self, NULL); } static PyMethodDef Simple_methods[] = { @@ -4762,7 +4762,7 @@ Simple_repr(CDataObject *self) Py_TYPE(self)->tp_name, self); } - val = Simple_get_value(self); + val = Simple_get_value(self, NULL); if (val == NULL) return NULL; diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index 7936aef0cc90..8140c8aeed5f 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -1960,7 +1960,7 @@ PyCursesWindow_get_encoding(PyCursesWindowObject *self, void *closure) } static int -PyCursesWindow_set_encoding(PyCursesWindowObject *self, PyObject *value) +PyCursesWindow_set_encoding(PyCursesWindowObject *self, PyObject *value, void *Py_UNUSED(ignored)) { PyObject *ascii; char *encoding; diff --git a/Modules/_io/bytesio.c b/Modules/_io/bytesio.c index ba33f8c50d6a..e4d637cc3aea 100644 --- a/Modules/_io/bytesio.c +++ b/Modules/_io/bytesio.c @@ -201,7 +201,7 @@ write_bytes(bytesio *self, const char *bytes, Py_ssize_t len) } static PyObject * -bytesio_get_closed(bytesio *self) +bytesio_get_closed(bytesio *self, void *Py_UNUSED(ignored)) { if (self->buf == NULL) { Py_RETURN_TRUE; diff --git a/Modules/_pickle.c b/Modules/_pickle.c index 03f575e4621c..a1a90bd95cae 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -4563,13 +4563,13 @@ PicklerMemoProxy_New(PicklerObject *pickler) /*****************************************************************************/ static PyObject * -Pickler_get_memo(PicklerObject *self) +Pickler_get_memo(PicklerObject *self, void *Py_UNUSED(ignored)) { return PicklerMemoProxy_New(self); } static int -Pickler_set_memo(PicklerObject *self, PyObject *obj) +Pickler_set_memo(PicklerObject *self, PyObject *obj, void *Py_UNUSED(ignored)) { PyMemoTable *new_memo = NULL; @@ -4631,7 +4631,7 @@ Pickler_set_memo(PicklerObject *self, PyObject *obj) } static PyObject * -Pickler_get_persid(PicklerObject *self) +Pickler_get_persid(PicklerObject *self, void *Py_UNUSED(ignored)) { if (self->pers_func == NULL) { PyErr_SetString(PyExc_AttributeError, "persistent_id"); @@ -4641,7 +4641,7 @@ Pickler_get_persid(PicklerObject *self) } static int -Pickler_set_persid(PicklerObject *self, PyObject *value) +Pickler_set_persid(PicklerObject *self, PyObject *value, void *Py_UNUSED(ignored)) { if (value == NULL) { PyErr_SetString(PyExc_TypeError, @@ -6999,13 +6999,13 @@ UnpicklerMemoProxy_New(UnpicklerObject *unpickler) static PyObject * -Unpickler_get_memo(UnpicklerObject *self) +Unpickler_get_memo(UnpicklerObject *self, void *Py_UNUSED(ignored)) { return UnpicklerMemoProxy_New(self); } static int -Unpickler_set_memo(UnpicklerObject *self, PyObject *obj) +Unpickler_set_memo(UnpicklerObject *self, PyObject *obj, void *Py_UNUSED(ignored)) { PyObject **new_memo; size_t new_memo_size = 0; @@ -7082,7 +7082,7 @@ Unpickler_set_memo(UnpicklerObject *self, PyObject *obj) } static PyObject * -Unpickler_get_persload(UnpicklerObject *self) +Unpickler_get_persload(UnpicklerObject *self, void *Py_UNUSED(ignored)) { if (self->pers_func == NULL) { PyErr_SetString(PyExc_AttributeError, "persistent_load"); @@ -7092,7 +7092,7 @@ Unpickler_get_persload(UnpicklerObject *self) } static int -Unpickler_set_persload(UnpicklerObject *self, PyObject *value) +Unpickler_set_persload(UnpicklerObject *self, PyObject *value, void *Py_UNUSED(ignored)) { if (value == NULL) { PyErr_SetString(PyExc_TypeError, diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c index 65f173c8c8af..3d14865315eb 100644 --- a/Modules/_sqlite/connection.c +++ b/Modules/_sqlite/connection.c @@ -55,7 +55,7 @@ static const char * const begin_statements[] = { NULL }; -static int pysqlite_connection_set_isolation_level(pysqlite_Connection* self, PyObject* isolation_level); +static int pysqlite_connection_set_isolation_level(pysqlite_Connection* self, PyObject* isolation_level, void *Py_UNUSED(ignored)); static void _pysqlite_drop_unused_cursor_references(pysqlite_Connection* self); @@ -147,7 +147,7 @@ int pysqlite_connection_init(pysqlite_Connection* self, PyObject* args, PyObject Py_INCREF(isolation_level); } Py_CLEAR(self->isolation_level); - if (pysqlite_connection_set_isolation_level(self, isolation_level) < 0) { + if (pysqlite_connection_set_isolation_level(self, isolation_level, NULL) < 0) { Py_DECREF(isolation_level); return -1; } @@ -1139,7 +1139,8 @@ static PyObject* pysqlite_connection_get_in_transaction(pysqlite_Connection* sel Py_RETURN_FALSE; } -static int pysqlite_connection_set_isolation_level(pysqlite_Connection* self, PyObject* isolation_level) +static int +pysqlite_connection_set_isolation_level(pysqlite_Connection* self, PyObject* isolation_level, void *Py_UNUSED(ignored)) { if (isolation_level == Py_None) { PyObject *res = pysqlite_connection_commit(self, NULL); diff --git a/Modules/_sqlite/row.c b/Modules/_sqlite/row.c index ec2c788ae7c0..122bee05f570 100644 --- a/Modules/_sqlite/row.c +++ b/Modules/_sqlite/row.c @@ -150,7 +150,8 @@ PyObject* pysqlite_row_subscript(pysqlite_Row* self, PyObject* idx) } } -Py_ssize_t pysqlite_row_length(pysqlite_Row* self, PyObject* args, PyObject* kwargs) +static Py_ssize_t +pysqlite_row_length(pysqlite_Row* self) { return PyTuple_GET_SIZE(self->data); } diff --git a/Modules/_sre.c b/Modules/_sre.c index b6be6f6ffa60..d2ea62d55a81 100644 --- a/Modules/_sre.c +++ b/Modules/_sre.c @@ -1312,7 +1312,7 @@ PyDoc_STRVAR(pattern_doc, "Compiled regular expression object."); /* PatternObject's 'groupindex' method. */ static PyObject * -pattern_groupindex(PatternObject *self) +pattern_groupindex(PatternObject *self, void *Py_UNUSED(ignored)) { if (self->groupindex == NULL) return PyDict_New(); @@ -2279,7 +2279,7 @@ PyDoc_STRVAR(match_group_doc, For 0 returns the entire match."); static PyObject * -match_lastindex_get(MatchObject *self) +match_lastindex_get(MatchObject *self, void *Py_UNUSED(ignored)) { if (self->lastindex >= 0) return PyLong_FromSsize_t(self->lastindex); @@ -2287,7 +2287,7 @@ match_lastindex_get(MatchObject *self) } static PyObject * -match_lastgroup_get(MatchObject *self) +match_lastgroup_get(MatchObject *self, void *Py_UNUSED(ignored)) { if (self->pattern->indexgroup && self->lastindex >= 0 && @@ -2302,7 +2302,7 @@ match_lastgroup_get(MatchObject *self) } static PyObject * -match_regs_get(MatchObject *self) +match_regs_get(MatchObject *self, void *Py_UNUSED(ignored)) { if (self->regs) { Py_INCREF(self->regs); diff --git a/Modules/_testbuffer.c b/Modules/_testbuffer.c index 669794df012c..a16b96db048a 100644 --- a/Modules/_testbuffer.c +++ b/Modules/_testbuffer.c @@ -1531,7 +1531,7 @@ ndarray_getbuf(NDArrayObject *self, Py_buffer *view, int flags) return 0; } -static int +static void ndarray_releasebuf(NDArrayObject *self, Py_buffer *view) { if (!ND_IS_CONSUMER(self)) { @@ -1539,8 +1539,6 @@ ndarray_releasebuf(NDArrayObject *self, Py_buffer *view) if (--ndbuf->exports == 0 && ndbuf != self->head) ndbuf_delete(self, ndbuf); } - - return 0; } static PyBufferProcs ndarray_as_buffer = { diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index fa268599876a..a96924c9c6e7 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -842,7 +842,7 @@ PyTclObject_string(PyTclObject *self, void *ignored) } static PyObject * -PyTclObject_str(PyTclObject *self, void *ignored) +PyTclObject_str(PyTclObject *self) { if (self->string) { Py_INCREF(self->string); @@ -855,7 +855,7 @@ PyTclObject_str(PyTclObject *self, void *ignored) static PyObject * PyTclObject_repr(PyTclObject *self) { - PyObject *repr, *str = PyTclObject_str(self, NULL); + PyObject *repr, *str = PyTclObject_str(self); if (str == NULL) return NULL; repr = PyUnicode_FromFormat("<%s object: %R>", diff --git a/Modules/cjkcodecs/multibytecodec.c b/Modules/cjkcodecs/multibytecodec.c index 22172b043bcd..4d0aaf3a336f 100644 --- a/Modules/cjkcodecs/multibytecodec.c +++ b/Modules/cjkcodecs/multibytecodec.c @@ -108,7 +108,7 @@ call_error_callback(PyObject *errors, PyObject *exc) } static PyObject * -codecctx_errors_get(MultibyteStatefulCodecContext *self) +codecctx_errors_get(MultibyteStatefulCodecContext *self, void *Py_UNUSED(ignored)) { const char *errors; diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c index ba42f7380c09..f957e2c45ef5 100644 --- a/Modules/mmapmodule.c +++ b/Modules/mmapmodule.c @@ -653,7 +653,7 @@ mmap_move_method(mmap_object *self, PyObject *args) } static PyObject * -mmap_closed_get(mmap_object *self) +mmap_closed_get(mmap_object *self, void *Py_UNUSED(ignored)) { #ifdef MS_WINDOWS return PyBool_FromLong(self->map_handle == NULL ? 1 : 0); diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c index d6b8fc1353bc..63266af4dce9 100644 --- a/Modules/selectmodule.c +++ b/Modules/selectmodule.c @@ -1023,7 +1023,7 @@ Close the devpoll file descriptor. Further operations on the devpoll\n\ object will raise an exception."); static PyObject* -devpoll_get_closed(devpollObject *self) +devpoll_get_closed(devpollObject *self, void *Py_UNUSED(ignored)) { if (self->fd_devpoll < 0) Py_RETURN_TRUE; @@ -1346,7 +1346,7 @@ Close the epoll control file descriptor. Further operations on the epoll\n\ object will raise an exception."); static PyObject* -pyepoll_get_closed(pyEpoll_Object *self) +pyepoll_get_closed(pyEpoll_Object *self, void *Py_UNUSED(ignored)) { if (self->epfd < 0) Py_RETURN_TRUE; @@ -2072,7 +2072,7 @@ Close the kqueue control file descriptor. Further operations on the kqueue\n\ object will raise an exception."); static PyObject* -kqueue_queue_get_closed(kqueue_queue_Object *self) +kqueue_queue_get_closed(kqueue_queue_Object *self, void *Py_UNUSED(ignored)) { if (self->kqfd < 0) Py_RETURN_TRUE; diff --git a/Modules/xxsubtype.c b/Modules/xxsubtype.c index 11242d739138..d2593b12d602 100644 --- a/Modules/xxsubtype.c +++ b/Modules/xxsubtype.c @@ -89,7 +89,7 @@ spamlist_init(spamlistobject *self, PyObject *args, PyObject *kwds) } static PyObject * -spamlist_state_get(spamlistobject *self) +spamlist_state_get(spamlistobject *self, void *Py_UNUSED(ignored)) { return PyLong_FromLong(self->state); } diff --git a/Objects/cellobject.c b/Objects/cellobject.c index 7b05e61ce46f..6f8915ac9200 100644 --- a/Objects/cellobject.c +++ b/Objects/cellobject.c @@ -111,7 +111,7 @@ cell_get_contents(PyCellObject *op, void *closure) } static int -cell_set_contents(PyCellObject *op, PyObject *obj) +cell_set_contents(PyCellObject *op, PyObject *obj, void *Py_UNUSED(ignored)) { Py_XINCREF(obj); Py_XSETREF(op->ob_ref, obj); diff --git a/Objects/descrobject.c b/Objects/descrobject.c index 601403940299..c6f7e55ea5d1 100644 --- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -439,7 +439,7 @@ calculate_qualname(PyDescrObject *descr) } static PyObject * -descr_get_qualname(PyDescrObject *descr) +descr_get_qualname(PyDescrObject *descr, void *Py_UNUSED(ignored)) { if (descr->d_qualname == NULL) descr->d_qualname = calculate_qualname(descr); @@ -1108,7 +1108,7 @@ static PyMemberDef wrapper_members[] = { }; static PyObject * -wrapper_objclass(wrapperobject *wp) +wrapper_objclass(wrapperobject *wp, void *Py_UNUSED(ignored)) { PyObject *c = (PyObject *)PyDescr_TYPE(wp->descr); @@ -1117,7 +1117,7 @@ wrapper_objclass(wrapperobject *wp) } static PyObject * -wrapper_name(wrapperobject *wp) +wrapper_name(wrapperobject *wp, void *Py_UNUSED(ignored)) { const char *s = wp->descr->d_base->name; @@ -1125,21 +1125,21 @@ wrapper_name(wrapperobject *wp) } static PyObject * -wrapper_doc(wrapperobject *wp, void *closure) +wrapper_doc(wrapperobject *wp, void *Py_UNUSED(ignored)) { return _PyType_GetDocFromInternalDoc(wp->descr->d_base->name, wp->descr->d_base->doc); } static PyObject * -wrapper_text_signature(wrapperobject *wp, void *closure) +wrapper_text_signature(wrapperobject *wp, void *Py_UNUSED(ignored)) { return _PyType_GetTextSignatureFromInternalDoc(wp->descr->d_base->name, wp->descr->d_base->doc); } static PyObject * -wrapper_qualname(wrapperobject *wp) +wrapper_qualname(wrapperobject *wp, void *Py_UNUSED(ignored)) { - return descr_get_qualname((PyDescrObject *)wp->descr); + return descr_get_qualname((PyDescrObject *)wp->descr, NULL); } static PyGetSetDef wrapper_getsets[] = { diff --git a/Objects/exceptions.c b/Objects/exceptions.c index 2cce40f88444..03bdf79de324 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -181,7 +181,7 @@ static PyMethodDef BaseException_methods[] = { }; static PyObject * -BaseException_get_args(PyBaseExceptionObject *self) +BaseException_get_args(PyBaseExceptionObject *self, void *Py_UNUSED(ignored)) { if (self->args == NULL) { Py_RETURN_NONE; @@ -191,7 +191,7 @@ BaseException_get_args(PyBaseExceptionObject *self) } static int -BaseException_set_args(PyBaseExceptionObject *self, PyObject *val) +BaseException_set_args(PyBaseExceptionObject *self, PyObject *val, void *Py_UNUSED(ignored)) { PyObject *seq; if (val == NULL) { @@ -206,7 +206,7 @@ BaseException_set_args(PyBaseExceptionObject *self, PyObject *val) } static PyObject * -BaseException_get_tb(PyBaseExceptionObject *self) +BaseException_get_tb(PyBaseExceptionObject *self, void *Py_UNUSED(ignored)) { if (self->traceback == NULL) { Py_RETURN_NONE; @@ -216,7 +216,7 @@ BaseException_get_tb(PyBaseExceptionObject *self) } static int -BaseException_set_tb(PyBaseExceptionObject *self, PyObject *tb) +BaseException_set_tb(PyBaseExceptionObject *self, PyObject *tb, void *Py_UNUSED(ignored)) { if (tb == NULL) { PyErr_SetString(PyExc_TypeError, "__traceback__ may not be deleted"); @@ -234,7 +234,8 @@ BaseException_set_tb(PyBaseExceptionObject *self, PyObject *tb) } static PyObject * -BaseException_get_context(PyObject *self) { +BaseException_get_context(PyObject *self, void *Py_UNUSED(ignored)) +{ PyObject *res = PyException_GetContext(self); if (res) return res; /* new reference already returned above */ @@ -242,7 +243,8 @@ BaseException_get_context(PyObject *self) { } static int -BaseException_set_context(PyObject *self, PyObject *arg) { +BaseException_set_context(PyObject *self, PyObject *arg, void *Py_UNUSED(ignored)) +{ if (arg == NULL) { PyErr_SetString(PyExc_TypeError, "__context__ may not be deleted"); return -1; @@ -261,7 +263,8 @@ BaseException_set_context(PyObject *self, PyObject *arg) { } static PyObject * -BaseException_get_cause(PyObject *self) { +BaseException_get_cause(PyObject *self, void *Py_UNUSED(ignored)) +{ PyObject *res = PyException_GetCause(self); if (res) return res; /* new reference already returned above */ @@ -269,7 +272,8 @@ BaseException_get_cause(PyObject *self) { } static int -BaseException_set_cause(PyObject *self, PyObject *arg) { +BaseException_set_cause(PyObject *self, PyObject *arg, void *Py_UNUSED(ignored)) +{ if (arg == NULL) { PyErr_SetString(PyExc_TypeError, "__cause__ may not be deleted"); return -1; @@ -292,10 +296,10 @@ static PyGetSetDef BaseException_getset[] = { {"__dict__", PyObject_GenericGetDict, PyObject_GenericSetDict}, {"args", (getter)BaseException_get_args, (setter)BaseException_set_args}, {"__traceback__", (getter)BaseException_get_tb, (setter)BaseException_set_tb}, - {"__context__", (getter)BaseException_get_context, - (setter)BaseException_set_context, PyDoc_STR("exception context")}, - {"__cause__", (getter)BaseException_get_cause, - (setter)BaseException_set_cause, PyDoc_STR("exception cause")}, + {"__context__", BaseException_get_context, + BaseException_set_context, PyDoc_STR("exception context")}, + {"__cause__", BaseException_get_cause, + BaseException_set_cause, PyDoc_STR("exception cause")}, {NULL}, }; @@ -310,7 +314,7 @@ PyException_GetTraceback(PyObject *self) { int PyException_SetTraceback(PyObject *self, PyObject *tb) { - return BaseException_set_tb((PyBaseExceptionObject *)self, tb); + return BaseException_set_tb((PyBaseExceptionObject *)self, tb, NULL); } PyObject * diff --git a/Objects/frameobject.c b/Objects/frameobject.c index f518dc485616..4ef10d0eb7bc 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -64,7 +64,7 @@ frame_getlineno(PyFrameObject *f, void *closure) * that time. */ static int -frame_setlineno(PyFrameObject *f, PyObject* p_new_lineno) +frame_setlineno(PyFrameObject *f, PyObject* p_new_lineno, void *Py_UNUSED(ignored)) { int new_lineno = 0; /* The new value of f_lineno */ long l_new_lineno; @@ -519,7 +519,7 @@ frame_traverse(PyFrameObject *f, visitproc visit, void *arg) return 0; } -static void +static int frame_tp_clear(PyFrameObject *f) { PyObject **fastlocals, **p, **oldtop; @@ -547,6 +547,7 @@ frame_tp_clear(PyFrameObject *f) for (p = f->f_valuestack; p < oldtop; p++) Py_CLEAR(*p); } + return 0; } static PyObject * @@ -561,7 +562,7 @@ frame_clear(PyFrameObject *f) _PyGen_Finalize(f->f_gen); assert(f->f_gen == NULL); } - frame_tp_clear(f); + (void)frame_tp_clear(f); Py_RETURN_NONE; } diff --git a/Objects/funcobject.c b/Objects/funcobject.c index 241685d5b7bb..413a590f17f5 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c @@ -242,14 +242,14 @@ static PyMemberDef func_memberlist[] = { }; static PyObject * -func_get_code(PyFunctionObject *op) +func_get_code(PyFunctionObject *op, void *Py_UNUSED(ignored)) { Py_INCREF(op->func_code); return op->func_code; } static int -func_set_code(PyFunctionObject *op, PyObject *value) +func_set_code(PyFunctionObject *op, PyObject *value, void *Py_UNUSED(ignored)) { Py_ssize_t nfree, nclosure; @@ -277,14 +277,14 @@ func_set_code(PyFunctionObject *op, PyObject *value) } static PyObject * -func_get_name(PyFunctionObject *op) +func_get_name(PyFunctionObject *op, void *Py_UNUSED(ignored)) { Py_INCREF(op->func_name); return op->func_name; } static int -func_set_name(PyFunctionObject *op, PyObject *value) +func_set_name(PyFunctionObject *op, PyObject *value, void *Py_UNUSED(ignored)) { /* Not legal to del f.func_name or to set it to anything * other than a string object. */ @@ -299,14 +299,14 @@ func_set_name(PyFunctionObject *op, PyObject *value) } static PyObject * -func_get_qualname(PyFunctionObject *op) +func_get_qualname(PyFunctionObject *op, void *Py_UNUSED(ignored)) { Py_INCREF(op->func_qualname); return op->func_qualname; } static int -func_set_qualname(PyFunctionObject *op, PyObject *value) +func_set_qualname(PyFunctionObject *op, PyObject *value, void *Py_UNUSED(ignored)) { /* Not legal to del f.__qualname__ or to set it to anything * other than a string object. */ @@ -321,7 +321,7 @@ func_set_qualname(PyFunctionObject *op, PyObject *value) } static PyObject * -func_get_defaults(PyFunctionObject *op) +func_get_defaults(PyFunctionObject *op, void *Py_UNUSED(ignored)) { if (op->func_defaults == NULL) { Py_RETURN_NONE; @@ -331,7 +331,7 @@ func_get_defaults(PyFunctionObject *op) } static int -func_set_defaults(PyFunctionObject *op, PyObject *value) +func_set_defaults(PyFunctionObject *op, PyObject *value, void *Py_UNUSED(ignored)) { /* Legal to del f.func_defaults. * Can only set func_defaults to NULL or a tuple. */ @@ -348,7 +348,7 @@ func_set_defaults(PyFunctionObject *op, PyObject *value) } static PyObject * -func_get_kwdefaults(PyFunctionObject *op) +func_get_kwdefaults(PyFunctionObject *op, void *Py_UNUSED(ignored)) { if (op->func_kwdefaults == NULL) { Py_RETURN_NONE; @@ -358,7 +358,7 @@ func_get_kwdefaults(PyFunctionObject *op) } static int -func_set_kwdefaults(PyFunctionObject *op, PyObject *value) +func_set_kwdefaults(PyFunctionObject *op, PyObject *value, void *Py_UNUSED(ignored)) { if (value == Py_None) value = NULL; @@ -375,7 +375,7 @@ func_set_kwdefaults(PyFunctionObject *op, PyObject *value) } static PyObject * -func_get_annotations(PyFunctionObject *op) +func_get_annotations(PyFunctionObject *op, void *Py_UNUSED(ignored)) { if (op->func_annotations == NULL) { op->func_annotations = PyDict_New(); @@ -387,7 +387,7 @@ func_get_annotations(PyFunctionObject *op) } static int -func_set_annotations(PyFunctionObject *op, PyObject *value) +func_set_annotations(PyFunctionObject *op, PyObject *value, void *Py_UNUSED(ignored)) { if (value == Py_None) value = NULL; diff --git a/Objects/genobject.c b/Objects/genobject.c index 793a809b8428..b0e877072c78 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -644,14 +644,14 @@ gen_repr(PyGenObject *gen) } static PyObject * -gen_get_name(PyGenObject *op) +gen_get_name(PyGenObject *op, void *Py_UNUSED(ignored)) { Py_INCREF(op->gi_name); return op->gi_name; } static int -gen_set_name(PyGenObject *op, PyObject *value) +gen_set_name(PyGenObject *op, PyObject *value, void *Py_UNUSED(ignored)) { /* Not legal to del gen.gi_name or to set it to anything * other than a string object. */ @@ -666,14 +666,14 @@ gen_set_name(PyGenObject *op, PyObject *value) } static PyObject * -gen_get_qualname(PyGenObject *op) +gen_get_qualname(PyGenObject *op, void *Py_UNUSED(ignored)) { Py_INCREF(op->gi_qualname); return op->gi_qualname; } static int -gen_set_qualname(PyGenObject *op, PyObject *value) +gen_set_qualname(PyGenObject *op, PyObject *value, void *Py_UNUSED(ignored)) { /* Not legal to del gen.__qualname__ or to set it to anything * other than a string object. */ @@ -688,7 +688,7 @@ gen_set_qualname(PyGenObject *op, PyObject *value) } static PyObject * -gen_getyieldfrom(PyGenObject *gen) +gen_getyieldfrom(PyGenObject *gen, void *Py_UNUSED(ignored)) { PyObject *yf = _PyGen_yf(gen); if (yf == NULL) @@ -927,7 +927,7 @@ coro_await(PyCoroObject *coro) } static PyObject * -coro_get_cr_await(PyCoroObject *coro) +coro_get_cr_await(PyCoroObject *coro, void *Py_UNUSED(ignored)) { PyObject *yf = _PyGen_yf((PyGenObject *) coro); if (yf == NULL) diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c index ccf45ffc5826..ce8fa3f27005 100644 --- a/Objects/memoryobject.c +++ b/Objects/memoryobject.c @@ -2905,7 +2905,7 @@ _IntTupleFromSsizet(int len, Py_ssize_t *vals) } static PyObject * -memory_obj_get(PyMemoryViewObject *self) +memory_obj_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored)) { Py_buffer *view = &self->view; @@ -2918,56 +2918,56 @@ memory_obj_get(PyMemoryViewObject *self) } static PyObject * -memory_nbytes_get(PyMemoryViewObject *self) +memory_nbytes_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored)) { CHECK_RELEASED(self); return PyLong_FromSsize_t(self->view.len); } static PyObject * -memory_format_get(PyMemoryViewObject *self) +memory_format_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored)) { CHECK_RELEASED(self); return PyUnicode_FromString(self->view.format); } static PyObject * -memory_itemsize_get(PyMemoryViewObject *self) +memory_itemsize_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored)) { CHECK_RELEASED(self); return PyLong_FromSsize_t(self->view.itemsize); } static PyObject * -memory_shape_get(PyMemoryViewObject *self) +memory_shape_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored)) { CHECK_RELEASED(self); return _IntTupleFromSsizet(self->view.ndim, self->view.shape); } static PyObject * -memory_strides_get(PyMemoryViewObject *self) +memory_strides_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored)) { CHECK_RELEASED(self); return _IntTupleFromSsizet(self->view.ndim, self->view.strides); } static PyObject * -memory_suboffsets_get(PyMemoryViewObject *self) +memory_suboffsets_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored)) { CHECK_RELEASED(self); return _IntTupleFromSsizet(self->view.ndim, self->view.suboffsets); } static PyObject * -memory_readonly_get(PyMemoryViewObject *self) +memory_readonly_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored)) { CHECK_RELEASED(self); return PyBool_FromLong(self->view.readonly); } static PyObject * -memory_ndim_get(PyMemoryViewObject *self) +memory_ndim_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored)) { CHECK_RELEASED(self); return PyLong_FromLong(self->view.ndim); diff --git a/Python/context.c b/Python/context.c index ba64903a608e..90c71e386d53 100644 --- a/Python/context.c +++ b/Python/context.c @@ -1105,14 +1105,14 @@ token_tp_repr(PyContextToken *self) } static PyObject * -token_get_var(PyContextToken *self) +token_get_var(PyContextToken *self, void *Py_UNUSED(ignored)) { Py_INCREF(self->tok_var); return (PyObject *)self->tok_var; } static PyObject * -token_get_old_value(PyContextToken *self) +token_get_old_value(PyContextToken *self, void *Py_UNUSED(ignored)) { if (self->tok_oldval == NULL) { return get_token_missing(); diff --git a/Python/traceback.c b/Python/traceback.c index 95bef64e734b..8b32864e1d65 100644 --- a/Python/traceback.c +++ b/Python/traceback.c @@ -178,11 +178,12 @@ tb_traverse(PyTracebackObject *tb, visitproc visit, void *arg) return 0; } -static void +static int tb_clear(PyTracebackObject *tb) { Py_CLEAR(tb->tb_next); Py_CLEAR(tb->tb_frame); + return 0; } PyTypeObject PyTraceBack_Type = { From webhook-mailer at python.org Tue Nov 27 13:27:51 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Tue, 27 Nov 2018 18:27:51 -0000 Subject: [Python-checkins] bpo-33012: Fix signatures of METH_NOARGS functions. (GH-10736) (GH-10748) Message-ID: https://github.com/python/cpython/commit/ad8ac54aa3d2323bdb5feb5e858a922840358187 commit: ad8ac54aa3d2323bdb5feb5e858a922840358187 branch: 3.7 author: Serhiy Storchaka committer: GitHub date: 2018-11-27T20:27:47+02:00 summary: bpo-33012: Fix signatures of METH_NOARGS functions. (GH-10736) (GH-10748) (cherry picked from commit 81524022d0c0df7a41f9b2b2df41e2ebe140e610) files: M Modules/_collectionsmodule.c M Modules/_cursesmodule.c M Modules/_testcapimodule.c M Objects/odictobject.c diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c index 9b875e95e1b5..decd6ae3e553 100644 --- a/Modules/_collectionsmodule.c +++ b/Modules/_collectionsmodule.c @@ -1344,7 +1344,7 @@ deque_traverse(dequeobject *deque, visitproc visit, void *arg) } static PyObject * -deque_reduce(dequeobject *deque) +deque_reduce(dequeobject *deque, PyObject *Py_UNUSED(ignored)) { PyObject *dict, *it; _Py_IDENTIFIER(__dict__); diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index 8140c8aeed5f..931c5ceed062 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -414,27 +414,27 @@ PyTypeObject PyCursesWindow_Type; PARSESTR - format string for argument parsing */ -#define Window_NoArgNoReturnFunction(X) \ - static PyObject *PyCursesWindow_ ## X \ - (PyCursesWindowObject *self, PyObject *args) \ +#define Window_NoArgNoReturnFunction(X) \ + static PyObject *PyCursesWindow_ ## X \ + (PyCursesWindowObject *self, PyObject *Py_UNUSED(ignored)) \ { return PyCursesCheckERR(X(self->win), # X); } #define Window_NoArgTrueFalseFunction(X) \ static PyObject * PyCursesWindow_ ## X \ - (PyCursesWindowObject *self) \ + (PyCursesWindowObject *self, PyObject *Py_UNUSED(ignored)) \ { \ if (X (self->win) == FALSE) { Py_RETURN_FALSE; } \ else { Py_RETURN_TRUE; } } #define Window_NoArgNoReturnVoidFunction(X) \ static PyObject * PyCursesWindow_ ## X \ - (PyCursesWindowObject *self) \ + (PyCursesWindowObject *self, PyObject *Py_UNUSED(ignored)) \ { \ X(self->win); Py_RETURN_NONE; } #define Window_NoArg2TupleReturnFunction(X, TYPE, ERGSTR) \ static PyObject * PyCursesWindow_ ## X \ - (PyCursesWindowObject *self) \ + (PyCursesWindowObject *self, PyObject *Py_UNUSED(ignored)) \ { \ TYPE arg1, arg2; \ X(self->win,arg1,arg2); return Py_BuildValue(ERGSTR, arg1, arg2); } diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index eafe3477e447..eb050ff112e8 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -943,7 +943,7 @@ test_buildvalue_N_error(const char *fmt) } static PyObject * -test_buildvalue_N(PyObject *self, PyObject *noargs) +test_buildvalue_N(PyObject *self, PyObject *Py_UNUSED(ignored)) { PyObject *arg, *res; @@ -2453,7 +2453,7 @@ pending_threadfunc(PyObject *self, PyObject *arg) /* Some tests of PyUnicode_FromFormat(). This needs more tests. */ static PyObject * -test_string_from_format(PyObject *self, PyObject *args) +test_string_from_format(PyObject *self, PyObject *Py_UNUSED(ignored)) { PyObject *result; char *msg; @@ -2593,7 +2593,7 @@ typedef struct { } known_capsule; static PyObject * -test_capsule(PyObject *self, PyObject *args) +test_capsule(PyObject *self, PyObject *Py_UNUSED(ignored)) { PyObject *object; const char *error = NULL; @@ -2964,7 +2964,7 @@ make_memoryview_from_NULL_pointer(PyObject *self) } static PyObject * -test_from_contiguous(PyObject* self, PyObject *noargs) +test_from_contiguous(PyObject* self, PyObject *Py_UNUSED(ignored)) { int data[9] = {-1,-1,-1,-1,-1,-1,-1,-1,-1}; int init[5] = {0, 1, 2, 3, 4}; @@ -3017,7 +3017,7 @@ test_from_contiguous(PyObject* self, PyObject *noargs) extern PyTypeObject _PyBytesIOBuffer_Type; static PyObject * -test_pep3118_obsolete_write_locks(PyObject* self, PyObject *noargs) +test_pep3118_obsolete_write_locks(PyObject* self, PyObject *Py_UNUSED(ignored)) { PyTypeObject *type = &_PyBytesIOBuffer_Type; PyObject *b; diff --git a/Objects/odictobject.c b/Objects/odictobject.c index 676ed99078ce..7487bd960764 100644 --- a/Objects/odictobject.c +++ b/Objects/odictobject.c @@ -1803,7 +1803,7 @@ odictiter_iternext(odictiterobject *di) PyDoc_STRVAR(reduce_doc, "Return state information for pickling"); static PyObject * -odictiter_reduce(odictiterobject *di) +odictiter_reduce(odictiterobject *di, PyObject *Py_UNUSED(ignored)) { /* copy the iterator state */ odictiterobject tmp = *di; From webhook-mailer at python.org Tue Nov 27 13:38:40 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Tue, 27 Nov 2018 18:38:40 -0000 Subject: [Python-checkins] [3.6] bpo-33029: Fix signatures of getter and setter functions. (GH-10746) (GH-10749) Message-ID: https://github.com/python/cpython/commit/29d2f3c47280f05795c9d4d70f4018cb1488f0ab commit: 29d2f3c47280f05795c9d4d70f4018cb1488f0ab branch: 3.6 author: Serhiy Storchaka committer: GitHub date: 2018-11-27T20:38:36+02:00 summary: [3.6] bpo-33029: Fix signatures of getter and setter functions. (GH-10746) (GH-10749) Fix also return type for few other functions (clear, releasebuffer). (cherry picked from commit d4f9cf5545d6d8844e0726552ef2e366f5cc3abd) files: M Modules/_asynciomodule.c M Modules/_collectionsmodule.c M Modules/_csv.c M Modules/_ctypes/_ctypes.c M Modules/_cursesmodule.c M Modules/_io/bytesio.c M Modules/_pickle.c M Modules/_sqlite/connection.c M Modules/_sqlite/row.c M Modules/_sre.c M Modules/_testbuffer.c M Modules/_tkinter.c M Modules/cjkcodecs/multibytecodec.c M Modules/mmapmodule.c M Modules/selectmodule.c M Modules/xxsubtype.c M Objects/descrobject.c M Objects/exceptions.c M Objects/frameobject.c M Objects/funcobject.c M Objects/genobject.c M Objects/memoryobject.c M Python/traceback.c diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c index 2a6c16da85b4..39786cc5f664 100644 --- a/Modules/_asynciomodule.c +++ b/Modules/_asynciomodule.c @@ -625,7 +625,7 @@ _asyncio_Future_done_impl(FutureObj *self) } static PyObject * -FutureObj_get_blocking(FutureObj *fut) +FutureObj_get_blocking(FutureObj *fut, void *Py_UNUSED(ignored)) { if (fut->fut_blocking) { Py_RETURN_TRUE; @@ -636,7 +636,7 @@ FutureObj_get_blocking(FutureObj *fut) } static int -FutureObj_set_blocking(FutureObj *fut, PyObject *val) +FutureObj_set_blocking(FutureObj *fut, PyObject *val, void *Py_UNUSED(ignored)) { int is_true = PyObject_IsTrue(val); if (is_true < 0) { @@ -647,7 +647,7 @@ FutureObj_set_blocking(FutureObj *fut, PyObject *val) } static PyObject * -FutureObj_get_log_traceback(FutureObj *fut) +FutureObj_get_log_traceback(FutureObj *fut, void *Py_UNUSED(ignored)) { if (fut->fut_log_tb) { Py_RETURN_TRUE; @@ -658,7 +658,7 @@ FutureObj_get_log_traceback(FutureObj *fut) } static int -FutureObj_set_log_traceback(FutureObj *fut, PyObject *val) +FutureObj_set_log_traceback(FutureObj *fut, PyObject *val, void *Py_UNUSED(ignored)) { int is_true = PyObject_IsTrue(val); if (is_true < 0) { @@ -669,7 +669,7 @@ FutureObj_set_log_traceback(FutureObj *fut, PyObject *val) } static PyObject * -FutureObj_get_loop(FutureObj *fut) +FutureObj_get_loop(FutureObj *fut, void *Py_UNUSED(ignored)) { if (fut->fut_loop == NULL) { Py_RETURN_NONE; @@ -679,7 +679,7 @@ FutureObj_get_loop(FutureObj *fut) } static PyObject * -FutureObj_get_callbacks(FutureObj *fut) +FutureObj_get_callbacks(FutureObj *fut, void *Py_UNUSED(ignored)) { if (fut->fut_callbacks == NULL) { Py_RETURN_NONE; @@ -689,7 +689,7 @@ FutureObj_get_callbacks(FutureObj *fut) } static PyObject * -FutureObj_get_result(FutureObj *fut) +FutureObj_get_result(FutureObj *fut, void *Py_UNUSED(ignored)) { if (fut->fut_result == NULL) { Py_RETURN_NONE; @@ -699,7 +699,7 @@ FutureObj_get_result(FutureObj *fut) } static PyObject * -FutureObj_get_exception(FutureObj *fut) +FutureObj_get_exception(FutureObj *fut, void *Py_UNUSED(ignored)) { if (fut->fut_exception == NULL) { Py_RETURN_NONE; @@ -709,7 +709,7 @@ FutureObj_get_exception(FutureObj *fut) } static PyObject * -FutureObj_get_source_traceback(FutureObj *fut) +FutureObj_get_source_traceback(FutureObj *fut, void *Py_UNUSED(ignored)) { if (fut->fut_source_tb == NULL) { Py_RETURN_NONE; @@ -719,7 +719,7 @@ FutureObj_get_source_traceback(FutureObj *fut) } static PyObject * -FutureObj_get_state(FutureObj *fut) +FutureObj_get_state(FutureObj *fut, void *Py_UNUSED(ignored)) { _Py_IDENTIFIER(PENDING); _Py_IDENTIFIER(CANCELLED); @@ -1207,7 +1207,7 @@ TaskStepMethWrapper_traverse(TaskStepMethWrapper *o, } static PyObject * -TaskStepMethWrapper_get___self__(TaskStepMethWrapper *o) +TaskStepMethWrapper_get___self__(TaskStepMethWrapper *o, void *Py_UNUSED(ignored)) { if (o->sw_task) { Py_INCREF(o->sw_task); @@ -1387,7 +1387,7 @@ TaskObj_traverse(TaskObj *task, visitproc visit, void *arg) } static PyObject * -TaskObj_get_log_destroy_pending(TaskObj *task) +TaskObj_get_log_destroy_pending(TaskObj *task, void *Py_UNUSED(ignored)) { if (task->task_log_destroy_pending) { Py_RETURN_TRUE; @@ -1398,7 +1398,7 @@ TaskObj_get_log_destroy_pending(TaskObj *task) } static int -TaskObj_set_log_destroy_pending(TaskObj *task, PyObject *val) +TaskObj_set_log_destroy_pending(TaskObj *task, PyObject *val, void *Py_UNUSED(ignored)) { int is_true = PyObject_IsTrue(val); if (is_true < 0) { @@ -1409,7 +1409,7 @@ TaskObj_set_log_destroy_pending(TaskObj *task, PyObject *val) } static PyObject * -TaskObj_get_must_cancel(TaskObj *task) +TaskObj_get_must_cancel(TaskObj *task, void *Py_UNUSED(ignored)) { if (task->task_must_cancel) { Py_RETURN_TRUE; @@ -1420,7 +1420,7 @@ TaskObj_get_must_cancel(TaskObj *task) } static PyObject * -TaskObj_get_coro(TaskObj *task) +TaskObj_get_coro(TaskObj *task, void *Py_UNUSED(ignored)) { if (task->task_coro) { Py_INCREF(task->task_coro); @@ -1431,7 +1431,7 @@ TaskObj_get_coro(TaskObj *task) } static PyObject * -TaskObj_get_fut_waiter(TaskObj *task) +TaskObj_get_fut_waiter(TaskObj *task, void *Py_UNUSED(ignored)) { if (task->task_fut_waiter) { Py_INCREF(task->task_fut_waiter); diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c index 85037d002703..4fbf3bdb1463 100644 --- a/Modules/_collectionsmodule.c +++ b/Modules/_collectionsmodule.c @@ -1539,7 +1539,7 @@ deque_bool(dequeobject *deque) } static PyObject * -deque_get_maxlen(dequeobject *deque) +deque_get_maxlen(dequeobject *deque, void *Py_UNUSED(ignored)) { if (deque->maxlen < 0) Py_RETURN_NONE; diff --git a/Modules/_csv.c b/Modules/_csv.c index 5d0044a2377a..5324fa6bb657 100644 --- a/Modules/_csv.c +++ b/Modules/_csv.c @@ -160,31 +160,31 @@ get_nullchar_as_None(Py_UCS4 c) } static PyObject * -Dialect_get_lineterminator(DialectObj *self) +Dialect_get_lineterminator(DialectObj *self, void *Py_UNUSED(ignored)) { return get_string(self->lineterminator); } static PyObject * -Dialect_get_delimiter(DialectObj *self) +Dialect_get_delimiter(DialectObj *self, void *Py_UNUSED(ignored)) { return get_nullchar_as_None(self->delimiter); } static PyObject * -Dialect_get_escapechar(DialectObj *self) +Dialect_get_escapechar(DialectObj *self, void *Py_UNUSED(ignored)) { return get_nullchar_as_None(self->escapechar); } static PyObject * -Dialect_get_quotechar(DialectObj *self) +Dialect_get_quotechar(DialectObj *self, void *Py_UNUSED(ignored)) { return get_nullchar_as_None(self->quotechar); } static PyObject * -Dialect_get_quoting(DialectObj *self) +Dialect_get_quoting(DialectObj *self, void *Py_UNUSED(ignored)) { return PyLong_FromLong(self->quoting); } diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index 69d73f5a958f..c5b499c7aac2 100644 --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -1163,7 +1163,7 @@ PyTypeObject PyCPointerType_Type = { */ static int -CharArray_set_raw(CDataObject *self, PyObject *value) +CharArray_set_raw(CDataObject *self, PyObject *value, void *Py_UNUSED(ignored)) { char *ptr; Py_ssize_t size; @@ -1189,13 +1189,13 @@ CharArray_set_raw(CDataObject *self, PyObject *value) } static PyObject * -CharArray_get_raw(CDataObject *self) +CharArray_get_raw(CDataObject *self, void *Py_UNUSED(ignored)) { return PyBytes_FromStringAndSize(self->b_ptr, self->b_size); } static PyObject * -CharArray_get_value(CDataObject *self) +CharArray_get_value(CDataObject *self, void *Py_UNUSED(ignored)) { Py_ssize_t i; char *ptr = self->b_ptr; @@ -1206,7 +1206,7 @@ CharArray_get_value(CDataObject *self) } static int -CharArray_set_value(CDataObject *self, PyObject *value) +CharArray_set_value(CDataObject *self, PyObject *value, void *Py_UNUSED(ignored)) { char *ptr; Py_ssize_t size; @@ -1251,7 +1251,7 @@ static PyGetSetDef CharArray_getsets[] = { #ifdef CTYPES_UNICODE static PyObject * -WCharArray_get_value(CDataObject *self) +WCharArray_get_value(CDataObject *self, void *Py_UNUSED(ignored)) { Py_ssize_t i; wchar_t *ptr = (wchar_t *)self->b_ptr; @@ -1262,7 +1262,7 @@ WCharArray_get_value(CDataObject *self) } static int -WCharArray_set_value(CDataObject *self, PyObject *value) +WCharArray_set_value(CDataObject *self, PyObject *value, void *Py_UNUSED(ignored)) { Py_ssize_t result = 0; Py_UNICODE *wstr; @@ -3049,7 +3049,7 @@ GenericPyCData_new(PyTypeObject *type, PyObject *args, PyObject *kwds) */ static int -PyCFuncPtr_set_errcheck(PyCFuncPtrObject *self, PyObject *ob) +PyCFuncPtr_set_errcheck(PyCFuncPtrObject *self, PyObject *ob, void *Py_UNUSED(ignored)) { if (ob && !PyCallable_Check(ob)) { PyErr_SetString(PyExc_TypeError, @@ -3062,7 +3062,7 @@ PyCFuncPtr_set_errcheck(PyCFuncPtrObject *self, PyObject *ob) } static PyObject * -PyCFuncPtr_get_errcheck(PyCFuncPtrObject *self) +PyCFuncPtr_get_errcheck(PyCFuncPtrObject *self, void *Py_UNUSED(ignored)) { if (self->errcheck) { Py_INCREF(self->errcheck); @@ -3073,7 +3073,7 @@ PyCFuncPtr_get_errcheck(PyCFuncPtrObject *self) } static int -PyCFuncPtr_set_restype(PyCFuncPtrObject *self, PyObject *ob) +PyCFuncPtr_set_restype(PyCFuncPtrObject *self, PyObject *ob, void *Py_UNUSED(ignored)) { if (ob == NULL) { Py_CLEAR(self->restype); @@ -3094,7 +3094,7 @@ PyCFuncPtr_set_restype(PyCFuncPtrObject *self, PyObject *ob) } static PyObject * -PyCFuncPtr_get_restype(PyCFuncPtrObject *self) +PyCFuncPtr_get_restype(PyCFuncPtrObject *self, void *Py_UNUSED(ignored)) { StgDictObject *dict; if (self->restype) { @@ -3113,7 +3113,7 @@ PyCFuncPtr_get_restype(PyCFuncPtrObject *self) } static int -PyCFuncPtr_set_argtypes(PyCFuncPtrObject *self, PyObject *ob) +PyCFuncPtr_set_argtypes(PyCFuncPtrObject *self, PyObject *ob, void *Py_UNUSED(ignored)) { PyObject *converters; @@ -3132,7 +3132,7 @@ PyCFuncPtr_set_argtypes(PyCFuncPtrObject *self, PyObject *ob) } static PyObject * -PyCFuncPtr_get_argtypes(PyCFuncPtrObject *self) +PyCFuncPtr_get_argtypes(PyCFuncPtrObject *self, void *Py_UNUSED(ignored)) { StgDictObject *dict; if (self->argtypes) { @@ -4678,7 +4678,7 @@ PyCArrayType_from_ctype(PyObject *itemtype, Py_ssize_t length) */ static int -Simple_set_value(CDataObject *self, PyObject *value) +Simple_set_value(CDataObject *self, PyObject *value, void *Py_UNUSED(ignored)) { PyObject *result; StgDictObject *dict = PyObject_stgdict((PyObject *)self); @@ -4705,12 +4705,12 @@ Simple_init(CDataObject *self, PyObject *args, PyObject *kw) if (!PyArg_UnpackTuple(args, "__init__", 0, 1, &value)) return -1; if (value) - return Simple_set_value(self, value); + return Simple_set_value(self, value, NULL); return 0; } static PyObject * -Simple_get_value(CDataObject *self) +Simple_get_value(CDataObject *self, void *Py_UNUSED(ignored)) { StgDictObject *dict; dict = PyObject_stgdict((PyObject *)self); @@ -4733,7 +4733,7 @@ Simple_from_outparm(PyObject *self, PyObject *args) return self; } /* call stgdict->getfunc */ - return Simple_get_value((CDataObject *)self); + return Simple_get_value((CDataObject *)self, NULL); } static PyMethodDef Simple_methods[] = { @@ -4770,7 +4770,7 @@ Simple_repr(CDataObject *self) Py_TYPE(self)->tp_name, self); } - val = Simple_get_value(self); + val = Simple_get_value(self, NULL); if (val == NULL) return NULL; diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index 4ac702aa2f82..8b46466d6f00 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -1976,7 +1976,7 @@ PyCursesWindow_get_encoding(PyCursesWindowObject *self, void *closure) } static int -PyCursesWindow_set_encoding(PyCursesWindowObject *self, PyObject *value) +PyCursesWindow_set_encoding(PyCursesWindowObject *self, PyObject *value, void *Py_UNUSED(ignored)) { PyObject *ascii; char *encoding; diff --git a/Modules/_io/bytesio.c b/Modules/_io/bytesio.c index 6c54de733b95..d5884fa533de 100644 --- a/Modules/_io/bytesio.c +++ b/Modules/_io/bytesio.c @@ -201,7 +201,7 @@ write_bytes(bytesio *self, const char *bytes, Py_ssize_t len) } static PyObject * -bytesio_get_closed(bytesio *self) +bytesio_get_closed(bytesio *self, void *Py_UNUSED(ignored)) { if (self->buf == NULL) { Py_RETURN_TRUE; diff --git a/Modules/_pickle.c b/Modules/_pickle.c index 6830d93f503e..389bb6701c5f 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -4476,13 +4476,13 @@ PicklerMemoProxy_New(PicklerObject *pickler) /*****************************************************************************/ static PyObject * -Pickler_get_memo(PicklerObject *self) +Pickler_get_memo(PicklerObject *self, void *Py_UNUSED(ignored)) { return PicklerMemoProxy_New(self); } static int -Pickler_set_memo(PicklerObject *self, PyObject *obj) +Pickler_set_memo(PicklerObject *self, PyObject *obj, void *Py_UNUSED(ignored)) { PyMemoTable *new_memo = NULL; @@ -4544,7 +4544,7 @@ Pickler_set_memo(PicklerObject *self, PyObject *obj) } static PyObject * -Pickler_get_persid(PicklerObject *self) +Pickler_get_persid(PicklerObject *self, void *Py_UNUSED(ignored)) { if (self->pers_func == NULL) { PyErr_SetString(PyExc_AttributeError, "persistent_id"); @@ -4554,7 +4554,7 @@ Pickler_get_persid(PicklerObject *self) } static int -Pickler_set_persid(PicklerObject *self, PyObject *value) +Pickler_set_persid(PicklerObject *self, PyObject *value, void *Py_UNUSED(ignored)) { if (value == NULL) { PyErr_SetString(PyExc_TypeError, @@ -6908,13 +6908,13 @@ UnpicklerMemoProxy_New(UnpicklerObject *unpickler) static PyObject * -Unpickler_get_memo(UnpicklerObject *self) +Unpickler_get_memo(UnpicklerObject *self, void *Py_UNUSED(ignored)) { return UnpicklerMemoProxy_New(self); } static int -Unpickler_set_memo(UnpicklerObject *self, PyObject *obj) +Unpickler_set_memo(UnpicklerObject *self, PyObject *obj, void *Py_UNUSED(ignored)) { PyObject **new_memo; size_t new_memo_size = 0; @@ -6991,7 +6991,7 @@ Unpickler_set_memo(UnpicklerObject *self, PyObject *obj) } static PyObject * -Unpickler_get_persload(UnpicklerObject *self) +Unpickler_get_persload(UnpicklerObject *self, void *Py_UNUSED(ignored)) { if (self->pers_func == NULL) { PyErr_SetString(PyExc_AttributeError, "persistent_load"); @@ -7001,7 +7001,7 @@ Unpickler_get_persload(UnpicklerObject *self) } static int -Unpickler_set_persload(UnpicklerObject *self, PyObject *value) +Unpickler_set_persload(UnpicklerObject *self, PyObject *value, void *Py_UNUSED(ignored)) { if (value == NULL) { PyErr_SetString(PyExc_TypeError, diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c index f503288336d0..d86caef7ab60 100644 --- a/Modules/_sqlite/connection.c +++ b/Modules/_sqlite/connection.c @@ -51,7 +51,7 @@ static const char * const begin_statements[] = { NULL }; -static int pysqlite_connection_set_isolation_level(pysqlite_Connection* self, PyObject* isolation_level); +static int pysqlite_connection_set_isolation_level(pysqlite_Connection* self, PyObject* isolation_level, void *Py_UNUSED(ignored)); static void _pysqlite_drop_unused_cursor_references(pysqlite_Connection* self); @@ -136,7 +136,7 @@ int pysqlite_connection_init(pysqlite_Connection* self, PyObject* args, PyObject Py_INCREF(isolation_level); } self->isolation_level = NULL; - if (pysqlite_connection_set_isolation_level(self, isolation_level) < 0) { + if (pysqlite_connection_set_isolation_level(self, isolation_level, NULL) < 0) { Py_DECREF(isolation_level); return -1; } @@ -1162,7 +1162,8 @@ static PyObject* pysqlite_connection_get_in_transaction(pysqlite_Connection* sel Py_RETURN_FALSE; } -static int pysqlite_connection_set_isolation_level(pysqlite_Connection* self, PyObject* isolation_level) +static int +pysqlite_connection_set_isolation_level(pysqlite_Connection* self, PyObject* isolation_level, void *Py_UNUSED(ignored)) { if (isolation_level == Py_None) { PyObject *res = pysqlite_connection_commit(self, NULL); diff --git a/Modules/_sqlite/row.c b/Modules/_sqlite/row.c index 53342f3444c0..8c53f89f1bc5 100644 --- a/Modules/_sqlite/row.c +++ b/Modules/_sqlite/row.c @@ -150,7 +150,8 @@ PyObject* pysqlite_row_subscript(pysqlite_Row* self, PyObject* idx) } } -Py_ssize_t pysqlite_row_length(pysqlite_Row* self, PyObject* args, PyObject* kwargs) +static Py_ssize_t +pysqlite_row_length(pysqlite_Row* self) { return PyTuple_GET_SIZE(self->data); } diff --git a/Modules/_sre.c b/Modules/_sre.c index d09249672f8b..a4b7e72153ae 100644 --- a/Modules/_sre.c +++ b/Modules/_sre.c @@ -1424,7 +1424,7 @@ PyDoc_STRVAR(pattern_doc, "Compiled regular expression objects"); /* PatternObject's 'groupindex' method. */ static PyObject * -pattern_groupindex(PatternObject *self) +pattern_groupindex(PatternObject *self, void *Py_UNUSED(ignored)) { return PyDictProxy_New(self->groupindex); } @@ -2426,7 +2426,7 @@ PyDoc_STRVAR(match_group_doc, For 0 returns the entire match."); static PyObject * -match_lastindex_get(MatchObject *self) +match_lastindex_get(MatchObject *self, void *Py_UNUSED(ignored)) { if (self->lastindex >= 0) return PyLong_FromSsize_t(self->lastindex); @@ -2435,7 +2435,7 @@ match_lastindex_get(MatchObject *self) } static PyObject * -match_lastgroup_get(MatchObject *self) +match_lastgroup_get(MatchObject *self, void *Py_UNUSED(ignored)) { if (self->pattern->indexgroup && self->lastindex >= 0) { PyObject* result = PySequence_GetItem( @@ -2450,7 +2450,7 @@ match_lastgroup_get(MatchObject *self) } static PyObject * -match_regs_get(MatchObject *self) +match_regs_get(MatchObject *self, void *Py_UNUSED(ignored)) { if (self->regs) { Py_INCREF(self->regs); diff --git a/Modules/_testbuffer.c b/Modules/_testbuffer.c index 669794df012c..a16b96db048a 100644 --- a/Modules/_testbuffer.c +++ b/Modules/_testbuffer.c @@ -1531,7 +1531,7 @@ ndarray_getbuf(NDArrayObject *self, Py_buffer *view, int flags) return 0; } -static int +static void ndarray_releasebuf(NDArrayObject *self, Py_buffer *view) { if (!ND_IS_CONSUMER(self)) { @@ -1539,8 +1539,6 @@ ndarray_releasebuf(NDArrayObject *self, Py_buffer *view) if (--ndbuf->exports == 0 && ndbuf != self->head) ndbuf_delete(self, ndbuf); } - - return 0; } static PyBufferProcs ndarray_as_buffer = { diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index 080b44f78562..473e601556f6 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -864,7 +864,7 @@ PyTclObject_string(PyTclObject *self, void *ignored) } static PyObject * -PyTclObject_str(PyTclObject *self, void *ignored) +PyTclObject_str(PyTclObject *self) { if (self->string) { Py_INCREF(self->string); @@ -877,7 +877,7 @@ PyTclObject_str(PyTclObject *self, void *ignored) static PyObject * PyTclObject_repr(PyTclObject *self) { - PyObject *repr, *str = PyTclObject_str(self, NULL); + PyObject *repr, *str = PyTclObject_str(self); if (str == NULL) return NULL; repr = PyUnicode_FromFormat("<%s object: %R>", diff --git a/Modules/cjkcodecs/multibytecodec.c b/Modules/cjkcodecs/multibytecodec.c index d6efc77d20c8..e85ec56e0acf 100644 --- a/Modules/cjkcodecs/multibytecodec.c +++ b/Modules/cjkcodecs/multibytecodec.c @@ -108,7 +108,7 @@ call_error_callback(PyObject *errors, PyObject *exc) } static PyObject * -codecctx_errors_get(MultibyteStatefulCodecContext *self) +codecctx_errors_get(MultibyteStatefulCodecContext *self, void *Py_UNUSED(ignored)) { const char *errors; diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c index 721e5ed32ea2..dec670fa0b43 100644 --- a/Modules/mmapmodule.c +++ b/Modules/mmapmodule.c @@ -681,7 +681,7 @@ mmap_move_method(mmap_object *self, PyObject *args) } static PyObject * -mmap_closed_get(mmap_object *self) +mmap_closed_get(mmap_object *self, void *Py_UNUSED(ignored)) { #ifdef MS_WINDOWS return PyBool_FromLong(self->map_handle == NULL ? 1 : 0); diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c index 5438b697ddcd..f02f5ae4e10c 100644 --- a/Modules/selectmodule.c +++ b/Modules/selectmodule.c @@ -1026,7 +1026,7 @@ Close the devpoll file descriptor. Further operations on the devpoll\n\ object will raise an exception."); static PyObject* -devpoll_get_closed(devpollObject *self) +devpoll_get_closed(devpollObject *self, void *Py_UNUSED(ignored)) { if (self->fd_devpoll < 0) Py_RETURN_TRUE; @@ -1345,7 +1345,7 @@ Close the epoll control file descriptor. Further operations on the epoll\n\ object will raise an exception."); static PyObject* -pyepoll_get_closed(pyEpoll_Object *self) +pyepoll_get_closed(pyEpoll_Object *self, void *Py_UNUSED(ignored)) { if (self->epfd < 0) Py_RETURN_TRUE; @@ -2091,7 +2091,7 @@ Close the kqueue control file descriptor. Further operations on the kqueue\n\ object will raise an exception."); static PyObject* -kqueue_queue_get_closed(kqueue_queue_Object *self) +kqueue_queue_get_closed(kqueue_queue_Object *self, void *Py_UNUSED(ignored)) { if (self->kqfd < 0) Py_RETURN_TRUE; diff --git a/Modules/xxsubtype.c b/Modules/xxsubtype.c index 11242d739138..d2593b12d602 100644 --- a/Modules/xxsubtype.c +++ b/Modules/xxsubtype.c @@ -89,7 +89,7 @@ spamlist_init(spamlistobject *self, PyObject *args, PyObject *kwds) } static PyObject * -spamlist_state_get(spamlistobject *self) +spamlist_state_get(spamlistobject *self, void *Py_UNUSED(ignored)) { return PyLong_FromLong(self->state); } diff --git a/Objects/descrobject.c b/Objects/descrobject.c index 9020ccd32547..9d258cf111d1 100644 --- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -378,7 +378,7 @@ calculate_qualname(PyDescrObject *descr) } static PyObject * -descr_get_qualname(PyDescrObject *descr) +descr_get_qualname(PyDescrObject *descr, void *Py_UNUSED(ignored)) { if (descr->d_qualname == NULL) descr->d_qualname = calculate_qualname(descr); @@ -1118,7 +1118,7 @@ static PyMemberDef wrapper_members[] = { }; static PyObject * -wrapper_objclass(wrapperobject *wp) +wrapper_objclass(wrapperobject *wp, void *Py_UNUSED(ignored)) { PyObject *c = (PyObject *)PyDescr_TYPE(wp->descr); @@ -1127,7 +1127,7 @@ wrapper_objclass(wrapperobject *wp) } static PyObject * -wrapper_name(wrapperobject *wp) +wrapper_name(wrapperobject *wp, void *Py_UNUSED(ignored)) { const char *s = wp->descr->d_base->name; @@ -1135,21 +1135,21 @@ wrapper_name(wrapperobject *wp) } static PyObject * -wrapper_doc(wrapperobject *wp, void *closure) +wrapper_doc(wrapperobject *wp, void *Py_UNUSED(ignored)) { return _PyType_GetDocFromInternalDoc(wp->descr->d_base->name, wp->descr->d_base->doc); } static PyObject * -wrapper_text_signature(wrapperobject *wp, void *closure) +wrapper_text_signature(wrapperobject *wp, void *Py_UNUSED(ignored)) { return _PyType_GetTextSignatureFromInternalDoc(wp->descr->d_base->name, wp->descr->d_base->doc); } static PyObject * -wrapper_qualname(wrapperobject *wp) +wrapper_qualname(wrapperobject *wp, void *Py_UNUSED(ignored)) { - return descr_get_qualname((PyDescrObject *)wp->descr); + return descr_get_qualname((PyDescrObject *)wp->descr, NULL); } static PyGetSetDef wrapper_getsets[] = { diff --git a/Objects/exceptions.c b/Objects/exceptions.c index 3bec50ea69e4..6f3b986d3247 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -181,7 +181,7 @@ static PyMethodDef BaseException_methods[] = { }; static PyObject * -BaseException_get_args(PyBaseExceptionObject *self) +BaseException_get_args(PyBaseExceptionObject *self, void *Py_UNUSED(ignored)) { if (self->args == NULL) { Py_INCREF(Py_None); @@ -192,7 +192,7 @@ BaseException_get_args(PyBaseExceptionObject *self) } static int -BaseException_set_args(PyBaseExceptionObject *self, PyObject *val) +BaseException_set_args(PyBaseExceptionObject *self, PyObject *val, void *Py_UNUSED(ignored)) { PyObject *seq; if (val == NULL) { @@ -207,7 +207,7 @@ BaseException_set_args(PyBaseExceptionObject *self, PyObject *val) } static PyObject * -BaseException_get_tb(PyBaseExceptionObject *self) +BaseException_get_tb(PyBaseExceptionObject *self, void *Py_UNUSED(ignored)) { if (self->traceback == NULL) { Py_INCREF(Py_None); @@ -218,7 +218,7 @@ BaseException_get_tb(PyBaseExceptionObject *self) } static int -BaseException_set_tb(PyBaseExceptionObject *self, PyObject *tb) +BaseException_set_tb(PyBaseExceptionObject *self, PyObject *tb, void *Py_UNUSED(ignored)) { if (tb == NULL) { PyErr_SetString(PyExc_TypeError, "__traceback__ may not be deleted"); @@ -236,7 +236,8 @@ BaseException_set_tb(PyBaseExceptionObject *self, PyObject *tb) } static PyObject * -BaseException_get_context(PyObject *self) { +BaseException_get_context(PyObject *self, void *Py_UNUSED(ignored)) +{ PyObject *res = PyException_GetContext(self); if (res) return res; /* new reference already returned above */ @@ -244,7 +245,8 @@ BaseException_get_context(PyObject *self) { } static int -BaseException_set_context(PyObject *self, PyObject *arg) { +BaseException_set_context(PyObject *self, PyObject *arg, void *Py_UNUSED(ignored)) +{ if (arg == NULL) { PyErr_SetString(PyExc_TypeError, "__context__ may not be deleted"); return -1; @@ -263,7 +265,8 @@ BaseException_set_context(PyObject *self, PyObject *arg) { } static PyObject * -BaseException_get_cause(PyObject *self) { +BaseException_get_cause(PyObject *self, void *Py_UNUSED(ignored)) +{ PyObject *res = PyException_GetCause(self); if (res) return res; /* new reference already returned above */ @@ -271,7 +274,8 @@ BaseException_get_cause(PyObject *self) { } static int -BaseException_set_cause(PyObject *self, PyObject *arg) { +BaseException_set_cause(PyObject *self, PyObject *arg, void *Py_UNUSED(ignored)) +{ if (arg == NULL) { PyErr_SetString(PyExc_TypeError, "__cause__ may not be deleted"); return -1; @@ -294,10 +298,10 @@ static PyGetSetDef BaseException_getset[] = { {"__dict__", PyObject_GenericGetDict, PyObject_GenericSetDict}, {"args", (getter)BaseException_get_args, (setter)BaseException_set_args}, {"__traceback__", (getter)BaseException_get_tb, (setter)BaseException_set_tb}, - {"__context__", (getter)BaseException_get_context, - (setter)BaseException_set_context, PyDoc_STR("exception context")}, - {"__cause__", (getter)BaseException_get_cause, - (setter)BaseException_set_cause, PyDoc_STR("exception cause")}, + {"__context__", BaseException_get_context, + BaseException_set_context, PyDoc_STR("exception context")}, + {"__cause__", BaseException_get_cause, + BaseException_set_cause, PyDoc_STR("exception cause")}, {NULL}, }; @@ -312,7 +316,7 @@ PyException_GetTraceback(PyObject *self) { int PyException_SetTraceback(PyObject *self, PyObject *tb) { - return BaseException_set_tb((PyBaseExceptionObject *)self, tb); + return BaseException_set_tb((PyBaseExceptionObject *)self, tb, NULL); } PyObject * diff --git a/Objects/frameobject.c b/Objects/frameobject.c index b7a16ad05966..535ec46ee027 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -61,7 +61,7 @@ frame_getlineno(PyFrameObject *f, void *closure) * that time. */ static int -frame_setlineno(PyFrameObject *f, PyObject* p_new_lineno) +frame_setlineno(PyFrameObject *f, PyObject* p_new_lineno, void *Py_UNUSED(ignored)) { int new_lineno = 0; /* The new value of f_lineno */ long l_new_lineno; @@ -521,7 +521,7 @@ frame_traverse(PyFrameObject *f, visitproc visit, void *arg) return 0; } -static void +static int frame_tp_clear(PyFrameObject *f) { PyObject **fastlocals, **p, **oldtop; @@ -552,6 +552,7 @@ frame_tp_clear(PyFrameObject *f) for (p = f->f_valuestack; p < oldtop; p++) Py_CLEAR(*p); } + return 0; } static PyObject * @@ -566,7 +567,7 @@ frame_clear(PyFrameObject *f) _PyGen_Finalize(f->f_gen); assert(f->f_gen == NULL); } - frame_tp_clear(f); + (void)frame_tp_clear(f); Py_RETURN_NONE; } diff --git a/Objects/funcobject.c b/Objects/funcobject.c index 6ce0cb43e5e9..e66fda369217 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c @@ -240,14 +240,14 @@ static PyMemberDef func_memberlist[] = { }; static PyObject * -func_get_code(PyFunctionObject *op) +func_get_code(PyFunctionObject *op, void *Py_UNUSED(ignored)) { Py_INCREF(op->func_code); return op->func_code; } static int -func_set_code(PyFunctionObject *op, PyObject *value) +func_set_code(PyFunctionObject *op, PyObject *value, void *Py_UNUSED(ignored)) { Py_ssize_t nfree, nclosure; @@ -275,14 +275,14 @@ func_set_code(PyFunctionObject *op, PyObject *value) } static PyObject * -func_get_name(PyFunctionObject *op) +func_get_name(PyFunctionObject *op, void *Py_UNUSED(ignored)) { Py_INCREF(op->func_name); return op->func_name; } static int -func_set_name(PyFunctionObject *op, PyObject *value) +func_set_name(PyFunctionObject *op, PyObject *value, void *Py_UNUSED(ignored)) { /* Not legal to del f.func_name or to set it to anything * other than a string object. */ @@ -297,14 +297,14 @@ func_set_name(PyFunctionObject *op, PyObject *value) } static PyObject * -func_get_qualname(PyFunctionObject *op) +func_get_qualname(PyFunctionObject *op, void *Py_UNUSED(ignored)) { Py_INCREF(op->func_qualname); return op->func_qualname; } static int -func_set_qualname(PyFunctionObject *op, PyObject *value) +func_set_qualname(PyFunctionObject *op, PyObject *value, void *Py_UNUSED(ignored)) { /* Not legal to del f.__qualname__ or to set it to anything * other than a string object. */ @@ -319,7 +319,7 @@ func_set_qualname(PyFunctionObject *op, PyObject *value) } static PyObject * -func_get_defaults(PyFunctionObject *op) +func_get_defaults(PyFunctionObject *op, void *Py_UNUSED(ignored)) { if (op->func_defaults == NULL) { Py_INCREF(Py_None); @@ -330,7 +330,7 @@ func_get_defaults(PyFunctionObject *op) } static int -func_set_defaults(PyFunctionObject *op, PyObject *value) +func_set_defaults(PyFunctionObject *op, PyObject *value, void *Py_UNUSED(ignored)) { /* Legal to del f.func_defaults. * Can only set func_defaults to NULL or a tuple. */ @@ -347,7 +347,7 @@ func_set_defaults(PyFunctionObject *op, PyObject *value) } static PyObject * -func_get_kwdefaults(PyFunctionObject *op) +func_get_kwdefaults(PyFunctionObject *op, void *Py_UNUSED(ignored)) { if (op->func_kwdefaults == NULL) { Py_INCREF(Py_None); @@ -358,7 +358,7 @@ func_get_kwdefaults(PyFunctionObject *op) } static int -func_set_kwdefaults(PyFunctionObject *op, PyObject *value) +func_set_kwdefaults(PyFunctionObject *op, PyObject *value, void *Py_UNUSED(ignored)) { if (value == Py_None) value = NULL; @@ -375,7 +375,7 @@ func_set_kwdefaults(PyFunctionObject *op, PyObject *value) } static PyObject * -func_get_annotations(PyFunctionObject *op) +func_get_annotations(PyFunctionObject *op, void *Py_UNUSED(ignored)) { if (op->func_annotations == NULL) { op->func_annotations = PyDict_New(); @@ -387,7 +387,7 @@ func_get_annotations(PyFunctionObject *op) } static int -func_set_annotations(PyFunctionObject *op, PyObject *value) +func_set_annotations(PyFunctionObject *op, PyObject *value, void *Py_UNUSED(ignored)) { if (value == Py_None) value = NULL; diff --git a/Objects/genobject.c b/Objects/genobject.c index f226dbebaf4a..d1136301f018 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -665,14 +665,14 @@ gen_repr(PyGenObject *gen) } static PyObject * -gen_get_name(PyGenObject *op) +gen_get_name(PyGenObject *op, void *Py_UNUSED(ignored)) { Py_INCREF(op->gi_name); return op->gi_name; } static int -gen_set_name(PyGenObject *op, PyObject *value) +gen_set_name(PyGenObject *op, PyObject *value, void *Py_UNUSED(ignored)) { /* Not legal to del gen.gi_name or to set it to anything * other than a string object. */ @@ -687,14 +687,14 @@ gen_set_name(PyGenObject *op, PyObject *value) } static PyObject * -gen_get_qualname(PyGenObject *op) +gen_get_qualname(PyGenObject *op, void *Py_UNUSED(ignored)) { Py_INCREF(op->gi_qualname); return op->gi_qualname; } static int -gen_set_qualname(PyGenObject *op, PyObject *value) +gen_set_qualname(PyGenObject *op, PyObject *value, void *Py_UNUSED(ignored)) { /* Not legal to del gen.__qualname__ or to set it to anything * other than a string object. */ @@ -709,7 +709,7 @@ gen_set_qualname(PyGenObject *op, PyObject *value) } static PyObject * -gen_getyieldfrom(PyGenObject *gen) +gen_getyieldfrom(PyGenObject *gen, void *Py_UNUSED(ignored)) { PyObject *yf = _PyGen_yf(gen); if (yf == NULL) @@ -944,7 +944,7 @@ coro_await(PyCoroObject *coro) } static PyObject * -coro_get_cr_await(PyCoroObject *coro) +coro_get_cr_await(PyCoroObject *coro, void *Py_UNUSED(ignored)) { PyObject *yf = _PyGen_yf((PyGenObject *) coro); if (yf == NULL) diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c index e1ac7281783f..30e00554794e 100644 --- a/Objects/memoryobject.c +++ b/Objects/memoryobject.c @@ -2903,7 +2903,7 @@ _IntTupleFromSsizet(int len, Py_ssize_t *vals) } static PyObject * -memory_obj_get(PyMemoryViewObject *self) +memory_obj_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored)) { Py_buffer *view = &self->view; @@ -2916,56 +2916,56 @@ memory_obj_get(PyMemoryViewObject *self) } static PyObject * -memory_nbytes_get(PyMemoryViewObject *self) +memory_nbytes_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored)) { CHECK_RELEASED(self); return PyLong_FromSsize_t(self->view.len); } static PyObject * -memory_format_get(PyMemoryViewObject *self) +memory_format_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored)) { CHECK_RELEASED(self); return PyUnicode_FromString(self->view.format); } static PyObject * -memory_itemsize_get(PyMemoryViewObject *self) +memory_itemsize_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored)) { CHECK_RELEASED(self); return PyLong_FromSsize_t(self->view.itemsize); } static PyObject * -memory_shape_get(PyMemoryViewObject *self) +memory_shape_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored)) { CHECK_RELEASED(self); return _IntTupleFromSsizet(self->view.ndim, self->view.shape); } static PyObject * -memory_strides_get(PyMemoryViewObject *self) +memory_strides_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored)) { CHECK_RELEASED(self); return _IntTupleFromSsizet(self->view.ndim, self->view.strides); } static PyObject * -memory_suboffsets_get(PyMemoryViewObject *self) +memory_suboffsets_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored)) { CHECK_RELEASED(self); return _IntTupleFromSsizet(self->view.ndim, self->view.suboffsets); } static PyObject * -memory_readonly_get(PyMemoryViewObject *self) +memory_readonly_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored)) { CHECK_RELEASED(self); return PyBool_FromLong(self->view.readonly); } static PyObject * -memory_ndim_get(PyMemoryViewObject *self) +memory_ndim_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored)) { CHECK_RELEASED(self); return PyLong_FromLong(self->view.ndim); diff --git a/Python/traceback.c b/Python/traceback.c index 145d028ba353..f489a4727643 100644 --- a/Python/traceback.c +++ b/Python/traceback.c @@ -65,11 +65,12 @@ tb_traverse(PyTracebackObject *tb, visitproc visit, void *arg) return 0; } -static void +static int tb_clear(PyTracebackObject *tb) { Py_CLEAR(tb->tb_next); Py_CLEAR(tb->tb_frame); + return 0; } PyTypeObject PyTraceBack_Type = { From webhook-mailer at python.org Tue Nov 27 13:39:54 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Tue, 27 Nov 2018 18:39:54 -0000 Subject: [Python-checkins] bpo-35312: Make lib2to3.pgen2.parse.ParseError round-trip pickle-able. (GH-10710) Message-ID: https://github.com/python/cpython/commit/c57e6e2e52d5d8b4005753bed789d99ebe407fb6 commit: c57e6e2e52d5d8b4005753bed789d99ebe407fb6 branch: master author: Anthony Sottile committer: Serhiy Storchaka date: 2018-11-27T20:39:49+02:00 summary: bpo-35312: Make lib2to3.pgen2.parse.ParseError round-trip pickle-able. (GH-10710) files: A Misc/NEWS.d/next/Library/2018-11-25-20-05-33.bpo-35312.wbw0zO.rst M Lib/lib2to3/pgen2/parse.py M Lib/lib2to3/tests/test_parser.py diff --git a/Lib/lib2to3/pgen2/parse.py b/Lib/lib2to3/pgen2/parse.py index 6bebdbba7e52..cf3fcf7e99fd 100644 --- a/Lib/lib2to3/pgen2/parse.py +++ b/Lib/lib2to3/pgen2/parse.py @@ -24,6 +24,9 @@ def __init__(self, msg, type, value, context): self.value = value self.context = context + def __reduce__(self): + return type(self), (self.msg, self.type, self.value, self.context) + class Parser(object): """Parser engine. diff --git a/Lib/lib2to3/tests/test_parser.py b/Lib/lib2to3/tests/test_parser.py index 829e5a72924a..01b2b51e4ab6 100644 --- a/Lib/lib2to3/tests/test_parser.py +++ b/Lib/lib2to3/tests/test_parser.py @@ -622,6 +622,18 @@ def test_multiline_str_literals(self): self.validate(s) +class TestPickleableException(unittest.TestCase): + def test_ParseError(self): + err = ParseError('msg', 2, None, (1, 'context')) + for proto in range(pickle.HIGHEST_PROTOCOL + 1): + err2 = pickle.loads(pickle.dumps(err, protocol=proto)) + self.assertEqual(err.args, err2.args) + self.assertEqual(err.msg, err2.msg) + self.assertEqual(err.type, err2.type) + self.assertEqual(err.value, err2.value) + self.assertEqual(err.context, err2.context) + + def diff_texts(a, b, filename): a = a.splitlines() b = b.splitlines() diff --git a/Misc/NEWS.d/next/Library/2018-11-25-20-05-33.bpo-35312.wbw0zO.rst b/Misc/NEWS.d/next/Library/2018-11-25-20-05-33.bpo-35312.wbw0zO.rst new file mode 100644 index 000000000000..c195468b9e27 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-11-25-20-05-33.bpo-35312.wbw0zO.rst @@ -0,0 +1 @@ +Make ``lib2to3.pgen2.parse.ParseError`` round-trip pickle-able. Patch by Anthony Sottile. From webhook-mailer at python.org Tue Nov 27 13:51:11 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 27 Nov 2018 18:51:11 -0000 Subject: [Python-checkins] bpo-33012: Fix signatures of METH_NOARGS functions. (GH-10736) (GH-10748) Message-ID: https://github.com/python/cpython/commit/d5c8bd8e4cc04873254f0bd38895a6479c23c8aa commit: d5c8bd8e4cc04873254f0bd38895a6479c23c8aa branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-27T10:51:07-08:00 summary: bpo-33012: Fix signatures of METH_NOARGS functions. (GH-10736) (GH-10748) (cherry picked from commit 81524022d0c0df7a41f9b2b2df41e2ebe140e610) (cherry picked from commit ad8ac54aa3d2323bdb5feb5e858a922840358187) Co-authored-by: Serhiy Storchaka files: M Modules/_collectionsmodule.c M Modules/_cursesmodule.c M Modules/_testcapimodule.c M Objects/odictobject.c diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c index 4fbf3bdb1463..25006fa2c975 100644 --- a/Modules/_collectionsmodule.c +++ b/Modules/_collectionsmodule.c @@ -1341,7 +1341,7 @@ deque_traverse(dequeobject *deque, visitproc visit, void *arg) } static PyObject * -deque_reduce(dequeobject *deque) +deque_reduce(dequeobject *deque, PyObject *Py_UNUSED(ignored)) { PyObject *dict, *it; _Py_IDENTIFIER(__dict__); diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index 8b46466d6f00..c048a7ddf2da 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -414,27 +414,27 @@ PyTypeObject PyCursesWindow_Type; PARSESTR - format string for argument parsing */ -#define Window_NoArgNoReturnFunction(X) \ - static PyObject *PyCursesWindow_ ## X \ - (PyCursesWindowObject *self, PyObject *args) \ +#define Window_NoArgNoReturnFunction(X) \ + static PyObject *PyCursesWindow_ ## X \ + (PyCursesWindowObject *self, PyObject *Py_UNUSED(ignored)) \ { return PyCursesCheckERR(X(self->win), # X); } #define Window_NoArgTrueFalseFunction(X) \ static PyObject * PyCursesWindow_ ## X \ - (PyCursesWindowObject *self) \ + (PyCursesWindowObject *self, PyObject *Py_UNUSED(ignored)) \ { \ if (X (self->win) == FALSE) { Py_INCREF(Py_False); return Py_False; } \ else { Py_INCREF(Py_True); return Py_True; } } #define Window_NoArgNoReturnVoidFunction(X) \ static PyObject * PyCursesWindow_ ## X \ - (PyCursesWindowObject *self) \ + (PyCursesWindowObject *self, PyObject *Py_UNUSED(ignored)) \ { \ X(self->win); Py_INCREF(Py_None); return Py_None; } #define Window_NoArg2TupleReturnFunction(X, TYPE, ERGSTR) \ static PyObject * PyCursesWindow_ ## X \ - (PyCursesWindowObject *self) \ + (PyCursesWindowObject *self, PyObject *Py_UNUSED(ignored)) \ { \ TYPE arg1, arg2; \ X(self->win,arg1,arg2); return Py_BuildValue(ERGSTR, arg1, arg2); } diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index 556d49bb3c83..067d46346a68 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -952,7 +952,7 @@ test_buildvalue_N_error(const char *fmt) } static PyObject * -test_buildvalue_N(PyObject *self, PyObject *noargs) +test_buildvalue_N(PyObject *self, PyObject *Py_UNUSED(ignored)) { PyObject *arg, *res; @@ -2351,7 +2351,7 @@ pending_threadfunc(PyObject *self, PyObject *arg) /* Some tests of PyUnicode_FromFormat(). This needs more tests. */ static PyObject * -test_string_from_format(PyObject *self, PyObject *args) +test_string_from_format(PyObject *self, PyObject *Py_UNUSED(ignored)) { PyObject *result; char *msg; @@ -2491,7 +2491,7 @@ typedef struct { } known_capsule; static PyObject * -test_capsule(PyObject *self, PyObject *args) +test_capsule(PyObject *self, PyObject *Py_UNUSED(ignored)) { PyObject *object; const char *error = NULL; @@ -2863,7 +2863,7 @@ make_memoryview_from_NULL_pointer(PyObject *self) } static PyObject * -test_from_contiguous(PyObject* self, PyObject *noargs) +test_from_contiguous(PyObject* self, PyObject *Py_UNUSED(ignored)) { int data[9] = {-1,-1,-1,-1,-1,-1,-1,-1,-1}; int init[5] = {0, 1, 2, 3, 4}; @@ -2916,7 +2916,7 @@ test_from_contiguous(PyObject* self, PyObject *noargs) extern PyTypeObject _PyBytesIOBuffer_Type; static PyObject * -test_pep3118_obsolete_write_locks(PyObject* self, PyObject *noargs) +test_pep3118_obsolete_write_locks(PyObject* self, PyObject *Py_UNUSED(ignored)) { PyTypeObject *type = &_PyBytesIOBuffer_Type; PyObject *b; diff --git a/Objects/odictobject.c b/Objects/odictobject.c index f433cd2f4cec..fdeda43bbd81 100644 --- a/Objects/odictobject.c +++ b/Objects/odictobject.c @@ -1889,7 +1889,7 @@ odictiter_iternext(odictiterobject *di) PyDoc_STRVAR(reduce_doc, "Return state information for pickling"); static PyObject * -odictiter_reduce(odictiterobject *di) +odictiter_reduce(odictiterobject *di, PyObject *Py_UNUSED(ignored)) { /* copy the iterator state */ odictiterobject tmp = *di; From webhook-mailer at python.org Tue Nov 27 14:34:37 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Tue, 27 Nov 2018 19:34:37 -0000 Subject: [Python-checkins] bpo-33012: Fix more invalid function cast warnings with gcc 8. (GH-10751) Message-ID: https://github.com/python/cpython/commit/1c607155c9e363489036ae6258b165a3fae75134 commit: 1c607155c9e363489036ae6258b165a3fae75134 branch: master author: Serhiy Storchaka committer: GitHub date: 2018-11-27T21:34:27+02:00 summary: bpo-33012: Fix more invalid function cast warnings with gcc 8. (GH-10751) Fix warnings with gcc 8 for wrapperfunc <-> wrapperfunc_kwds casts. files: M Objects/descrobject.c M Objects/typeobject.c diff --git a/Objects/descrobject.c b/Objects/descrobject.c index d8dbfa9a4792..e129d0c48f27 100644 --- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -346,7 +346,7 @@ wrapperdescr_raw_call(PyWrapperDescrObject *descr, PyObject *self, wrapperfunc wrapper = descr->d_base->wrapper; if (descr->d_base->flags & PyWrapperFlag_KEYWORDS) { - wrapperfunc_kwds wk = (wrapperfunc_kwds)wrapper; + wrapperfunc_kwds wk = (wrapperfunc_kwds)(void(*)(void))wrapper; return (*wk)(self, args, descr->d_wrapped, kwds); } diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 73d385b0f8a0..d1f1e8cd24b7 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -6822,7 +6822,7 @@ static slotdef slotdefs[] = { "__repr__($self, /)\n--\n\nReturn repr(self)."), TPSLOT("__hash__", tp_hash, slot_tp_hash, wrap_hashfunc, "__hash__($self, /)\n--\n\nReturn hash(self)."), - FLSLOT("__call__", tp_call, slot_tp_call, (wrapperfunc)wrap_call, + FLSLOT("__call__", tp_call, slot_tp_call, (wrapperfunc)(void(*)(void))wrap_call, "__call__($self, /, *args, **kwargs)\n--\n\nCall self as a function.", PyWrapperFlag_KEYWORDS), TPSLOT("__str__", tp_str, slot_tp_str, wrap_unaryfunc, @@ -6858,7 +6858,7 @@ static slotdef slotdefs[] = { TPSLOT("__delete__", tp_descr_set, slot_tp_descr_set, wrap_descr_delete, "__delete__($self, instance, /)\n--\n\nDelete an attribute of instance."), - FLSLOT("__init__", tp_init, slot_tp_init, (wrapperfunc)wrap_init, + FLSLOT("__init__", tp_init, slot_tp_init, (wrapperfunc)(void(*)(void))wrap_init, "__init__($self, /, *args, **kwargs)\n--\n\n" "Initialize self. See help(type(self)) for accurate signature.", PyWrapperFlag_KEYWORDS), From webhook-mailer at python.org Tue Nov 27 17:55:03 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 27 Nov 2018 22:55:03 -0000 Subject: [Python-checkins] bpo-35134: Don't define types twice in header files (GH-10754) Message-ID: https://github.com/python/cpython/commit/9bdd2de84c1af55fbc006d3f892313623bd0195c commit: 9bdd2de84c1af55fbc006d3f892313623bd0195c branch: master author: Victor Stinner committer: GitHub date: 2018-11-27T23:54:59+01:00 summary: bpo-35134: Don't define types twice in header files (GH-10754) Fix the following clang warning: Include/cpython/pystate.h:217:3: warning: redefinition of typedef 'PyThreadState' is a C11 feature [-Wtypedef-redefinition] files: M Include/object.h M Include/pystate.h diff --git a/Include/object.h b/Include/object.h index 21c29e7bdb00..a729335750c7 100644 --- a/Include/object.h +++ b/Include/object.h @@ -175,8 +175,12 @@ typedef int (*initproc)(PyObject *, PyObject *, PyObject *); typedef PyObject *(*newfunc)(struct _typeobject *, PyObject *, PyObject *); typedef PyObject *(*allocfunc)(struct _typeobject *, Py_ssize_t); +#ifdef Py_LIMITED_API /* In Py_LIMITED_API, PyTypeObject is an opaque structure. */ typedef struct _typeobject PyTypeObject; +#else +/* PyTypeObject is defined in cpython/object.h */ +#endif typedef struct{ int slot; /* slot id, see below */ @@ -196,30 +200,30 @@ PyAPI_FUNC(PyObject*) PyType_FromSpec(PyType_Spec*); PyAPI_FUNC(PyObject*) PyType_FromSpecWithBases(PyType_Spec*, PyObject*); #endif #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03040000 -PyAPI_FUNC(void*) PyType_GetSlot(PyTypeObject*, int); +PyAPI_FUNC(void*) PyType_GetSlot(struct _typeobject*, int); #endif /* Generic type check */ -PyAPI_FUNC(int) PyType_IsSubtype(PyTypeObject *, PyTypeObject *); +PyAPI_FUNC(int) PyType_IsSubtype(struct _typeobject *, struct _typeobject *); #define PyObject_TypeCheck(ob, tp) \ (Py_TYPE(ob) == (tp) || PyType_IsSubtype(Py_TYPE(ob), (tp))) -PyAPI_DATA(PyTypeObject) PyType_Type; /* built-in 'type' */ -PyAPI_DATA(PyTypeObject) PyBaseObject_Type; /* built-in 'object' */ -PyAPI_DATA(PyTypeObject) PySuper_Type; /* built-in 'super' */ +PyAPI_DATA(struct _typeobject) PyType_Type; /* built-in 'type' */ +PyAPI_DATA(struct _typeobject) PyBaseObject_Type; /* built-in 'object' */ +PyAPI_DATA(struct _typeobject) PySuper_Type; /* built-in 'super' */ -PyAPI_FUNC(unsigned long) PyType_GetFlags(PyTypeObject*); +PyAPI_FUNC(unsigned long) PyType_GetFlags(struct _typeobject*); #define PyType_Check(op) \ PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TYPE_SUBCLASS) #define PyType_CheckExact(op) (Py_TYPE(op) == &PyType_Type) -PyAPI_FUNC(int) PyType_Ready(PyTypeObject *); -PyAPI_FUNC(PyObject *) PyType_GenericAlloc(PyTypeObject *, Py_ssize_t); -PyAPI_FUNC(PyObject *) PyType_GenericNew(PyTypeObject *, +PyAPI_FUNC(int) PyType_Ready(struct _typeobject *); +PyAPI_FUNC(PyObject *) PyType_GenericAlloc(struct _typeobject *, Py_ssize_t); +PyAPI_FUNC(PyObject *) PyType_GenericNew(struct _typeobject *, PyObject *, PyObject *); PyAPI_FUNC(unsigned int) PyType_ClearCache(void); -PyAPI_FUNC(void) PyType_Modified(PyTypeObject *); +PyAPI_FUNC(void) PyType_Modified(struct _typeobject *); /* Generic operations on objects */ PyAPI_FUNC(PyObject *) PyObject_Repr(PyObject *); @@ -397,8 +401,8 @@ PyAPI_FUNC(void) _PyDebug_PrintTotalRefs(void); #endif /* Py_REF_DEBUG */ #ifdef COUNT_ALLOCS -PyAPI_FUNC(void) _Py_inc_count(PyTypeObject *); -PyAPI_FUNC(void) _Py_dec_count(PyTypeObject *); +PyAPI_FUNC(void) _Py_inc_count(struct _typeobject *); +PyAPI_FUNC(void) _Py_dec_count(struct _typeobject *); #define _Py_INC_TPALLOCS(OP) _Py_inc_count(Py_TYPE(OP)) #define _Py_INC_TPFREES(OP) _Py_dec_count(Py_TYPE(OP)) #define _Py_DEC_TPFREES(OP) Py_TYPE(OP)->tp_frees-- diff --git a/Include/pystate.h b/Include/pystate.h index cc479ff867a4..ba5e9883306a 100644 --- a/Include/pystate.h +++ b/Include/pystate.h @@ -14,25 +14,28 @@ extern "C" { removed (with effort). */ #define MAX_CO_EXTRA_USERS 255 -/* State shared between threads */ - -struct _ts; /* Forward */ -struct _is; /* Forward */ -struct _frame; /* Forward declaration for PyFrameObject. */ +/* Forward declarations for PyFrameObject, PyThreadState + and PyInterpreterState */ +struct _frame; +struct _ts; +struct _is; +#ifdef Py_LIMITED_API +typedef struct _ts PyThreadState; typedef struct _is PyInterpreterState; +#else +/* PyThreadState and PyInterpreterState are defined in cpython/pystate.h */ +#endif /* State unique per thread */ -typedef struct _ts PyThreadState; - -PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_New(void); -PyAPI_FUNC(void) PyInterpreterState_Clear(PyInterpreterState *); -PyAPI_FUNC(void) PyInterpreterState_Delete(PyInterpreterState *); +PyAPI_FUNC(struct _is *) PyInterpreterState_New(void); +PyAPI_FUNC(void) PyInterpreterState_Clear(struct _is *); +PyAPI_FUNC(void) PyInterpreterState_Delete(struct _is *); #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03070000 /* New in 3.7 */ -PyAPI_FUNC(int64_t) PyInterpreterState_GetID(PyInterpreterState *); +PyAPI_FUNC(int64_t) PyInterpreterState_GetID(struct _is *); #endif #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 /* New in 3.3 */ @@ -41,9 +44,9 @@ PyAPI_FUNC(int) PyState_RemoveModule(struct PyModuleDef*); #endif PyAPI_FUNC(PyObject*) PyState_FindModule(struct PyModuleDef*); -PyAPI_FUNC(PyThreadState *) PyThreadState_New(PyInterpreterState *); -PyAPI_FUNC(void) PyThreadState_Clear(PyThreadState *); -PyAPI_FUNC(void) PyThreadState_Delete(PyThreadState *); +PyAPI_FUNC(struct _ts *) PyThreadState_New(struct _is *); +PyAPI_FUNC(void) PyThreadState_Clear(struct _ts *); +PyAPI_FUNC(void) PyThreadState_Delete(struct _ts *); PyAPI_FUNC(void) PyThreadState_DeleteCurrent(void); /* Get the current thread state. @@ -54,7 +57,7 @@ PyAPI_FUNC(void) PyThreadState_DeleteCurrent(void); The caller must hold the GIL. See also PyThreadState_GET() and _PyThreadState_GET(). */ -PyAPI_FUNC(PyThreadState *) PyThreadState_Get(void); +PyAPI_FUNC(struct _ts *) PyThreadState_Get(void); /* Get the current Python thread state. @@ -67,7 +70,7 @@ PyAPI_FUNC(PyThreadState *) PyThreadState_Get(void); See also PyThreadState_Get() and _PyThreadState_GET(). */ #define PyThreadState_GET() PyThreadState_Get() -PyAPI_FUNC(PyThreadState *) PyThreadState_Swap(PyThreadState *); +PyAPI_FUNC(struct _ts *) PyThreadState_Swap(struct _ts *); PyAPI_FUNC(PyObject *) PyThreadState_GetDict(void); PyAPI_FUNC(int) PyThreadState_SetAsyncExc(unsigned long, PyObject *); @@ -115,7 +118,7 @@ PyAPI_FUNC(void) PyGILState_Release(PyGILState_STATE); thread-state, even if no auto-thread-state call has been made on the main thread. */ -PyAPI_FUNC(PyThreadState *) PyGILState_GetThisThreadState(void); +PyAPI_FUNC(struct _ts *) PyGILState_GetThisThreadState(void); #ifndef Py_LIMITED_API From webhook-mailer at python.org Tue Nov 27 19:14:37 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 28 Nov 2018 00:14:37 -0000 Subject: [Python-checkins] bpo-33676: Fix dangling thread in _test_multiprocessing (GH-10755) Message-ID: https://github.com/python/cpython/commit/b7278736b3ae158a7738057e3045bc767ced019e commit: b7278736b3ae158a7738057e3045bc767ced019e branch: master author: Victor Stinner committer: GitHub date: 2018-11-28T01:14:31+01:00 summary: bpo-33676: Fix dangling thread in _test_multiprocessing (GH-10755) Fix WithThreadsTestPool.test_wrapped_exception() of test_multiprocessing_fork: join the pool. WithThreadsTestPool.test_del_pool() is now also decorated with @support.reap_threads. files: M Lib/test/_test_multiprocessing.py diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index 4302708c14f1..b62c119e9ae0 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -2522,6 +2522,7 @@ def test_wrapped_exception(self): with self.Pool(1) as p: with self.assertRaises(RuntimeError): p.apply(self._test_wrapped_exception) + p.join() def test_map_no_failfast(self): # Issue #23992: the fail-fast behaviour when an exception is raised @@ -2557,6 +2558,7 @@ def test_release_task_refs(self): # they were released too. self.assertEqual(CountedObject.n_instances, 0) + @support.reap_threads def test_del_pool(self): p = self.Pool(1) wr = weakref.ref(p) From webhook-mailer at python.org Tue Nov 27 19:30:38 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 28 Nov 2018 00:30:38 -0000 Subject: [Python-checkins] bpo-33676: Fix dangling thread in _test_multiprocessing (GH-10755) Message-ID: https://github.com/python/cpython/commit/80db40cdd6a58c9d66694a43ee9a7c06ab958373 commit: 80db40cdd6a58c9d66694a43ee9a7c06ab958373 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-27T16:30:34-08:00 summary: bpo-33676: Fix dangling thread in _test_multiprocessing (GH-10755) Fix WithThreadsTestPool.test_wrapped_exception() of test_multiprocessing_fork: join the pool. WithThreadsTestPool.test_del_pool() is now also decorated with @support.reap_threads. (cherry picked from commit b7278736b3ae158a7738057e3045bc767ced019e) Co-authored-by: Victor Stinner files: M Lib/test/_test_multiprocessing.py diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index 6e416a9855da..7a657d9d120c 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -2516,6 +2516,7 @@ def test_wrapped_exception(self): with self.Pool(1) as p: with self.assertRaises(RuntimeError): p.apply(self._test_wrapped_exception) + p.join() def test_map_no_failfast(self): # Issue #23992: the fail-fast behaviour when an exception is raised @@ -2551,6 +2552,7 @@ def test_release_task_refs(self): # they were released too. self.assertEqual(CountedObject.n_instances, 0) + @support.reap_threads def test_del_pool(self): p = self.Pool(1) wr = weakref.ref(p) From webhook-mailer at python.org Tue Nov 27 19:37:28 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 28 Nov 2018 00:37:28 -0000 Subject: [Python-checkins] bpo-33676: Fix dangling thread in _test_multiprocessing (GH-10755) Message-ID: https://github.com/python/cpython/commit/dd5293871703e6a12ffdde14eeaa86a73b7b0d99 commit: dd5293871703e6a12ffdde14eeaa86a73b7b0d99 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-27T16:37:23-08:00 summary: bpo-33676: Fix dangling thread in _test_multiprocessing (GH-10755) Fix WithThreadsTestPool.test_wrapped_exception() of test_multiprocessing_fork: join the pool. WithThreadsTestPool.test_del_pool() is now also decorated with @support.reap_threads. (cherry picked from commit b7278736b3ae158a7738057e3045bc767ced019e) Co-authored-by: Victor Stinner files: M Lib/test/_test_multiprocessing.py diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index 6667f1178574..59f9a2e1e2eb 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -2250,6 +2250,7 @@ def test_wrapped_exception(self): with self.Pool(1) as p: with self.assertRaises(RuntimeError): p.apply(self._test_wrapped_exception) + p.join() def test_map_no_failfast(self): # Issue #23992: the fail-fast behaviour when an exception is raised @@ -2285,6 +2286,7 @@ def test_release_task_refs(self): # they were released too. self.assertEqual(CountedObject.n_instances, 0) + @support.reap_threads def test_del_pool(self): p = self.Pool(1) wr = weakref.ref(p) From solipsis at pitrou.net Wed Nov 28 04:09:33 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Wed, 28 Nov 2018 09:09:33 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=6 Message-ID: <20181128090933.1.0F0AEC4DD7AF7C3A@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [0, 7, -7] memory blocks, sum=0 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_fork leaked [1, -1, 2] memory blocks, sum=2 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogDfh0jr', '--timeout', '7200'] From webhook-mailer at python.org Wed Nov 28 04:24:13 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 28 Nov 2018 09:24:13 -0000 Subject: [Python-checkins] bpo-35240: Add "doctest" job to Travis CI (GH-10753) Message-ID: https://github.com/python/cpython/commit/a22df4896f6b83c8741203118790ae281716bca5 commit: a22df4896f6b83c8741203118790ae281716bca5 branch: master author: Victor Stinner committer: GitHub date: 2018-11-28T10:24:08+01:00 summary: bpo-35240: Add "doctest" job to Travis CI (GH-10753) Create a new "doctest" job in Travis CI to run "make doctest". files: M .travis.yml diff --git a/.travis.yml b/.travis.yml index ef3c2be5e580..c6e009291a2d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,6 +57,20 @@ matrix: - python -m pip install sphinx==1.8.2 blurb python-docs-theme script: - make check suspicious html SPHINXOPTS="-q -W -j4" + - os: linux + language: c + compiler: clang + env: TESTING=doctest + addons: + apt: + packages: + - xvfb + before_script: + - ./configure + - make -j4 + - make -C Doc/ PYTHON=../python venv + script: + xvfb-run make -C Doc/ PYTHON=../python SPHINXOPTS="-q -W -j4" doctest - os: osx language: c compiler: clang @@ -96,7 +110,7 @@ before_install: - set -e - | # Check short-circuit conditions - if [[ "${TESTING}" != "docs" ]] + if [[ "${TESTING}" != "docs" && "${TESTING}" != "doctest" ]] then if [[ "$TRAVIS_PULL_REQUEST" == "false" ]] then @@ -121,6 +135,7 @@ before_install: install: - | # Install OpenSSL as necessary + # Note: doctest needs OpenSSL if [[ "${TESTING}" != "docs" ]] then # clang complains about unused-parameter a lot, redirect stderr @@ -160,9 +175,6 @@ script: XVFB_RUN=xvfb-run; fi $XVFB_RUN make buildbottest TESTOPTS="-j4 -uall,-cpu" - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - $XVFB_RUN make PYTHON=../python SPHINXOPTS="-q -W -j4" -C Doc/ venv doctest - fi notifications: email: false irc: From webhook-mailer at python.org Wed Nov 28 04:26:24 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 28 Nov 2018 09:26:24 -0000 Subject: [Python-checkins] bpo-34523, bpo-35322: Fix unicode_encode_locale() (GH-10759) Message-ID: https://github.com/python/cpython/commit/bde9d6bbb46ca59bcee5d5060adaa33c3ffee3a6 commit: bde9d6bbb46ca59bcee5d5060adaa33c3ffee3a6 branch: master author: Victor Stinner committer: GitHub date: 2018-11-28T10:26:20+01:00 summary: bpo-34523, bpo-35322: Fix unicode_encode_locale() (GH-10759) Fix memory leak in PyUnicode_EncodeLocale() and PyUnicode_EncodeFSDefault() on error handling. Changes: * Fix unicode_encode_locale() error handling * Fix test_codecs.LocaleCodecTest files: A Misc/NEWS.d/next/C API/2018-11-28-03-20-36.bpo-35322.Qcqsag.rst M Lib/test/test_codecs.py M Objects/unicodeobject.c diff --git a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py index 00b5d317c401..8c92556e8429 100644 --- a/Lib/test/test_codecs.py +++ b/Lib/test/test_codecs.py @@ -3290,9 +3290,9 @@ def check_encode_strings(self, errors): expected = text.encode(self.ENCODING, errors) except UnicodeEncodeError: with self.assertRaises(RuntimeError) as cm: - self.encode(self.SURROGATES) + self.encode(text, errors) errmsg = str(cm.exception) - self.assertTrue(errmsg.startswith("encode error: pos=0, reason="), errmsg) + self.assertRegex(errmsg, r"encode error: pos=[0-9]+, reason=") else: encoded = self.encode(text, errors) self.assertEqual(encoded, expected) @@ -3315,6 +3315,11 @@ def test_encode_surrogatepass(self): self.check_encode_strings("surrogatepass") + def test_encode_unsupported_error_handler(self): + with self.assertRaises(ValueError) as cm: + self.encode('', 'backslashreplace') + self.assertEqual(str(cm.exception), 'unsupported error handler') + def decode(self, encoded, errors="strict"): return _testcapi.DecodeLocaleEx(encoded, 0, errors) @@ -3370,6 +3375,11 @@ def test_decode_surrogatepass(self): self.check_decode_strings("surrogatepass") + def test_decode_unsupported_error_handler(self): + with self.assertRaises(ValueError) as cm: + self.decode(b'', 'backslashreplace') + self.assertEqual(str(cm.exception), 'unsupported error handler') + if __name__ == "__main__": unittest.main() diff --git a/Misc/NEWS.d/next/C API/2018-11-28-03-20-36.bpo-35322.Qcqsag.rst b/Misc/NEWS.d/next/C API/2018-11-28-03-20-36.bpo-35322.Qcqsag.rst new file mode 100644 index 000000000000..f5b4796307f7 --- /dev/null +++ b/Misc/NEWS.d/next/C API/2018-11-28-03-20-36.bpo-35322.Qcqsag.rst @@ -0,0 +1,2 @@ +Fix memory leak in :c:func:`PyUnicode_EncodeLocale` and +:c:func:`PyUnicode_EncodeFSDefault` on error handling. diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 2b1db918a154..bc98c44c7407 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -3449,10 +3449,9 @@ unicode_encode_locale(PyObject *unicode, const char *errors, return NULL; } - Py_ssize_t wlen2 = wcslen(wstr); - if (wlen2 != wlen) { - PyMem_Free(wstr); + if ((size_t)wlen != wcslen(wstr)) { PyErr_SetString(PyExc_ValueError, "embedded null character"); + PyMem_Free(wstr); return NULL; } @@ -3461,6 +3460,8 @@ unicode_encode_locale(PyObject *unicode, const char *errors, const char *reason; int res = _Py_EncodeLocaleEx(wstr, &str, &error_pos, &reason, current_locale, error_handler); + PyMem_Free(wstr); + if (res != 0) { if (res == -2) { PyObject *exc; @@ -3473,18 +3474,15 @@ unicode_encode_locale(PyObject *unicode, const char *errors, PyCodec_StrictErrors(exc); Py_DECREF(exc); } - return NULL; } else if (res == -3) { PyErr_SetString(PyExc_ValueError, "unsupported error handler"); } else { PyErr_NoMemory(); - PyMem_Free(wstr); - return NULL; } + return NULL; } - PyMem_Free(wstr); PyObject *bytes = PyBytes_FromString(str); PyMem_RawFree(str); From webhook-mailer at python.org Wed Nov 28 06:42:44 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 28 Nov 2018 11:42:44 -0000 Subject: [Python-checkins] bpo-34523, bpo-35322: Fix unicode_encode_locale() (GH-10759) (GH-10761) Message-ID: https://github.com/python/cpython/commit/85ab974f78c0ebcfa611639864640d0273eb5466 commit: 85ab974f78c0ebcfa611639864640d0273eb5466 branch: 3.7 author: Victor Stinner committer: GitHub date: 2018-11-28T12:42:40+01:00 summary: bpo-34523, bpo-35322: Fix unicode_encode_locale() (GH-10759) (GH-10761) Fix memory leak in PyUnicode_EncodeLocale() and PyUnicode_EncodeFSDefault() on error handling. Fix unicode_encode_locale() error handling. (cherry picked from commit bde9d6bbb46ca59bcee5d5060adaa33c3ffee3a6) files: A Misc/NEWS.d/next/C API/2018-11-28-03-20-36.bpo-35322.Qcqsag.rst M Objects/unicodeobject.c diff --git a/Misc/NEWS.d/next/C API/2018-11-28-03-20-36.bpo-35322.Qcqsag.rst b/Misc/NEWS.d/next/C API/2018-11-28-03-20-36.bpo-35322.Qcqsag.rst new file mode 100644 index 000000000000..f5b4796307f7 --- /dev/null +++ b/Misc/NEWS.d/next/C API/2018-11-28-03-20-36.bpo-35322.Qcqsag.rst @@ -0,0 +1,2 @@ +Fix memory leak in :c:func:`PyUnicode_EncodeLocale` and +:c:func:`PyUnicode_EncodeFSDefault` on error handling. diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index e6371d2337c3..bd3f151c6a50 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -3391,10 +3391,9 @@ unicode_encode_locale(PyObject *unicode, const char *errors, return NULL; } - Py_ssize_t wlen2 = wcslen(wstr); - if (wlen2 != wlen) { - PyMem_Free(wstr); + if ((size_t)wlen != wcslen(wstr)) { PyErr_SetString(PyExc_ValueError, "embedded null character"); + PyMem_Free(wstr); return NULL; } @@ -3403,6 +3402,8 @@ unicode_encode_locale(PyObject *unicode, const char *errors, const char *reason; int res = _Py_EncodeLocaleEx(wstr, &str, &error_pos, &reason, current_locale, surrogateescape); + PyMem_Free(wstr); + if (res != 0) { if (res == -2) { PyObject *exc; @@ -3415,15 +3416,12 @@ unicode_encode_locale(PyObject *unicode, const char *errors, PyCodec_StrictErrors(exc); Py_DECREF(exc); } - return NULL; } else { PyErr_NoMemory(); - PyMem_Free(wstr); - return NULL; } + return NULL; } - PyMem_Free(wstr); PyObject *bytes = PyBytes_FromString(str); PyMem_RawFree(str); From webhook-mailer at python.org Wed Nov 28 07:01:38 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 28 Nov 2018 12:01:38 -0000 Subject: [Python-checkins] bpo-35134: Create Include/cpython/tupleobject.h (GH-10764) Message-ID: https://github.com/python/cpython/commit/54ba556c6c7d8fd5504dc142c2e773890c55a774 commit: 54ba556c6c7d8fd5504dc142c2e773890c55a774 branch: master author: Victor Stinner committer: GitHub date: 2018-11-28T13:01:32+01:00 summary: bpo-35134: Create Include/cpython/tupleobject.h (GH-10764) Move tupleobject.h code surrounded by "#ifndef Py_LIMITED_API" to a new Include/cpython/tupleobject.h header file. Add cpython/ header files to Makefile.pre.in and pythoncore project of PCbuild. files: A Include/cpython/tupleobject.h M Include/tupleobject.h M Makefile.pre.in M PCbuild/pythoncore.vcxproj M PCbuild/pythoncore.vcxproj.filters diff --git a/Include/cpython/tupleobject.h b/Include/cpython/tupleobject.h new file mode 100644 index 000000000000..1565f2a5c3d9 --- /dev/null +++ b/Include/cpython/tupleobject.h @@ -0,0 +1,36 @@ +#ifndef Py_CPYTHON_TUPLEOBJECT_H +# error "this header file must not be included directly" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + PyObject_VAR_HEAD + /* ob_item contains space for 'ob_size' elements. + Items must normally not be NULL, except during construction when + the tuple is not yet visible outside the function that builds it. */ + PyObject *ob_item[1]; +} PyTupleObject; + +PyAPI_FUNC(int) _PyTuple_Resize(PyObject **, Py_ssize_t); +PyAPI_FUNC(void) _PyTuple_MaybeUntrack(PyObject *); + +/* Macros trading safety for speed */ + +/* Cast argument to PyTupleObject* type. */ +#define _PyTuple_CAST(op) (assert(PyTuple_Check(op)), (PyTupleObject *)(op)) + +#define PyTuple_GET_SIZE(op) Py_SIZE(_PyTuple_CAST(op)) + +#define PyTuple_GET_ITEM(op, i) (_PyTuple_CAST(op)->ob_item[i]) + +/* Macro, *only* to be used to fill in brand new tuples */ +#define PyTuple_SET_ITEM(op, i, v) (_PyTuple_CAST(op)->ob_item[i] = v) + +PyAPI_FUNC(void) _PyTuple_DebugMallocStats(FILE *out); + +#ifdef __cplusplus +} +#endif diff --git a/Include/tupleobject.h b/Include/tupleobject.h index 75574bc43fb3..590902de9d02 100644 --- a/Include/tupleobject.h +++ b/Include/tupleobject.h @@ -1,4 +1,3 @@ - /* Tuple object interface */ #ifndef Py_TUPLEOBJECT_H @@ -21,18 +20,6 @@ inserted in the tuple. Similarly, PyTuple_GetItem does not increment the returned item's reference count. */ -#ifndef Py_LIMITED_API -typedef struct { - PyObject_VAR_HEAD - PyObject *ob_item[1]; - - /* ob_item contains space for 'ob_size' elements. - * Items must normally not be NULL, except during construction when - * the tuple is not yet visible outside the function that builds it. - */ -} PyTupleObject; -#endif - PyAPI_DATA(PyTypeObject) PyTuple_Type; PyAPI_DATA(PyTypeObject) PyTupleIter_Type; @@ -45,30 +32,15 @@ PyAPI_FUNC(Py_ssize_t) PyTuple_Size(PyObject *); PyAPI_FUNC(PyObject *) PyTuple_GetItem(PyObject *, Py_ssize_t); PyAPI_FUNC(int) PyTuple_SetItem(PyObject *, Py_ssize_t, PyObject *); PyAPI_FUNC(PyObject *) PyTuple_GetSlice(PyObject *, Py_ssize_t, Py_ssize_t); -#ifndef Py_LIMITED_API -PyAPI_FUNC(int) _PyTuple_Resize(PyObject **, Py_ssize_t); -#endif PyAPI_FUNC(PyObject *) PyTuple_Pack(Py_ssize_t, ...); -#ifndef Py_LIMITED_API -PyAPI_FUNC(void) _PyTuple_MaybeUntrack(PyObject *); -#endif - -/* Macro, trading safety for speed */ -#ifndef Py_LIMITED_API -/* Cast argument to PyTupleObject* type. */ -#define _PyTuple_CAST(op) (assert(PyTuple_Check(op)), (PyTupleObject *)(op)) - -#define PyTuple_GET_ITEM(op, i) (_PyTuple_CAST(op)->ob_item[i]) -#define PyTuple_GET_SIZE(op) Py_SIZE(_PyTuple_CAST(op)) - -/* Macro, *only* to be used to fill in brand new tuples */ -#define PyTuple_SET_ITEM(op, i, v) (_PyTuple_CAST(op)->ob_item[i] = v) -#endif PyAPI_FUNC(int) PyTuple_ClearFreeList(void); + #ifndef Py_LIMITED_API -PyAPI_FUNC(void) _PyTuple_DebugMallocStats(FILE *out); -#endif /* Py_LIMITED_API */ +# define Py_CPYTHON_TUPLEOBJECT_H +# include "cpython/tupleobject.h" +# undef Py_CPYTHON_TUPLEOBJECT_H +#endif #ifdef __cplusplus } diff --git a/Makefile.pre.in b/Makefile.pre.in index eee64a75f785..02ce0af55ce2 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1027,7 +1027,15 @@ PYTHON_HEADERS= \ $(PARSER_HEADERS) \ $(srcdir)/Include/Python-ast.h \ \ + $(srcdir)/Include/cpython/abstract.h \ + $(srcdir)/Include/cpython/dictobject.h \ + $(srcdir)/Include/cpython/object.h \ $(srcdir)/Include/cpython/objimpl.h \ + $(srcdir)/Include/cpython/pyerrors.h \ + $(srcdir)/Include/cpython/pylifecycle.h \ + $(srcdir)/Include/cpython/pystate.h \ + $(srcdir)/Include/cpython/tupleobject.h \ + $(srcdir)/Include/cpython/unicodeobject.h \ \ $(srcdir)/Include/internal/pycore_accu.h \ $(srcdir)/Include/internal/pycore_atomic.h \ diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index 8aa4c0610f60..4ae2d692eee1 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -95,7 +95,15 @@ + + + + + + + + diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters index 021a67efccbc..5a43a9951b63 100644 --- a/PCbuild/pythoncore.vcxproj.filters +++ b/PCbuild/pythoncore.vcxproj.filters @@ -84,9 +84,33 @@ Include + + Include + + + Include + + + Include + Include + + Include + + + Include + + + Include + + + Include + + + Include + Include From webhook-mailer at python.org Wed Nov 28 09:19:58 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 28 Nov 2018 14:19:58 -0000 Subject: [Python-checkins] bpo-35337: Fix gettmarg(): use PyStructSequence_GET_ITEM() (GH-10765) Message-ID: https://github.com/python/cpython/commit/1cdfcfc9843d35ab2cb87387d3a79b2c8a585a38 commit: 1cdfcfc9843d35ab2cb87387d3a79b2c8a585a38 branch: master author: Victor Stinner committer: GitHub date: 2018-11-28T15:19:51+01:00 summary: bpo-35337: Fix gettmarg(): use PyStructSequence_GET_ITEM() (GH-10765) PyStructSequence_GET_ITEM() must be used instead of PyTuple_GET_ITEM() on a StructTimeType. files: M Modules/timemodule.c diff --git a/Modules/timemodule.c b/Modules/timemodule.c index c3ecd80a6083..55b82d74cb19 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -568,7 +568,7 @@ gettmarg(PyObject *args, struct tm *p, const char *format) #ifdef HAVE_STRUCT_TM_TM_ZONE if (Py_TYPE(args) == &StructTimeType) { PyObject *item; - item = PyTuple_GET_ITEM(args, 9); + item = PyStructSequence_GET_ITEM(args, 9); if (item != Py_None) { p->tm_zone = (char *)PyUnicode_AsUTF8(item); if (p->tm_zone == NULL) { @@ -589,7 +589,7 @@ gettmarg(PyObject *args, struct tm *p, const char *format) } #endif } - item = PyTuple_GET_ITEM(args, 10); + item = PyStructSequence_GET_ITEM(args, 10); if (item != Py_None) { p->tm_gmtoff = PyLong_AsLong(item); if (PyErr_Occurred()) From webhook-mailer at python.org Wed Nov 28 10:53:27 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 28 Nov 2018 15:53:27 -0000 Subject: [Python-checkins] [3.7] Doc: Delete "how do I emulate os.kill" section in Windows FAQ (GH-10487) (GH-10767) Message-ID: https://github.com/python/cpython/commit/9c16bc2c3d5f0fd892a122b2f44aef445ee3381d commit: 9c16bc2c3d5f0fd892a122b2f44aef445ee3381d branch: 3.7 author: Julien Palard committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-11-28T07:53:23-08:00 summary: [3.7] Doc: Delete "how do I emulate os.kill" section in Windows FAQ (GH-10487) (GH-10767) files: M Doc/faq/windows.rst diff --git a/Doc/faq/windows.rst b/Doc/faq/windows.rst index 9292a2407a75..a46d4c1725ac 100644 --- a/Doc/faq/windows.rst +++ b/Doc/faq/windows.rst @@ -280,24 +280,3 @@ How do I check for a keypress without blocking? Use the msvcrt module. This is a standard Windows-specific extension module. It defines a function ``kbhit()`` which checks whether a keyboard hit is present, and ``getch()`` which gets one character without echoing it. - - -How do I emulate os.kill() in Windows? --------------------------------------- - -Prior to Python 2.7 and 3.2, to terminate a process, you can use :mod:`ctypes`: - -.. code-block:: python - - import ctypes - - def kill(pid): - """kill function for Win32""" - kernel32 = ctypes.windll.kernel32 - handle = kernel32.OpenProcess(1, 0, pid) - return (0 != kernel32.TerminateProcess(handle, 0)) - -In 2.7 and 3.2, :func:`os.kill` is implemented similar to the above function, -with the additional feature of being able to send :kbd:`Ctrl+C` and :kbd:`Ctrl+Break` -to console subprocesses which are designed to handle those signals. See -:func:`os.kill` for further details. From webhook-mailer at python.org Wed Nov 28 10:58:50 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 28 Nov 2018 15:58:50 -0000 Subject: [Python-checkins] bpo-34100: compile: Re-enable frozenset merging (GH-10760) Message-ID: https://github.com/python/cpython/commit/f7e4d3642fbb88f4e6243c952a0e223fb5df1c65 commit: f7e4d3642fbb88f4e6243c952a0e223fb5df1c65 branch: master author: INADA Naoki committer: Victor Stinner date: 2018-11-28T16:58:46+01:00 summary: bpo-34100: compile: Re-enable frozenset merging (GH-10760) This reverts commit 1005c84535191a72ebb7587d8c5636a065b7ed79. 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 a086ef65b44a..56f73f631534 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -615,6 +615,14 @@ def check_same_constant(const): self.check_constant(f1, Ellipsis) self.assertEqual(repr(f1()), repr(Ellipsis)) + # Merge constants in tuple or frozenset + f1, f2 = lambda: "not a name", lambda: ("not a name",) + f3 = lambda x: x in {("not a name",)} + self.assertIs(f1.__code__.co_consts[1], + f2.__code__.co_consts[1][0]) + self.assertIs(next(iter(f3.__code__.co_consts[1])), + f2.__code__.co_consts[1]) + # {0} is converted to a constant frozenset({0}) by the peephole # optimizer f1, f2 = lambda x: x in {0}, lambda x: x in {0} diff --git a/Python/compile.c b/Python/compile.c index 7d51819e00f0..45e78cb22cd8 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -1208,14 +1208,18 @@ merge_consts_recursive(struct compiler *c, PyObject *o) // t is borrowed reference PyObject *t = PyDict_SetDefault(c->c_const_cache, key, key); if (t != key) { + // o is registered in c_const_cache. Just use it. Py_INCREF(t); Py_DECREF(key); return t; } + // We registered o in c_const_cache. + // When o is a tuple or frozenset, we want to merge it's + // items too. if (PyTuple_CheckExact(o)) { - Py_ssize_t i, len = PyTuple_GET_SIZE(o); - for (i = 0; i < len; i++) { + Py_ssize_t len = PyTuple_GET_SIZE(o); + for (Py_ssize_t i = 0; i < len; i++) { PyObject *item = PyTuple_GET_ITEM(o, i); PyObject *u = merge_consts_recursive(c, item); if (u == NULL) { @@ -1240,6 +1244,57 @@ merge_consts_recursive(struct compiler *c, PyObject *o) Py_DECREF(u); } } + else if (PyFrozenSet_CheckExact(o)) { + // *key* is tuple. And it's first item is frozenset of + // constant keys. + // See _PyCode_ConstantKey() for detail. + assert(PyTuple_CheckExact(key)); + assert(PyTuple_GET_SIZE(key) == 2); + + Py_ssize_t len = PySet_GET_SIZE(o); + if (len == 0) { // empty frozenset should not be re-created. + return key; + } + PyObject *tuple = PyTuple_New(len); + if (tuple == NULL) { + Py_DECREF(key); + return NULL; + } + Py_ssize_t i = 0, pos = 0; + PyObject *item; + Py_hash_t hash; + while (_PySet_NextEntry(o, &pos, &item, &hash)) { + PyObject *k = merge_consts_recursive(c, item); + if (k == NULL) { + Py_DECREF(tuple); + Py_DECREF(key); + return NULL; + } + PyObject *u; + if (PyTuple_CheckExact(k)) { + u = PyTuple_GET_ITEM(k, 1); + Py_INCREF(u); + Py_DECREF(k); + } + else { + u = k; + } + PyTuple_SET_ITEM(tuple, i, u); // Steals reference of u. + i++; + } + + // Instead of rewriting o, we create new frozenset and embed in the + // key tuple. Caller should get merged frozenset from the key tuple. + PyObject *new = PyFrozenSet_New(tuple); + Py_DECREF(tuple); + if (new == NULL) { + Py_DECREF(key); + return NULL; + } + assert(PyTuple_GET_ITEM(key, 1) == o); + Py_DECREF(o); + PyTuple_SET_ITEM(key, 1, new); + } return key; } From webhook-mailer at python.org Wed Nov 28 11:09:23 2018 From: webhook-mailer at python.org (Julien Palard) Date: Wed, 28 Nov 2018 16:09:23 -0000 Subject: [Python-checkins] [3.6] Doc: Delete "how do I emulate os.kill" section in Windows FAQ (GH-10487) (GH-10768) Message-ID: https://github.com/python/cpython/commit/a181411f13c5dccdba9c918f86c945e8f6ab9757 commit: a181411f13c5dccdba9c918f86c945e8f6ab9757 branch: 3.6 author: Julien Palard committer: GitHub date: 2018-11-28T17:09:18+01:00 summary: [3.6] Doc: Delete "how do I emulate os.kill" section in Windows FAQ (GH-10487) (GH-10768) That section is a tip on how to kill process on Windows for Python prior to 2.7 and 3.2. 3.1 end of support was April 2012 and 2.6 was October 2013, so that hasn't been need for supported versions of Python for more than 5 years. Beside not being needed anymore for a long time, when I read it with the eyes of a Python profane, it makes Python looks bad, like a language from the parts with warts you need to circumvent. Let's delete that :). (cherry picked from commit a1c40014085d5cc6c12064577e8c10e7182ee9f9) Co-authored-by: Mathieu Dupuy files: M Doc/faq/windows.rst diff --git a/Doc/faq/windows.rst b/Doc/faq/windows.rst index 772b8c2012c3..2b44f65692b8 100644 --- a/Doc/faq/windows.rst +++ b/Doc/faq/windows.rst @@ -280,24 +280,3 @@ How do I check for a keypress without blocking? Use the msvcrt module. This is a standard Windows-specific extension module. It defines a function ``kbhit()`` which checks whether a keyboard hit is present, and ``getch()`` which gets one character without echoing it. - - -How do I emulate os.kill() in Windows? --------------------------------------- - -Prior to Python 2.7 and 3.2, to terminate a process, you can use :mod:`ctypes`: - -.. code-block:: python - - import ctypes - - def kill(pid): - """kill function for Win32""" - kernel32 = ctypes.windll.kernel32 - handle = kernel32.OpenProcess(1, 0, pid) - return (0 != kernel32.TerminateProcess(handle, 0)) - -In 2.7 and 3.2, :func:`os.kill` is implemented similar to the above function, -with the additional feature of being able to send :kbd:`Ctrl+C` and :kbd:`Ctrl+Break` -to console subprocesses which are designed to handle those signals. See -:func:`os.kill` for further details. From webhook-mailer at python.org Wed Nov 28 12:04:34 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 28 Nov 2018 17:04:34 -0000 Subject: [Python-checkins] pythoninfo: log more environment variable (GH-10719) (GH-10769) Message-ID: https://github.com/python/cpython/commit/c9010456d44c1b2d0e702800df9297964d970b86 commit: c9010456d44c1b2d0e702800df9297964d970b86 branch: 3.7 author: Victor Stinner committer: GitHub date: 2018-11-28T18:04:30+01:00 summary: pythoninfo: log more environment variable (GH-10719) (GH-10769) Log TZ to debug a timezone issue... and a few more :-) (cherry picked from commit 282c03d45d2d766c55904a4eb766923a2c459124) files: M Lib/test/pythoninfo.py diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py index 9257fdf332a6..30e6f21c2b48 100644 --- a/Lib/test/pythoninfo.py +++ b/Lib/test/pythoninfo.py @@ -199,32 +199,73 @@ def format_groups(groups): call_func(info_add, 'os.cpu_count', os, 'cpu_count') call_func(info_add, 'os.loadavg', os, 'getloadavg') - # Get environment variables: filter to list - # to not leak sensitive information - ENV_VARS = ( + # Environment variables used by the stdlib and tests. Don't log the full + # environment: filter to list to not leak sensitive information. + # + # HTTP_PROXY is not logged because it can contain a password. + ENV_VARS = frozenset(( + "APPDATA", + "AR", + "ARCHFLAGS", + "ARFLAGS", + "AUDIODEV", "CC", + "CFLAGS", + "COLUMNS", + "COMPUTERNAME", "COMSPEC", + "CPP", + "CPPFLAGS", "DISPLAY", + "DISTUTILS_DEBUG", "DISTUTILS_USE_SDK", "DYLD_LIBRARY_PATH", + "ENSUREPIP_OPTIONS", + "HISTORY_FILE", "HOME", "HOMEDRIVE", "HOMEPATH", + "IDLESTARTUP", "LANG", + "LDFLAGS", + "LDSHARED", "LD_LIBRARY_PATH", + "LINES", "MACOSX_DEPLOYMENT_TARGET", + "MAILCAPS", "MAKEFLAGS", + "MIXERDEV", "MSSDK", "PATH", + "PATHEXT", + "PIP_CONFIG_FILE", + "PLAT", + "POSIXLY_CORRECT", + "PY_SAX_PARSER", + "ProgramFiles", + "ProgramFiles(x86)", + "RUNNING_ON_VALGRIND", "SDK_TOOLS_BIN", + "SERVER_SOFTWARE", "SHELL", + "SOURCE_DATE_EPOCH", + "SYSTEMROOT", "TEMP", "TERM", + "TILE_LIBRARY", + "TIX_LIBRARY", "TMP", "TMPDIR", + "TZ", "USERPROFILE", + "VIRTUAL_ENV", "WAYLAND_DISPLAY", - ) + "WINDIR", + "_PYTHON_HOST_PLATFORM", + "_PYTHON_PROJECT_BASE", + "_PYTHON_SYSCONFIGDATA_NAME", + "__PYVENV_LAUNCHER__", + )) for name, value in os.environ.items(): uname = name.upper() if (uname in ENV_VARS From webhook-mailer at python.org Wed Nov 28 12:04:54 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 28 Nov 2018 17:04:54 -0000 Subject: [Python-checkins] pythoninfo: log more environment variable (GH-10719) (GH-10770) Message-ID: https://github.com/python/cpython/commit/b14d3f2fe608effed9a3bffcb4d5aa08e69efcf8 commit: b14d3f2fe608effed9a3bffcb4d5aa08e69efcf8 branch: 3.6 author: Victor Stinner committer: GitHub date: 2018-11-28T18:04:51+01:00 summary: pythoninfo: log more environment variable (GH-10719) (GH-10770) Log TZ to debug a timezone issue... and a few more :-) (cherry picked from commit 282c03d45d2d766c55904a4eb766923a2c459124) files: M Lib/test/pythoninfo.py diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py index 4a563e9baae2..606d511433cf 100644 --- a/Lib/test/pythoninfo.py +++ b/Lib/test/pythoninfo.py @@ -199,32 +199,73 @@ def format_groups(groups): call_func(info_add, 'os.cpu_count', os, 'cpu_count') call_func(info_add, 'os.loadavg', os, 'getloadavg') - # Get environment variables: filter to list - # to not leak sensitive information - ENV_VARS = ( + # Environment variables used by the stdlib and tests. Don't log the full + # environment: filter to list to not leak sensitive information. + # + # HTTP_PROXY is not logged because it can contain a password. + ENV_VARS = frozenset(( + "APPDATA", + "AR", + "ARCHFLAGS", + "ARFLAGS", + "AUDIODEV", "CC", + "CFLAGS", + "COLUMNS", + "COMPUTERNAME", "COMSPEC", + "CPP", + "CPPFLAGS", "DISPLAY", + "DISTUTILS_DEBUG", "DISTUTILS_USE_SDK", "DYLD_LIBRARY_PATH", + "ENSUREPIP_OPTIONS", + "HISTORY_FILE", "HOME", "HOMEDRIVE", "HOMEPATH", + "IDLESTARTUP", "LANG", + "LDFLAGS", + "LDSHARED", "LD_LIBRARY_PATH", + "LINES", "MACOSX_DEPLOYMENT_TARGET", + "MAILCAPS", "MAKEFLAGS", + "MIXERDEV", "MSSDK", "PATH", + "PATHEXT", + "PIP_CONFIG_FILE", + "PLAT", + "POSIXLY_CORRECT", + "PY_SAX_PARSER", + "ProgramFiles", + "ProgramFiles(x86)", + "RUNNING_ON_VALGRIND", "SDK_TOOLS_BIN", + "SERVER_SOFTWARE", "SHELL", + "SOURCE_DATE_EPOCH", + "SYSTEMROOT", "TEMP", "TERM", + "TILE_LIBRARY", + "TIX_LIBRARY", "TMP", "TMPDIR", + "TZ", "USERPROFILE", + "VIRTUAL_ENV", "WAYLAND_DISPLAY", - ) + "WINDIR", + "_PYTHON_HOST_PLATFORM", + "_PYTHON_PROJECT_BASE", + "_PYTHON_SYSCONFIGDATA_NAME", + "__PYVENV_LAUNCHER__", + )) for name, value in os.environ.items(): uname = name.upper() if (uname in ENV_VARS From webhook-mailer at python.org Wed Nov 28 12:22:14 2018 From: webhook-mailer at python.org (Ivan Levkivskyi) Date: Wed, 28 Nov 2018 17:22:14 -0000 Subject: [Python-checkins] bpo-34921: Allow escaped NoReturn in get_type_hints (GH-9750) (GH-10772) Message-ID: https://github.com/python/cpython/commit/f71a5922916abd6cc7bf7d99ed4715b6e96e5981 commit: f71a5922916abd6cc7bf7d99ed4715b6e96e5981 branch: 3.7 author: Ismo Toijala committer: Ivan Levkivskyi date: 2018-11-28T17:22:09Z summary: bpo-34921: Allow escaped NoReturn in get_type_hints (GH-9750) (GH-10772) files: M Lib/typing.py diff --git a/Lib/typing.py b/Lib/typing.py index 445a42492b6b..cfcbb3b76328 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -130,7 +130,7 @@ def _type_check(arg, msg, is_argument=True): if (isinstance(arg, _GenericAlias) and arg.__origin__ in invalid_generic_forms): raise TypeError(f"{arg} is not valid as type argument") - if (isinstance(arg, _SpecialForm) and arg is not Any or + if (isinstance(arg, _SpecialForm) and arg not in (Any, NoReturn) or arg in (Generic, _Protocol)): raise TypeError(f"Plain {arg} is not valid as type argument") if isinstance(arg, (type, TypeVar, ForwardRef)): From webhook-mailer at python.org Wed Nov 28 12:30:13 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 28 Nov 2018 17:30:13 -0000 Subject: [Python-checkins] bpo-33723: Remove busy loop from test_time (GH-10773) Message-ID: https://github.com/python/cpython/commit/48498dd57f79ab1d061c754ad6a2ebe1a7172b0e commit: 48498dd57f79ab1d061c754ad6a2ebe1a7172b0e branch: master author: Victor Stinner committer: GitHub date: 2018-11-28T18:30:10+01:00 summary: bpo-33723: Remove busy loop from test_time (GH-10773) The "busy loops" of test_process_time() and test_thread_time() are not reliable and fail randomly on Windows: remove them. files: M Lib/test/test_time.py diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py index 381cc823014e..2f0665a42ce4 100644 --- a/Lib/test/test_time.py +++ b/Lib/test/test_time.py @@ -46,12 +46,6 @@ class _PyTime(enum.IntEnum): ) -def busy_wait(duration): - deadline = time.monotonic() + duration - while time.monotonic() < deadline: - pass - - class TimeTestCase(unittest.TestCase): def setUp(self): @@ -495,25 +489,6 @@ def test_process_time(self): # on Windows self.assertLess(stop - start, 0.020) - # bpo-33723: A busy loop of 100 ms should increase process_time() - # by at least 15 ms. Tolerate 15 ms because of the bad resolution of - # the clock on Windows (around 15.6 ms). - min_time = 0.015 - busy_time = 0.100 - - # process_time() should include CPU time spent in any thread - start = time.process_time() - busy_wait(busy_time) - stop = time.process_time() - self.assertGreaterEqual(stop - start, min_time) - - t = threading.Thread(target=busy_wait, args=(busy_time,)) - start = time.process_time() - t.start() - t.join() - stop = time.process_time() - self.assertGreaterEqual(stop - start, min_time) - info = time.get_clock_info('process_time') self.assertTrue(info.monotonic) self.assertFalse(info.adjustable) @@ -534,28 +509,6 @@ def test_thread_time(self): # on Windows self.assertLess(stop - start, 0.020) - # bpo-33723: A busy loop of 100 ms should increase thread_time() - # by at least 15 ms, but less than 30 ms in other threads. - # Tolerate 15 and 30 ms because of the bad resolution - # of the clock on Windows (around 15.6 ms). - min_time = 0.015 - max_time = 0.030 - busy_time = 0.100 - - # thread_time() should include CPU time spent in current thread... - start = time.thread_time() - busy_wait(busy_time) - stop = time.thread_time() - self.assertGreaterEqual(stop - start, min_time) - - # ...but not in other threads - t = threading.Thread(target=busy_wait, args=(busy_time,)) - start = time.thread_time() - t.start() - t.join() - stop = time.thread_time() - self.assertLess(stop - start, max_time) - info = time.get_clock_info('thread_time') self.assertTrue(info.monotonic) self.assertFalse(info.adjustable) From webhook-mailer at python.org Wed Nov 28 12:45:41 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 28 Nov 2018 17:45:41 -0000 Subject: [Python-checkins] bpo-34022: Stop forcing of hash-based invalidation with SOURCE_DATE_EPOCH (GH-9607) Message-ID: https://github.com/python/cpython/commit/24b51b1a4919e310d338629cc60371387f475a32 commit: 24b51b1a4919e310d338629cc60371387f475a32 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-28T09:45:36-08:00 summary: bpo-34022: Stop forcing of hash-based invalidation with SOURCE_DATE_EPOCH (GH-9607) Unconditional forcing of ``CHECKED_HASH`` invalidation was introduced in 3.7.0 in bpo-29708. The change is bad, as it unconditionally overrides *invalidation_mode*, even if it was passed as an explicit argument to ``py_compile.compile()`` or ``compileall``. An environment variable should *never* override an explicit argument to a library function. That change leads to multiple test failures if the ``SOURCE_DATE_EPOCH`` environment variable is set. This changes ``py_compile.compile()`` to only look at ``SOURCE_DATE_EPOCH`` if no explicit *invalidation_mode* was specified. I also made various relevant tests run with explicit control over the value of ``SOURCE_DATE_EPOCH``. While looking at this, I noticed that ``zipimport`` does not work with hash-based .pycs _at all_, though I left the fixes for subsequent commits. (cherry picked from commit a6b3ec5b6d4f6387820fccc570eea08b9615620d) Co-authored-by: Elvis Pranskevichus files: A Misc/NEWS.d/next/Library/2018-09-27-13-14-15.bpo-34022.E2cl0r.rst M Doc/library/compileall.rst M Doc/library/py_compile.rst M Lib/compileall.py M Lib/py_compile.py M Lib/test/test_compileall.py M Lib/test/test_importlib/source/test_file_loader.py M Lib/test/test_py_compile.py diff --git a/Doc/library/compileall.rst b/Doc/library/compileall.rst index 7b3963da894f..5151f3a5237a 100644 --- a/Doc/library/compileall.rst +++ b/Doc/library/compileall.rst @@ -85,13 +85,16 @@ compile Python sources. .. cmdoption:: --invalidation-mode [timestamp|checked-hash|unchecked-hash] - Control how the generated pycs will be invalidated at runtime. The default - setting, ``timestamp``, means that ``.pyc`` files with the source timestamp + Control how the generated byte-code files are invalidated at runtime. + The ``timestamp`` value, means that ``.pyc`` files with the source timestamp and size embedded will be generated. The ``checked-hash`` and ``unchecked-hash`` values cause hash-based pycs to be generated. Hash-based pycs embed a hash of the source file contents rather than a timestamp. See - :ref:`pyc-invalidation` for more information on how Python validates bytecode - cache files at runtime. + :ref:`pyc-invalidation` for more information on how Python validates + bytecode cache files at runtime. + The default is ``timestamp`` if the :envvar:`SOURCE_DATE_EPOCH` environment + variable is not set, and ``checked-hash`` if the ``SOURCE_DATE_EPOCH`` + environment variable is set. .. versionchanged:: 3.2 Added the ``-i``, ``-b`` and ``-h`` options. diff --git a/Doc/library/py_compile.rst b/Doc/library/py_compile.rst index d720e0105057..8cb5a4d546c8 100644 --- a/Doc/library/py_compile.rst +++ b/Doc/library/py_compile.rst @@ -54,10 +54,10 @@ byte-code cache files in the directory containing the source code. level of the current interpreter. *invalidation_mode* should be a member of the :class:`PycInvalidationMode` - enum and controls how the generated ``.pyc`` files are invalidated at - runtime. If the :envvar:`SOURCE_DATE_EPOCH` environment variable is set, - *invalidation_mode* will be forced to - :attr:`PycInvalidationMode.CHECKED_HASH`. + enum and controls how the generated bytecode cache is invalidated at + runtime. The default is :attr:`PycInvalidationMode.CHECKED_HASH` if + the :envvar:`SOURCE_DATE_EPOCH` environment variable is set, otherwise + the default is :attr:`PycInvalidationMode.TIMESTAMP`. .. versionchanged:: 3.2 Changed default value of *cfile* to be :PEP:`3147`-compliant. Previous @@ -77,6 +77,11 @@ byte-code cache files in the directory containing the source code. *invalidation_mode* will be forced to :attr:`PycInvalidationMode.CHECKED_HASH`. + .. versionchanged:: 3.7.2 + The :envvar:`SOURCE_DATE_EPOCH` environment variable no longer + overrides the value of the *invalidation_mode* argument, and determines + its default value instead. + .. class:: PycInvalidationMode diff --git a/Lib/compileall.py b/Lib/compileall.py index 40b148d2017e..aa65c6b904e7 100644 --- a/Lib/compileall.py +++ b/Lib/compileall.py @@ -49,7 +49,7 @@ def _walk_dir(dir, ddir=None, maxlevels=10, quiet=0): def compile_dir(dir, maxlevels=10, ddir=None, force=False, rx=None, quiet=0, legacy=False, optimize=-1, workers=1, - invalidation_mode=py_compile.PycInvalidationMode.TIMESTAMP): + invalidation_mode=None): """Byte-compile all modules in the given directory tree. Arguments (only dir is required): @@ -100,7 +100,7 @@ def compile_dir(dir, maxlevels=10, ddir=None, force=False, rx=None, def compile_file(fullname, ddir=None, force=False, rx=None, quiet=0, legacy=False, optimize=-1, - invalidation_mode=py_compile.PycInvalidationMode.TIMESTAMP): + invalidation_mode=None): """Byte-compile one file. Arguments (only fullname is required): @@ -186,7 +186,7 @@ def compile_file(fullname, ddir=None, force=False, rx=None, quiet=0, def compile_path(skip_curdir=1, maxlevels=0, force=False, quiet=0, legacy=False, optimize=-1, - invalidation_mode=py_compile.PycInvalidationMode.TIMESTAMP): + invalidation_mode=None): """Byte-compile all module on sys.path. Arguments (all optional): @@ -259,9 +259,12 @@ def main(): type=int, help='Run compileall concurrently') invalidation_modes = [mode.name.lower().replace('_', '-') for mode in py_compile.PycInvalidationMode] - parser.add_argument('--invalidation-mode', default='timestamp', + parser.add_argument('--invalidation-mode', choices=sorted(invalidation_modes), - help='How the pycs will be invalidated at runtime') + help=('set .pyc invalidation mode; defaults to ' + '"checked-hash" if the SOURCE_DATE_EPOCH ' + 'environment variable is set, and ' + '"timestamp" otherwise.')) args = parser.parse_args() compile_dests = args.compile_dest @@ -290,8 +293,11 @@ def main(): if args.workers is not None: args.workers = args.workers or None - ivl_mode = args.invalidation_mode.replace('-', '_').upper() - invalidation_mode = py_compile.PycInvalidationMode[ivl_mode] + if args.invalidation_mode: + ivl_mode = args.invalidation_mode.replace('-', '_').upper() + invalidation_mode = py_compile.PycInvalidationMode[ivl_mode] + else: + invalidation_mode = None success = True try: diff --git a/Lib/py_compile.py b/Lib/py_compile.py index 16dc0a011ffa..8e9dd57a5440 100644 --- a/Lib/py_compile.py +++ b/Lib/py_compile.py @@ -69,8 +69,15 @@ class PycInvalidationMode(enum.Enum): UNCHECKED_HASH = 3 +def _get_default_invalidation_mode(): + if os.environ.get('SOURCE_DATE_EPOCH'): + return PycInvalidationMode.CHECKED_HASH + else: + return PycInvalidationMode.TIMESTAMP + + def compile(file, cfile=None, dfile=None, doraise=False, optimize=-1, - invalidation_mode=PycInvalidationMode.TIMESTAMP): + invalidation_mode=None): """Byte-compile one Python source file to Python bytecode. :param file: The source file name. @@ -112,8 +119,8 @@ def compile(file, cfile=None, dfile=None, doraise=False, optimize=-1, the resulting file would be regular and thus not the same type of file as it was previously. """ - if os.environ.get('SOURCE_DATE_EPOCH'): - invalidation_mode = PycInvalidationMode.CHECKED_HASH + if invalidation_mode is None: + invalidation_mode = _get_default_invalidation_mode() if cfile is None: if optimize >= 0: optimization = optimize if optimize >= 1 else '' diff --git a/Lib/test/test_compileall.py b/Lib/test/test_compileall.py index 2995e08aa8b5..2e2552303f8d 100644 --- a/Lib/test/test_compileall.py +++ b/Lib/test/test_compileall.py @@ -22,7 +22,11 @@ from test import support from test.support import script_helper -class CompileallTests(unittest.TestCase): +from .test_py_compile import without_source_date_epoch +from .test_py_compile import SourceDateEpochTestMeta + + +class CompileallTestsBase: def setUp(self): self.directory = tempfile.mkdtemp() @@ -46,7 +50,7 @@ def add_bad_source_file(self): with open(self.bad_source_path, 'w') as file: file.write('x (\n') - def data(self): + def timestamp_metadata(self): with open(self.bc_path, 'rb') as file: data = file.read(12) mtime = int(os.stat(self.source_path).st_mtime) @@ -57,16 +61,18 @@ def data(self): def recreation_check(self, metadata): """Check that compileall recreates bytecode when the new metadata is used.""" + if os.environ.get('SOURCE_DATE_EPOCH'): + raise unittest.SkipTest('SOURCE_DATE_EPOCH is set') py_compile.compile(self.source_path) - self.assertEqual(*self.data()) + self.assertEqual(*self.timestamp_metadata()) with open(self.bc_path, 'rb') as file: bc = file.read()[len(metadata):] with open(self.bc_path, 'wb') as file: file.write(metadata) file.write(bc) - self.assertNotEqual(*self.data()) + self.assertNotEqual(*self.timestamp_metadata()) compileall.compile_dir(self.directory, force=False, quiet=True) - self.assertTrue(*self.data()) + self.assertTrue(*self.timestamp_metadata()) def test_mtime(self): # Test a change in mtime leads to a new .pyc. @@ -189,6 +195,21 @@ def test_compile_missing_multiprocessing(self, compile_file_mock): compileall.compile_dir(self.directory, quiet=True, workers=5) self.assertTrue(compile_file_mock.called) + +class CompileallTestsWithSourceEpoch(CompileallTestsBase, + unittest.TestCase, + metaclass=SourceDateEpochTestMeta, + source_date_epoch=True): + pass + + +class CompileallTestsWithoutSourceEpoch(CompileallTestsBase, + unittest.TestCase, + metaclass=SourceDateEpochTestMeta, + source_date_epoch=False): + pass + + class EncodingTest(unittest.TestCase): """Issue 6716: compileall should escape source code when printing errors to stdout.""" @@ -212,7 +233,7 @@ def test_error(self): sys.stdout = orig_stdout -class CommandLineTests(unittest.TestCase): +class CommandLineTestsBase: """Test compileall's CLI.""" @classmethod @@ -285,6 +306,7 @@ def test_no_args_compiles_path(self): self.assertNotCompiled(self.initfn) self.assertNotCompiled(self.barfn) + @without_source_date_epoch # timestamp invalidation test def test_no_args_respects_force_flag(self): self._skip_if_sys_path_not_writable() bazfn = script_helper.make_script(self.directory, 'baz', '') @@ -353,6 +375,7 @@ def test_multiple_runs(self): self.assertTrue(os.path.exists(self.pkgdir_cachedir)) self.assertFalse(os.path.exists(cachecachedir)) + @without_source_date_epoch # timestamp invalidation test def test_force(self): self.assertRunOK('-q', self.pkgdir) pycpath = importlib.util.cache_from_source(self.barfn) @@ -556,5 +579,20 @@ def test_workers_available_cores(self, compile_dir): self.assertEqual(compile_dir.call_args[-1]['workers'], None) +class CommmandLineTestsWithSourceEpoch(CommandLineTestsBase, + unittest.TestCase, + metaclass=SourceDateEpochTestMeta, + source_date_epoch=True): + pass + + +class CommmandLineTestsNoSourceEpoch(CommandLineTestsBase, + unittest.TestCase, + metaclass=SourceDateEpochTestMeta, + source_date_epoch=False): + pass + + + if __name__ == "__main__": unittest.main() diff --git a/Lib/test/test_importlib/source/test_file_loader.py b/Lib/test/test_importlib/source/test_file_loader.py index cc80f26357ed..c916d7cea0a1 100644 --- a/Lib/test/test_importlib/source/test_file_loader.py +++ b/Lib/test/test_importlib/source/test_file_loader.py @@ -19,6 +19,9 @@ from test.support import make_legacy_pyc, unload +from test.test_py_compile import without_source_date_epoch +from test.test_py_compile import SourceDateEpochTestMeta + class SimpleTest(abc.LoaderTests): @@ -359,6 +362,17 @@ def test_overiden_unchecked_hash_based_pyc(self): abc=importlib_abc, util=importlib_util) +class SourceDateEpochTestMeta(SourceDateEpochTestMeta, + type(Source_SimpleTest)): + pass + + +class SourceDateEpoch_SimpleTest(Source_SimpleTest, + metaclass=SourceDateEpochTestMeta, + source_date_epoch=True): + pass + + class BadBytecodeTest: def import_(self, file, module_name): @@ -617,6 +631,7 @@ def test_bad_marshal(self): # [bad timestamp] @util.writes_bytecode_files + @without_source_date_epoch def test_old_timestamp(self): # When the timestamp is older than the source, bytecode should be # regenerated. diff --git a/Lib/test/test_py_compile.py b/Lib/test/test_py_compile.py index 8fc0b3308c91..f86abe26f97a 100644 --- a/Lib/test/test_py_compile.py +++ b/Lib/test/test_py_compile.py @@ -1,3 +1,4 @@ +import functools import importlib.util import os import py_compile @@ -10,7 +11,44 @@ from test import support -class PyCompileTests(unittest.TestCase): +def without_source_date_epoch(fxn): + """Runs function with SOURCE_DATE_EPOCH unset.""" + @functools.wraps(fxn) + def wrapper(*args, **kwargs): + with support.EnvironmentVarGuard() as env: + env.unset('SOURCE_DATE_EPOCH') + return fxn(*args, **kwargs) + return wrapper + + +def with_source_date_epoch(fxn): + """Runs function with SOURCE_DATE_EPOCH set.""" + @functools.wraps(fxn) + def wrapper(*args, **kwargs): + with support.EnvironmentVarGuard() as env: + env['SOURCE_DATE_EPOCH'] = '123456789' + return fxn(*args, **kwargs) + return wrapper + + +# Run tests with SOURCE_DATE_EPOCH set or unset explicitly. +class SourceDateEpochTestMeta(type(unittest.TestCase)): + def __new__(mcls, name, bases, dct, *, source_date_epoch): + cls = super().__new__(mcls, name, bases, dct) + + for attr in dir(cls): + if attr.startswith('test_'): + meth = getattr(cls, attr) + if source_date_epoch: + wrapper = with_source_date_epoch(meth) + else: + wrapper = without_source_date_epoch(meth) + setattr(cls, attr, wrapper) + + return cls + + +class PyCompileTestsBase: def setUp(self): self.directory = tempfile.mkdtemp() @@ -99,16 +137,18 @@ def test_bad_coding(self): importlib.util.cache_from_source(bad_coding))) def test_source_date_epoch(self): - testtime = 123456789 - with support.EnvironmentVarGuard() as env: - env["SOURCE_DATE_EPOCH"] = str(testtime) - py_compile.compile(self.source_path, self.pyc_path) + py_compile.compile(self.source_path, self.pyc_path) self.assertTrue(os.path.exists(self.pyc_path)) self.assertFalse(os.path.exists(self.cache_path)) with open(self.pyc_path, 'rb') as fp: flags = importlib._bootstrap_external._classify_pyc( fp.read(), 'test', {}) - self.assertEqual(flags, 0b11) + if os.environ.get('SOURCE_DATE_EPOCH'): + expected_flags = 0b11 + else: + expected_flags = 0b00 + + self.assertEqual(flags, expected_flags) @unittest.skipIf(sys.flags.optimize > 0, 'test does not work with -O') def test_double_dot_no_clobber(self): @@ -153,5 +193,19 @@ def test_invalidation_mode(self): self.assertEqual(flags, 0b1) +class PyCompileTestsWithSourceEpoch(PyCompileTestsBase, + unittest.TestCase, + metaclass=SourceDateEpochTestMeta, + source_date_epoch=True): + pass + + +class PyCompileTestsWithoutSourceEpoch(PyCompileTestsBase, + unittest.TestCase, + metaclass=SourceDateEpochTestMeta, + source_date_epoch=False): + pass + + if __name__ == "__main__": unittest.main() diff --git a/Misc/NEWS.d/next/Library/2018-09-27-13-14-15.bpo-34022.E2cl0r.rst b/Misc/NEWS.d/next/Library/2018-09-27-13-14-15.bpo-34022.E2cl0r.rst new file mode 100644 index 000000000000..efebb84304bf --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-09-27-13-14-15.bpo-34022.E2cl0r.rst @@ -0,0 +1,3 @@ +The :envvar:`SOURCE_DATE_EPOCH` environment variable no longer overrides the +value of the *invalidation_mode* argument to :func:`py_compile.compile`, and +determines its default value instead. From webhook-mailer at python.org Wed Nov 28 12:58:35 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 28 Nov 2018 17:58:35 -0000 Subject: [Python-checkins] bpo-33723: Remove busy loop from test_time (GH-10773) Message-ID: https://github.com/python/cpython/commit/d46d753d152a5d01f9c454d18b1ae660509d9b16 commit: d46d753d152a5d01f9c454d18b1ae660509d9b16 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-28T09:58:31-08:00 summary: bpo-33723: Remove busy loop from test_time (GH-10773) The "busy loops" of test_process_time() and test_thread_time() are not reliable and fail randomly on Windows: remove them. (cherry picked from commit 48498dd57f79ab1d061c754ad6a2ebe1a7172b0e) Co-authored-by: Victor Stinner files: M Lib/test/test_time.py diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py index b9c678640808..ea455c0d0d13 100644 --- a/Lib/test/test_time.py +++ b/Lib/test/test_time.py @@ -47,12 +47,6 @@ class _PyTime(enum.IntEnum): ) -def busy_wait(duration): - deadline = time.monotonic() + duration - while time.monotonic() < deadline: - pass - - class TimeTestCase(unittest.TestCase): def setUp(self): @@ -496,25 +490,6 @@ def test_process_time(self): # on Windows self.assertLess(stop - start, 0.020) - # bpo-33723: A busy loop of 100 ms should increase process_time() - # by at least 15 ms. Tolerate 15 ms because of the bad resolution of - # the clock on Windows (around 15.6 ms). - min_time = 0.015 - busy_time = 0.100 - - # process_time() should include CPU time spent in any thread - start = time.process_time() - busy_wait(busy_time) - stop = time.process_time() - self.assertGreaterEqual(stop - start, min_time) - - t = threading.Thread(target=busy_wait, args=(busy_time,)) - start = time.process_time() - t.start() - t.join() - stop = time.process_time() - self.assertGreaterEqual(stop - start, min_time) - info = time.get_clock_info('process_time') self.assertTrue(info.monotonic) self.assertFalse(info.adjustable) @@ -535,28 +510,6 @@ def test_thread_time(self): # on Windows self.assertLess(stop - start, 0.020) - # bpo-33723: A busy loop of 100 ms should increase thread_time() - # by at least 15 ms, but less than 30 ms in other threads. - # Tolerate 15 and 30 ms because of the bad resolution - # of the clock on Windows (around 15.6 ms). - min_time = 0.015 - max_time = 0.030 - busy_time = 0.100 - - # thread_time() should include CPU time spent in current thread... - start = time.thread_time() - busy_wait(busy_time) - stop = time.thread_time() - self.assertGreaterEqual(stop - start, min_time) - - # ...but not in other threads - t = threading.Thread(target=busy_wait, args=(busy_time,)) - start = time.thread_time() - t.start() - t.join() - stop = time.thread_time() - self.assertLess(stop - start, max_time) - info = time.get_clock_info('thread_time') self.assertTrue(info.monotonic) self.assertFalse(info.adjustable) From webhook-mailer at python.org Wed Nov 28 15:12:59 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 28 Nov 2018 20:12:59 -0000 Subject: [Python-checkins] pythoninfo: log more environment variable (GH-10719) (GH-10774) Message-ID: https://github.com/python/cpython/commit/22338f3f8b7e14289d3c5833edd4977ecd02a780 commit: 22338f3f8b7e14289d3c5833edd4977ecd02a780 branch: 2.7 author: Victor Stinner committer: GitHub date: 2018-11-28T21:12:54+01:00 summary: pythoninfo: log more environment variable (GH-10719) (GH-10774) Log TZ to debug a timezone issue... and a few more :-) (cherry picked from commit 282c03d45d2d766c55904a4eb766923a2c459124) files: M Lib/test/pythoninfo.py diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py index d588353ce9cb..693a13525ff3 100644 --- a/Lib/test/pythoninfo.py +++ b/Lib/test/pythoninfo.py @@ -199,32 +199,73 @@ def format_groups(groups): call_func(info_add, 'os.cpu_count', os, 'cpu_count') call_func(info_add, 'os.loadavg', os, 'getloadavg') - # Get environment variables: filter to list - # to not leak sensitive information - ENV_VARS = ( + # Environment variables used by the stdlib and tests. Don't log the full + # environment: filter to list to not leak sensitive information. + # + # HTTP_PROXY is not logged because it can contain a password. + ENV_VARS = frozenset(( + "APPDATA", + "AR", + "ARCHFLAGS", + "ARFLAGS", + "AUDIODEV", "CC", + "CFLAGS", + "COLUMNS", + "COMPUTERNAME", "COMSPEC", + "CPP", + "CPPFLAGS", "DISPLAY", + "DISTUTILS_DEBUG", "DISTUTILS_USE_SDK", "DYLD_LIBRARY_PATH", + "ENSUREPIP_OPTIONS", + "HISTORY_FILE", "HOME", "HOMEDRIVE", "HOMEPATH", + "IDLESTARTUP", "LANG", + "LDFLAGS", + "LDSHARED", "LD_LIBRARY_PATH", + "LINES", "MACOSX_DEPLOYMENT_TARGET", + "MAILCAPS", "MAKEFLAGS", + "MIXERDEV", "MSSDK", "PATH", + "PATHEXT", + "PIP_CONFIG_FILE", + "PLAT", + "POSIXLY_CORRECT", + "PY_SAX_PARSER", + "ProgramFiles", + "ProgramFiles(x86)", + "RUNNING_ON_VALGRIND", "SDK_TOOLS_BIN", + "SERVER_SOFTWARE", "SHELL", + "SOURCE_DATE_EPOCH", + "SYSTEMROOT", "TEMP", "TERM", + "TILE_LIBRARY", + "TIX_LIBRARY", "TMP", "TMPDIR", + "TZ", "USERPROFILE", + "VIRTUAL_ENV", "WAYLAND_DISPLAY", - ) + "WINDIR", + "_PYTHON_HOST_PLATFORM", + "_PYTHON_PROJECT_BASE", + "_PYTHON_SYSCONFIGDATA_NAME", + "__PYVENV_LAUNCHER__", + )) for name, value in os.environ.items(): uname = name.upper() if (uname in ENV_VARS From webhook-mailer at python.org Wed Nov 28 19:34:56 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 29 Nov 2018 00:34:56 -0000 Subject: [Python-checkins] bpo-35189, bpo-35316: Make test_eintr less strict (GH-10782) Message-ID: https://github.com/python/cpython/commit/2956bffbc00127af65f69e04d7979021a21d1288 commit: 2956bffbc00127af65f69e04d7979021a21d1288 branch: master author: Victor Stinner committer: GitHub date: 2018-11-29T01:34:51+01:00 summary: bpo-35189, bpo-35316: Make test_eintr less strict (GH-10782) test_eintr no longer fails if the signal handler has not been called. files: M Lib/test/eintrdata/eintr_tester.py diff --git a/Lib/test/eintrdata/eintr_tester.py b/Lib/test/eintrdata/eintr_tester.py index c2eaf0128a5f..aa7cfd14d9f9 100644 --- a/Lib/test/eintrdata/eintr_tester.py +++ b/Lib/test/eintrdata/eintr_tester.py @@ -69,8 +69,6 @@ def tearDown(self): signal.signal(signal.SIGALRM, self.orig_handler) if hasattr(faulthandler, 'cancel_dump_traceback_later'): faulthandler.cancel_dump_traceback_later() - # make sure that at least one signal has been received - self.assertGreater(self.signals, 0) def subprocess(self, *args, **kw): cmd_args = (sys.executable, '-c') + args From webhook-mailer at python.org Wed Nov 28 19:52:16 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 29 Nov 2018 00:52:16 -0000 Subject: [Python-checkins] bpo-35189, bpo-35316: Make test_eintr less strict (GH-10782) Message-ID: https://github.com/python/cpython/commit/2fa5b2ac4485c5c9083b4b0459dd9b691daaea28 commit: 2fa5b2ac4485c5c9083b4b0459dd9b691daaea28 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-28T16:52:11-08:00 summary: bpo-35189, bpo-35316: Make test_eintr less strict (GH-10782) test_eintr no longer fails if the signal handler has not been called. (cherry picked from commit 2956bffbc00127af65f69e04d7979021a21d1288) Co-authored-by: Victor Stinner files: M Lib/test/eintrdata/eintr_tester.py diff --git a/Lib/test/eintrdata/eintr_tester.py b/Lib/test/eintrdata/eintr_tester.py index c2eaf0128a5f..aa7cfd14d9f9 100644 --- a/Lib/test/eintrdata/eintr_tester.py +++ b/Lib/test/eintrdata/eintr_tester.py @@ -69,8 +69,6 @@ def tearDown(self): signal.signal(signal.SIGALRM, self.orig_handler) if hasattr(faulthandler, 'cancel_dump_traceback_later'): faulthandler.cancel_dump_traceback_later() - # make sure that at least one signal has been received - self.assertGreater(self.signals, 0) def subprocess(self, *args, **kw): cmd_args = (sys.executable, '-c') + args From webhook-mailer at python.org Wed Nov 28 19:57:22 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 29 Nov 2018 00:57:22 -0000 Subject: [Python-checkins] bpo-35189, bpo-35316: Make test_eintr less strict (GH-10782) Message-ID: https://github.com/python/cpython/commit/833a7067a4d5621d024511d9166db7331c4650c9 commit: 833a7067a4d5621d024511d9166db7331c4650c9 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-28T16:57:18-08:00 summary: bpo-35189, bpo-35316: Make test_eintr less strict (GH-10782) test_eintr no longer fails if the signal handler has not been called. (cherry picked from commit 2956bffbc00127af65f69e04d7979021a21d1288) Co-authored-by: Victor Stinner files: M Lib/test/eintrdata/eintr_tester.py diff --git a/Lib/test/eintrdata/eintr_tester.py b/Lib/test/eintrdata/eintr_tester.py index c2eaf0128a5f..aa7cfd14d9f9 100644 --- a/Lib/test/eintrdata/eintr_tester.py +++ b/Lib/test/eintrdata/eintr_tester.py @@ -69,8 +69,6 @@ def tearDown(self): signal.signal(signal.SIGALRM, self.orig_handler) if hasattr(faulthandler, 'cancel_dump_traceback_later'): faulthandler.cancel_dump_traceback_later() - # make sure that at least one signal has been received - self.assertGreater(self.signals, 0) def subprocess(self, *args, **kw): cmd_args = (sys.executable, '-c') + args From webhook-mailer at python.org Wed Nov 28 21:14:08 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 29 Nov 2018 02:14:08 -0000 Subject: [Python-checkins] bpo-28167: Remove platform._dist_try_harder() (GH-10787) Message-ID: https://github.com/python/cpython/commit/7cc1fa40b76de34a0fe86162667c87ce7a18f33d commit: 7cc1fa40b76de34a0fe86162667c87ce7a18f33d branch: master author: Victor Stinner committer: GitHub date: 2018-11-29T03:14:03+01:00 summary: bpo-28167: Remove platform._dist_try_harder() (GH-10787) platform._dist_try_harder() was an helper function for platform.linux_distribution() which has been removed by the commit 8b94b41ab7b12f745dea744e8940631318816935. files: M Lib/platform.py diff --git a/Lib/platform.py b/Lib/platform.py index f7e24d739c6d..b4d4744dadc7 100755 --- a/Lib/platform.py +++ b/Lib/platform.py @@ -227,54 +227,6 @@ def libc_ver(executable=sys.executable, lib='', version='', chunksize=16384): pos = m.end() return lib, version -def _dist_try_harder(distname, version, id): - - """ Tries some special tricks to get the distribution - information in case the default method fails. - - Currently supports older SuSE Linux, Caldera OpenLinux and - Slackware Linux distributions. - - """ - if os.path.exists('/var/adm/inst-log/info'): - # SuSE Linux stores distribution information in that file - distname = 'SuSE' - for line in open('/var/adm/inst-log/info'): - tv = line.split() - if len(tv) == 2: - tag, value = tv - else: - continue - if tag == 'MIN_DIST_VERSION': - version = value.strip() - elif tag == 'DIST_IDENT': - values = value.split('-') - id = values[2] - return distname, version, id - - if os.path.exists('/etc/.installed'): - # Caldera OpenLinux has some infos in that file (thanks to Colin Kong) - for line in open('/etc/.installed'): - pkg = line.split('-') - if len(pkg) >= 2 and pkg[0] == 'OpenLinux': - # XXX does Caldera support non Intel platforms ? If yes, - # where can we find the needed id ? - return 'OpenLinux', pkg[1], id - - if os.path.isdir('/usr/lib/setup'): - # Check for slackware version tag file (thanks to Greg Andruk) - verfiles = os.listdir('/usr/lib/setup') - for n in range(len(verfiles)-1, -1, -1): - if verfiles[n][:14] != 'slack-version-': - del verfiles[n] - if verfiles: - verfiles.sort() - distname = 'slackware' - version = verfiles[-1][14:] - return distname, version, id - - return distname, version, id - def popen(cmd, mode='r', bufsize=-1): """ Portable popen() interface. From webhook-mailer at python.org Thu Nov 29 02:37:20 2018 From: webhook-mailer at python.org (Benjamin Peterson) Date: Thu, 29 Nov 2018 07:37:20 -0000 Subject: [Python-checkins] closes bpo-35340: Add freegrammar to pgenheaders.h. (GH-10788) Message-ID: https://github.com/python/cpython/commit/2e869a8f8280b5c786b3fde1f990e13927625e7a commit: 2e869a8f8280b5c786b3fde1f990e13927625e7a branch: 2.7 author: Benjamin Peterson committer: GitHub date: 2018-11-29T01:37:15-06:00 summary: closes bpo-35340: Add freegrammar to pgenheaders.h. (GH-10788) files: M Include/pgenheaders.h diff --git a/Include/pgenheaders.h b/Include/pgenheaders.h index 2049ae32bb1d..4843de6c023e 100644 --- a/Include/pgenheaders.h +++ b/Include/pgenheaders.h @@ -23,6 +23,7 @@ PyAPI_FUNC(void) PySys_WriteStderr(const char *format, ...) #define delbitset _Py_delbitset #define dumptree _Py_dumptree #define findlabel _Py_findlabel +#define freegrammar _Py_freegrammar #define mergebitset _Py_mergebitset #define meta_grammar _Py_meta_grammar #define newbitset _Py_newbitset From webhook-mailer at python.org Thu Nov 29 03:58:24 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 29 Nov 2018 08:58:24 -0000 Subject: [Python-checkins] bpo-35345: Remove platform.popen() (GH-10781) Message-ID: https://github.com/python/cpython/commit/73104fa1e6a791f7d66c0091ed91f6c396ca0fb2 commit: 73104fa1e6a791f7d66c0091ed91f6c396ca0fb2 branch: master author: Victor Stinner committer: GitHub date: 2018-11-29T09:58:20+01:00 summary: bpo-35345: Remove platform.popen() (GH-10781) Remove platform.popen() function, it was deprecated since Python 3.3: use os.popen() instead. Rename also the "Removed" section to "API and Feature Removals" of What's New in Python 3.8. files: A Misc/NEWS.d/next/Library/2018-11-29-00-55-33.bpo-35345.vepCSJ.rst M Doc/library/platform.rst M Doc/whatsnew/3.8.rst M Lib/platform.py M Lib/test/test_platform.py diff --git a/Doc/library/platform.rst b/Doc/library/platform.rst index 92691fcbeab4..7ac4b027418e 100644 --- a/Doc/library/platform.rst +++ b/Doc/library/platform.rst @@ -212,20 +212,6 @@ Windows Platform only runs on Win32 compatible platforms. -Win95/98 specific -^^^^^^^^^^^^^^^^^ - -.. function:: popen(cmd, mode='r', bufsize=-1) - - Portable :func:`popen` interface. Find a working popen implementation - preferring :func:`win32pipe.popen`. On Windows NT, :func:`win32pipe.popen` - should work; on Windows 9x it hangs due to bugs in the MS C library. - - .. deprecated:: 3.3 - This function is obsolete. Use the :mod:`subprocess` module. Check - especially the :ref:`subprocess-replacements` section. - - Mac OS Platform --------------- diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index e5e6d4a59944..5492a90aacec 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -373,8 +373,13 @@ Deprecated (Contributed by Serhiy Storchaka in :issue:`33710`.) -Removed -======= +API and Feature Removals +======================== + +The following features and APIs have been removed from Python 3.8: + +* The function :func:`platform.popen` has been removed, it was deprecated since + Python 3.3: use :func:`os.popen` instead. * The ``pyvenv`` script has been removed in favor of ``python3.8 -m venv`` to help eliminate confusion as to what Python interpreter the ``pyvenv`` @@ -414,6 +419,9 @@ Changes in Python behavior Changes in the Python API ------------------------- +* The function :func:`platform.popen` has been removed, it was deprecated since + Python 3.3: use :func:`os.popen` instead. + * The :meth:`~tkinter.ttk.Treeview.selection` method of the :class:`tkinter.ttk.Treeview` class no longer takes arguments. Using it with arguments for changing the selection was deprecated in Python 3.6. Use diff --git a/Lib/platform.py b/Lib/platform.py index b4d4744dadc7..98ee06f85ef1 100755 --- a/Lib/platform.py +++ b/Lib/platform.py @@ -227,15 +227,6 @@ def libc_ver(executable=sys.executable, lib='', version='', chunksize=16384): pos = m.end() return lib, version -def popen(cmd, mode='r', bufsize=-1): - - """ Portable popen() interface. - """ - import warnings - warnings.warn('use os.popen instead', DeprecationWarning, stacklevel=2) - return os.popen(cmd, mode, bufsize) - - def _norm_version(version, build=''): """ Normalize the version and build strings and return a single diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py index c92da904fc5b..686f454827fd 100644 --- a/Lib/test/test_platform.py +++ b/Lib/test/test_platform.py @@ -3,9 +3,7 @@ import subprocess import sys import sysconfig -import tempfile import unittest -import warnings from test import support @@ -316,37 +314,6 @@ def test__comparable_version(self): self.assertLess(V('1.13++'), V('5.5.kw')) self.assertLess(V('0.960923'), V('2.2beta29')) - def test_popen(self): - mswindows = (sys.platform == "win32") - - if mswindows: - command = '"{}" -c "print(\'Hello\')"'.format(sys.executable) - else: - command = "'{}' -c 'print(\"Hello\")'".format(sys.executable) - with warnings.catch_warnings(): - warnings.simplefilter("ignore", DeprecationWarning) - with platform.popen(command) as stdout: - hello = stdout.read().strip() - stdout.close() - self.assertEqual(hello, "Hello") - - data = 'plop' - if mswindows: - command = '"{}" -c "import sys; data=sys.stdin.read(); exit(len(data))"' - else: - command = "'{}' -c 'import sys; data=sys.stdin.read(); exit(len(data))'" - command = command.format(sys.executable) - with warnings.catch_warnings(): - warnings.simplefilter("ignore", DeprecationWarning) - with platform.popen(command, 'w') as stdin: - stdout = stdin.write(data) - ret = stdin.close() - self.assertIsNotNone(ret) - if os.name == 'nt': - returncode = ret - else: - returncode = ret >> 8 - self.assertEqual(returncode, len(data)) if __name__ == '__main__': unittest.main() diff --git a/Misc/NEWS.d/next/Library/2018-11-29-00-55-33.bpo-35345.vepCSJ.rst b/Misc/NEWS.d/next/Library/2018-11-29-00-55-33.bpo-35345.vepCSJ.rst new file mode 100644 index 000000000000..e4d3b52c9ef5 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-11-29-00-55-33.bpo-35345.vepCSJ.rst @@ -0,0 +1,2 @@ +The function `platform.popen` has been removed, it was deprecated since Python +3.3: use :func:`os.popen` instead. From solipsis at pitrou.net Thu Nov 29 04:06:56 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Thu, 29 Nov 2018 09:06:56 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=7 Message-ID: <20181129090656.1.E3E647C4EC7099E2@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_asyncio leaked [0, 3, 0] memory blocks, sum=3 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_fork leaked [0, -2, 2] memory blocks, sum=0 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflog9OFQEa', '--timeout', '7200'] From webhook-mailer at python.org Thu Nov 29 04:11:44 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 29 Nov 2018 09:11:44 -0000 Subject: [Python-checkins] bpo-16086: Fix PyType_GetFlags() documentation (GH-10758) Message-ID: https://github.com/python/cpython/commit/9fbcfc08e5814d7aa9287740187e461425a99f67 commit: 9fbcfc08e5814d7aa9287740187e461425a99f67 branch: master author: Eddie Elizondo committer: Victor Stinner date: 2018-11-29T10:11:36+01:00 summary: bpo-16086: Fix PyType_GetFlags() documentation (GH-10758) PyType_GetFlags() return type is unsigned long, not long. files: M Doc/c-api/type.rst diff --git a/Doc/c-api/type.rst b/Doc/c-api/type.rst index 60c5e73960b3..4dfd53fb9f07 100644 --- a/Doc/c-api/type.rst +++ b/Doc/c-api/type.rst @@ -35,7 +35,7 @@ Type Objects Clear the internal lookup cache. Return the current version tag. -.. c:function:: long PyType_GetFlags(PyTypeObject* type) +.. c:function:: unsigned long PyType_GetFlags(PyTypeObject* type) Return the :c:member:`~PyTypeObject.tp_flags` member of *type*. This function is primarily meant for use with `Py_LIMITED_API`; the individual flag bits are @@ -44,6 +44,9 @@ Type Objects .. versionadded:: 3.2 + .. versionchanged:: 3.4 + The return type is now ``unsigned long`` rather than ``long``. + .. c:function:: void PyType_Modified(PyTypeObject *type) From webhook-mailer at python.org Thu Nov 29 06:01:33 2018 From: webhook-mailer at python.org (INADA Naoki) Date: Thu, 29 Nov 2018 11:01:33 -0000 Subject: [Python-checkins] bpo-30167: Remove __cached__ from __main__ when removing __file__ (GH-7415) Message-ID: https://github.com/python/cpython/commit/82daa60defbd6497efdaa6c1132ecc8563122ed5 commit: 82daa60defbd6497efdaa6c1132ecc8563122ed5 branch: master author: INADA Naoki committer: GitHub date: 2018-11-29T20:01:27+09:00 summary: bpo-30167: Remove __cached__ from __main__ when removing __file__ (GH-7415) files: A Misc/NEWS.d/next/Core and Builtins/2018-06-05-15-49-02.bpo-30167.e956hA.rst M Python/pythonrun.c diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-06-05-15-49-02.bpo-30167.e956hA.rst b/Misc/NEWS.d/next/Core and Builtins/2018-06-05-15-49-02.bpo-30167.e956hA.rst new file mode 100644 index 000000000000..41bdec899b75 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-06-05-15-49-02.bpo-30167.e956hA.rst @@ -0,0 +1,2 @@ +``PyRun_SimpleFileExFlags`` removes ``__cached__`` from module in addition +to ``__file__``. diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 2d5dc88c5c76..9b6371d9c0da 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -434,8 +434,14 @@ PyRun_SimpleFileExFlags(FILE *fp, const char *filename, int closeit, Py_DECREF(v); ret = 0; done: - if (set_file_name && PyDict_DelItemString(d, "__file__")) - PyErr_Clear(); + if (set_file_name) { + if (PyDict_DelItemString(d, "__file__")) { + PyErr_Clear(); + } + if (PyDict_DelItemString(d, "__cached__")) { + PyErr_Clear(); + } + } Py_XDECREF(m); return ret; } From webhook-mailer at python.org Thu Nov 29 06:07:37 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 29 Nov 2018 11:07:37 -0000 Subject: [Python-checkins] bpo-16086: Fix PyType_GetFlags() documentation (GH-10758) (GH-10789) Message-ID: https://github.com/python/cpython/commit/e754159ef0af99a4124dd041ab7ceb77fcc922ad commit: e754159ef0af99a4124dd041ab7ceb77fcc922ad branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Victor Stinner date: 2018-11-29T12:07:33+01:00 summary: bpo-16086: Fix PyType_GetFlags() documentation (GH-10758) (GH-10789) PyType_GetFlags() return type is unsigned long, not long. (cherry picked from commit 9fbcfc08e5814d7aa9287740187e461425a99f67) Co-authored-by: Eddie Elizondo files: M Doc/c-api/type.rst diff --git a/Doc/c-api/type.rst b/Doc/c-api/type.rst index 60c5e73960b3..4dfd53fb9f07 100644 --- a/Doc/c-api/type.rst +++ b/Doc/c-api/type.rst @@ -35,7 +35,7 @@ Type Objects Clear the internal lookup cache. Return the current version tag. -.. c:function:: long PyType_GetFlags(PyTypeObject* type) +.. c:function:: unsigned long PyType_GetFlags(PyTypeObject* type) Return the :c:member:`~PyTypeObject.tp_flags` member of *type*. This function is primarily meant for use with `Py_LIMITED_API`; the individual flag bits are @@ -44,6 +44,9 @@ Type Objects .. versionadded:: 3.2 + .. versionchanged:: 3.4 + The return type is now ``unsigned long`` rather than ``long``. + .. c:function:: void PyType_Modified(PyTypeObject *type) From webhook-mailer at python.org Thu Nov 29 06:07:41 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 29 Nov 2018 11:07:41 -0000 Subject: [Python-checkins] bpo-16086: Fix PyType_GetFlags() documentation (GH-10758) (GH-10790) Message-ID: https://github.com/python/cpython/commit/2a852a2b122cf9545909234cdc8fca564dc8f805 commit: 2a852a2b122cf9545909234cdc8fca564dc8f805 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Victor Stinner date: 2018-11-29T12:07:38+01:00 summary: bpo-16086: Fix PyType_GetFlags() documentation (GH-10758) (GH-10790) PyType_GetFlags() return type is unsigned long, not long. (cherry picked from commit 9fbcfc08e5814d7aa9287740187e461425a99f67) Co-authored-by: Eddie Elizondo files: M Doc/c-api/type.rst diff --git a/Doc/c-api/type.rst b/Doc/c-api/type.rst index 60c5e73960b3..4dfd53fb9f07 100644 --- a/Doc/c-api/type.rst +++ b/Doc/c-api/type.rst @@ -35,7 +35,7 @@ Type Objects Clear the internal lookup cache. Return the current version tag. -.. c:function:: long PyType_GetFlags(PyTypeObject* type) +.. c:function:: unsigned long PyType_GetFlags(PyTypeObject* type) Return the :c:member:`~PyTypeObject.tp_flags` member of *type*. This function is primarily meant for use with `Py_LIMITED_API`; the individual flag bits are @@ -44,6 +44,9 @@ Type Objects .. versionadded:: 3.2 + .. versionchanged:: 3.4 + The return type is now ``unsigned long`` rather than ``long``. + .. c:function:: void PyType_Modified(PyTypeObject *type) From webhook-mailer at python.org Thu Nov 29 06:31:12 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 29 Nov 2018 11:31:12 -0000 Subject: [Python-checkins] bpo-27903: Fix ResourceWarning in platform.dist() (GH-10792) Message-ID: https://github.com/python/cpython/commit/7eeab87263b831adbe617a4af7ec5b5d9296962a commit: 7eeab87263b831adbe617a4af7ec5b5d9296962a branch: 3.7 author: Victor Stinner committer: GitHub date: 2018-11-29T12:31:08+01:00 summary: bpo-27903: Fix ResourceWarning in platform.dist() (GH-10792) Fix ResourceWarning in platform.dist() and platform.linux_distribution() on SuSE and Caldera OpenLinux. Patch by Ville Skytt?. files: A Misc/NEWS.d/next/Library/2018-11-29-12-14-04.bpo-27903.ia8xgT.rst M Lib/platform.py diff --git a/Lib/platform.py b/Lib/platform.py index 4482f479bfde..0c6fc03efa9f 100755 --- a/Lib/platform.py +++ b/Lib/platform.py @@ -243,27 +243,29 @@ def _dist_try_harder(distname, version, id): if os.path.exists('/var/adm/inst-log/info'): # SuSE Linux stores distribution information in that file distname = 'SuSE' - for line in open('/var/adm/inst-log/info'): - tv = line.split() - if len(tv) == 2: - tag, value = tv - else: - continue - if tag == 'MIN_DIST_VERSION': - version = value.strip() - elif tag == 'DIST_IDENT': - values = value.split('-') - id = values[2] + with open('/var/adm/inst-log/info') as f: + for line in f: + tv = line.split() + if len(tv) == 2: + tag, value = tv + else: + continue + if tag == 'MIN_DIST_VERSION': + version = value.strip() + elif tag == 'DIST_IDENT': + values = value.split('-') + id = values[2] return distname, version, id if os.path.exists('/etc/.installed'): # Caldera OpenLinux has some infos in that file (thanks to Colin Kong) - for line in open('/etc/.installed'): - pkg = line.split('-') - if len(pkg) >= 2 and pkg[0] == 'OpenLinux': - # XXX does Caldera support non Intel platforms ? If yes, - # where can we find the needed id ? - return 'OpenLinux', pkg[1], id + with open('/etc/.installed') as f: + for line in f: + pkg = line.split('-') + if len(pkg) >= 2 and pkg[0] == 'OpenLinux': + # XXX does Caldera support non Intel platforms ? If yes, + # where can we find the needed id ? + return 'OpenLinux', pkg[1], id if os.path.isdir('/usr/lib/setup'): # Check for slackware version tag file (thanks to Greg Andruk) diff --git a/Misc/NEWS.d/next/Library/2018-11-29-12-14-04.bpo-27903.ia8xgT.rst b/Misc/NEWS.d/next/Library/2018-11-29-12-14-04.bpo-27903.ia8xgT.rst new file mode 100644 index 000000000000..8cdf75bc10c9 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-11-29-12-14-04.bpo-27903.ia8xgT.rst @@ -0,0 +1,2 @@ +Fix ``ResourceWarning`` in :func:`platform.dist` on SuSE and Caldera +OpenLinux. Patch by Ville Skytt?. From webhook-mailer at python.org Thu Nov 29 06:53:22 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 29 Nov 2018 11:53:22 -0000 Subject: [Python-checkins] bpo-27903: Fix ResourceWarning in platform.dist() (GH-10792) Message-ID: https://github.com/python/cpython/commit/cbf57674e257617977b35c016e861a52b5f65359 commit: cbf57674e257617977b35c016e861a52b5f65359 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-29T03:53:19-08:00 summary: bpo-27903: Fix ResourceWarning in platform.dist() (GH-10792) Fix ResourceWarning in platform.dist() and platform.linux_distribution() on SuSE and Caldera OpenLinux. Patch by Ville Skytt?. (cherry picked from commit 7eeab87263b831adbe617a4af7ec5b5d9296962a) Co-authored-by: Victor Stinner files: A Misc/NEWS.d/next/Library/2018-11-29-12-14-04.bpo-27903.ia8xgT.rst M Lib/platform.py diff --git a/Lib/platform.py b/Lib/platform.py index 4205abde0388..fa56d4114ce5 100755 --- a/Lib/platform.py +++ b/Lib/platform.py @@ -243,27 +243,29 @@ def _dist_try_harder(distname, version, id): if os.path.exists('/var/adm/inst-log/info'): # SuSE Linux stores distribution information in that file distname = 'SuSE' - for line in open('/var/adm/inst-log/info'): - tv = line.split() - if len(tv) == 2: - tag, value = tv - else: - continue - if tag == 'MIN_DIST_VERSION': - version = value.strip() - elif tag == 'DIST_IDENT': - values = value.split('-') - id = values[2] + with open('/var/adm/inst-log/info') as f: + for line in f: + tv = line.split() + if len(tv) == 2: + tag, value = tv + else: + continue + if tag == 'MIN_DIST_VERSION': + version = value.strip() + elif tag == 'DIST_IDENT': + values = value.split('-') + id = values[2] return distname, version, id if os.path.exists('/etc/.installed'): # Caldera OpenLinux has some infos in that file (thanks to Colin Kong) - for line in open('/etc/.installed'): - pkg = line.split('-') - if len(pkg) >= 2 and pkg[0] == 'OpenLinux': - # XXX does Caldera support non Intel platforms ? If yes, - # where can we find the needed id ? - return 'OpenLinux', pkg[1], id + with open('/etc/.installed') as f: + for line in f: + pkg = line.split('-') + if len(pkg) >= 2 and pkg[0] == 'OpenLinux': + # XXX does Caldera support non Intel platforms ? If yes, + # where can we find the needed id ? + return 'OpenLinux', pkg[1], id if os.path.isdir('/usr/lib/setup'): # Check for slackware version tag file (thanks to Greg Andruk) diff --git a/Misc/NEWS.d/next/Library/2018-11-29-12-14-04.bpo-27903.ia8xgT.rst b/Misc/NEWS.d/next/Library/2018-11-29-12-14-04.bpo-27903.ia8xgT.rst new file mode 100644 index 000000000000..8cdf75bc10c9 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-11-29-12-14-04.bpo-27903.ia8xgT.rst @@ -0,0 +1,2 @@ +Fix ``ResourceWarning`` in :func:`platform.dist` on SuSE and Caldera +OpenLinux. Patch by Ville Skytt?. From webhook-mailer at python.org Thu Nov 29 08:07:10 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Thu, 29 Nov 2018 13:07:10 -0000 Subject: [Python-checkins] Use assertEqual to fix DeprecationWarning. (GH-10794) Message-ID: https://github.com/python/cpython/commit/b2774c8e91d2f55304ead0b26e9476571ec1e95b commit: b2774c8e91d2f55304ead0b26e9476571ec1e95b branch: master author: Xtreak committer: Serhiy Storchaka date: 2018-11-29T15:07:00+02:00 summary: Use assertEqual to fix DeprecationWarning. (GH-10794) files: M Lib/unittest/test/test_runner.py diff --git a/Lib/unittest/test/test_runner.py b/Lib/unittest/test/test_runner.py index 6f89f77ff778..2b475c2d8566 100644 --- a/Lib/unittest/test/test_runner.py +++ b/Lib/unittest/test/test_runner.py @@ -256,7 +256,7 @@ def cleanup2(): TestableTest.addClassCleanup(cleanup2) with self.assertRaises(Exception) as e: TestableTest.doClassCleanups() - self.assertEquals(e, 'cleanup1') + self.assertEqual(e, 'cleanup1') def test_with_errors_addCleanUp(self): ordering = [] From webhook-mailer at python.org Thu Nov 29 09:27:56 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 29 Nov 2018 14:27:56 -0000 Subject: [Python-checkins] bpo-33012: Fix more invalid function cast warnings with gcc 8. (GH-10751) Message-ID: https://github.com/python/cpython/commit/1659c08d5d17357597f220c4d297b19e7a59737c commit: 1659c08d5d17357597f220c4d297b19e7a59737c branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-29T06:27:49-08:00 summary: bpo-33012: Fix more invalid function cast warnings with gcc 8. (GH-10751) Fix warnings with gcc 8 for wrapperfunc <-> wrapperfunc_kwds casts. (cherry picked from commit 1c607155c9e363489036ae6258b165a3fae75134) Co-authored-by: Serhiy Storchaka files: M Objects/descrobject.c M Objects/typeobject.c diff --git a/Objects/descrobject.c b/Objects/descrobject.c index c6f7e55ea5d1..f19d07aa2568 100644 --- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -344,7 +344,7 @@ wrapperdescr_raw_call(PyWrapperDescrObject *descr, PyObject *self, wrapperfunc wrapper = descr->d_base->wrapper; if (descr->d_base->flags & PyWrapperFlag_KEYWORDS) { - wrapperfunc_kwds wk = (wrapperfunc_kwds)wrapper; + wrapperfunc_kwds wk = (wrapperfunc_kwds)(void(*)(void))wrapper; return (*wk)(self, args, descr->d_wrapped, kwds); } diff --git a/Objects/typeobject.c b/Objects/typeobject.c index b9e69bf1bd1d..468210574119 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -6794,7 +6794,7 @@ static slotdef slotdefs[] = { "__repr__($self, /)\n--\n\nReturn repr(self)."), TPSLOT("__hash__", tp_hash, slot_tp_hash, wrap_hashfunc, "__hash__($self, /)\n--\n\nReturn hash(self)."), - FLSLOT("__call__", tp_call, slot_tp_call, (wrapperfunc)wrap_call, + FLSLOT("__call__", tp_call, slot_tp_call, (wrapperfunc)(void(*)(void))wrap_call, "__call__($self, /, *args, **kwargs)\n--\n\nCall self as a function.", PyWrapperFlag_KEYWORDS), TPSLOT("__str__", tp_str, slot_tp_str, wrap_unaryfunc, @@ -6830,7 +6830,7 @@ static slotdef slotdefs[] = { TPSLOT("__delete__", tp_descr_set, slot_tp_descr_set, wrap_descr_delete, "__delete__($self, instance, /)\n--\n\nDelete an attribute of instance."), - FLSLOT("__init__", tp_init, slot_tp_init, (wrapperfunc)wrap_init, + FLSLOT("__init__", tp_init, slot_tp_init, (wrapperfunc)(void(*)(void))wrap_init, "__init__($self, /, *args, **kwargs)\n--\n\n" "Initialize self. See help(type(self)) for accurate signature.", PyWrapperFlag_KEYWORDS), From webhook-mailer at python.org Thu Nov 29 09:43:29 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 29 Nov 2018 14:43:29 -0000 Subject: [Python-checkins] [3.6] bpo-31625: Stop using ranlib (GH-10417) Message-ID: https://github.com/python/cpython/commit/e1b210342fa08685bf9b24eb449a2f079f1b50f5 commit: e1b210342fa08685bf9b24eb449a2f079f1b50f5 branch: 3.6 author: stratakis committer: Victor Stinner date: 2018-11-29T15:43:24+01:00 summary: [3.6] bpo-31625: Stop using ranlib (GH-10417) * stop using ranlib (closes bpo-31625) (#3815) Instead, simply pass 's' to ar. * explicitly list objects for the ar command (#3824) $^ is not portable. closes bpo-31625 files: A Misc/NEWS.d/next/Build/2017-09-28-23-21-20.bpo-31625.Bb2NXr.rst M Makefile.pre.in M configure M configure.ac diff --git a/Makefile.pre.in b/Makefile.pre.in index 82f7edd1014c..258236d36450 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -37,7 +37,6 @@ CXX= @CXX@ MAINCC= @MAINCC@ LINKCC= @LINKCC@ AR= @AR@ -RANLIB= @RANLIB@ READELF= @READELF@ SOABI= @SOABI@ LDVERSION= @LDVERSION@ @@ -593,16 +592,9 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o # Build static library -# avoid long command lines, same as LIBRARY_OBJS $(LIBRARY): $(LIBRARY_OBJS) -rm -f $@ - $(AR) $(ARFLAGS) $@ Modules/getbuildinfo.o - $(AR) $(ARFLAGS) $@ $(PARSER_OBJS) - $(AR) $(ARFLAGS) $@ $(OBJECT_OBJS) - $(AR) $(ARFLAGS) $@ $(PYTHON_OBJS) Python/frozen.o - $(AR) $(ARFLAGS) $@ $(MODULE_OBJS) - $(AR) $(ARFLAGS) $@ $(MODOBJS) - $(RANLIB) $@ + $(AR) $(ARFLAGS) $@ $(LIBRARY_OBJS) libpython$(LDVERSION).so: $(LIBRARY_OBJS) if test $(INSTSONAME) != $(LDLIBRARY); then \ @@ -1435,7 +1427,6 @@ libainstall: @DEF_MAKE_RULE@ python-config $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \ else \ $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \ - $(RANLIB) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \ fi; \ else \ echo Skip install of $(LIBRARY) - use make frameworkinstall; \ diff --git a/Misc/NEWS.d/next/Build/2017-09-28-23-21-20.bpo-31625.Bb2NXr.rst b/Misc/NEWS.d/next/Build/2017-09-28-23-21-20.bpo-31625.Bb2NXr.rst new file mode 100644 index 000000000000..dbd078f00308 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2017-09-28-23-21-20.bpo-31625.Bb2NXr.rst @@ -0,0 +1 @@ +Stop using ranlib on static libraries. Instead, we assume ar supports the 's' flag. diff --git a/configure b/configure index 9b137c72603a..ac29d65a6c08 100755 --- a/configure +++ b/configure @@ -694,8 +694,6 @@ READELF ARFLAGS ac_ct_AR AR -RANLIB -USE_INLINE GNULD LINKCC LDVERSION @@ -6029,98 +6027,6 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDLIBRARY" >&5 $as_echo "$LDLIBRARY" >&6; } -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $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 - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" -fi - if test -n "$ac_tool_prefix"; then for ac_prog in ar aal @@ -6227,7 +6133,7 @@ fi if test -z "$ARFLAGS" then - ARFLAGS="rc" + ARFLAGS="rcs" fi if test -n "$ac_tool_prefix"; then diff --git a/configure.ac b/configure.ac index f9d406e5e812..c003025e3d9b 100644 --- a/configure.ac +++ b/configure.ac @@ -1196,7 +1196,6 @@ fi AC_MSG_RESULT($LDLIBRARY) -AC_PROG_RANLIB AC_SUBST(AR) AC_CHECK_TOOLS(AR, ar aal, ar) @@ -1204,7 +1203,7 @@ AC_CHECK_TOOLS(AR, ar aal, ar) AC_SUBST(ARFLAGS) if test -z "$ARFLAGS" then - ARFLAGS="rc" + ARFLAGS="rcs" fi AC_CHECK_TOOLS([READELF], [readelf], [:]) From webhook-mailer at python.org Thu Nov 29 09:49:28 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 29 Nov 2018 14:49:28 -0000 Subject: [Python-checkins] bpo-33012: Fix more invalid function cast warnings with gcc 8. (GH-10751) (GH-10796) Message-ID: https://github.com/python/cpython/commit/77000bbb104021b89368b9f7cab6f1417794e348 commit: 77000bbb104021b89368b9f7cab6f1417794e348 branch: 3.6 author: Victor Stinner committer: GitHub date: 2018-11-29T15:49:20+01:00 summary: bpo-33012: Fix more invalid function cast warnings with gcc 8. (GH-10751) (GH-10796) Fix warnings with gcc 8 for wrapperfunc <-> wrapperfunc_kwds casts. (cherry picked from commit 1c607155c9e363489036ae6258b165a3fae75134) files: M Objects/typeobject.c diff --git a/Objects/typeobject.c b/Objects/typeobject.c index ed2d40064adc..a811eaa208de 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -6596,7 +6596,7 @@ static slotdef slotdefs[] = { "__repr__($self, /)\n--\n\nReturn repr(self)."), TPSLOT("__hash__", tp_hash, slot_tp_hash, wrap_hashfunc, "__hash__($self, /)\n--\n\nReturn hash(self)."), - FLSLOT("__call__", tp_call, slot_tp_call, (wrapperfunc)wrap_call, + FLSLOT("__call__", tp_call, slot_tp_call, (wrapperfunc)(void(*)(void))wrap_call, "__call__($self, /, *args, **kwargs)\n--\n\nCall self as a function.", PyWrapperFlag_KEYWORDS), TPSLOT("__str__", tp_str, slot_tp_str, wrap_unaryfunc, @@ -6632,7 +6632,7 @@ static slotdef slotdefs[] = { TPSLOT("__delete__", tp_descr_set, slot_tp_descr_set, wrap_descr_delete, "__delete__($self, instance, /)\n--\n\nDelete an attribute of instance."), - FLSLOT("__init__", tp_init, slot_tp_init, (wrapperfunc)wrap_init, + FLSLOT("__init__", tp_init, slot_tp_init, (wrapperfunc)(void(*)(void))wrap_init, "__init__($self, /, *args, **kwargs)\n--\n\n" "Initialize self. See help(type(self)) for accurate signature.", PyWrapperFlag_KEYWORDS), From webhook-mailer at python.org Thu Nov 29 12:17:49 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 29 Nov 2018 17:17:49 -0000 Subject: [Python-checkins] bpo-34279, regrtest: Issue a warning if no tests have been executed (GH-10150) Message-ID: https://github.com/python/cpython/commit/9724348b43a9005a449ba532ccd3c6726f031097 commit: 9724348b43a9005a449ba532ccd3c6726f031097 branch: master author: Pablo Galindo committer: Victor Stinner date: 2018-11-29T18:17:44+01:00 summary: bpo-34279, regrtest: Issue a warning if no tests have been executed (GH-10150) files: A Misc/NEWS.d/next/Tests/2018-10-27-13-41-55.bpo-34279.v0Xqxe.rst M Lib/test/libregrtest/main.py M Lib/test/libregrtest/runtest.py M Lib/test/support/__init__.py M Lib/test/test_regrtest.py diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py index a8d27ae5f332..8d44caf2999a 100644 --- a/Lib/test/libregrtest/main.py +++ b/Lib/test/libregrtest/main.py @@ -14,7 +14,7 @@ from test.libregrtest.runtest import ( findtests, runtest, get_abs_module, STDTESTS, NOTTESTS, PASSED, FAILED, ENV_CHANGED, SKIPPED, RESOURCE_DENIED, - INTERRUPTED, CHILD_ERROR, + INTERRUPTED, CHILD_ERROR, TEST_DID_NOT_RUN, PROGRESS_MIN_TIME, format_test_result) from test.libregrtest.setup import setup_tests from test.libregrtest.utils import removepy, count, format_duration, printlist @@ -79,6 +79,7 @@ def __init__(self): self.resource_denieds = [] self.environment_changed = [] self.rerun = [] + self.run_no_tests = [] self.first_result = None self.interrupted = False @@ -118,6 +119,8 @@ def accumulate_result(self, test, result): elif ok == RESOURCE_DENIED: self.skipped.append(test) self.resource_denieds.append(test) + elif ok == TEST_DID_NOT_RUN: + self.run_no_tests.append(test) elif ok != INTERRUPTED: raise ValueError("invalid test result: %r" % ok) @@ -368,6 +371,11 @@ def display_result(self): print("%s:" % count(len(self.rerun), "re-run test")) printlist(self.rerun) + if self.run_no_tests: + print() + print(count(len(self.run_no_tests), "test"), "run no tests:") + printlist(self.run_no_tests) + def run_tests_sequential(self): if self.ns.trace: import trace @@ -458,6 +466,9 @@ def get_tests_result(self): result.append("FAILURE") elif self.ns.fail_env_changed and self.environment_changed: result.append("ENV CHANGED") + elif not any((self.good, self.bad, self.skipped, self.interrupted, + self.environment_changed)): + result.append("NO TEST RUN") if self.interrupted: result.append("INTERRUPTED") diff --git a/Lib/test/libregrtest/runtest.py b/Lib/test/libregrtest/runtest.py index 4f41080d37b9..466b522db9ed 100644 --- a/Lib/test/libregrtest/runtest.py +++ b/Lib/test/libregrtest/runtest.py @@ -19,6 +19,7 @@ RESOURCE_DENIED = -3 INTERRUPTED = -4 CHILD_ERROR = -5 # error in a child process +TEST_DID_NOT_RUN = -6 # error in a child process _FORMAT_TEST_RESULT = { PASSED: '%s passed', @@ -28,6 +29,7 @@ RESOURCE_DENIED: '%s skipped (resource denied)', INTERRUPTED: '%s interrupted', CHILD_ERROR: '%s crashed', + TEST_DID_NOT_RUN: '%s run no tests', } # Minimum duration of a test to display its duration or to mention that @@ -94,6 +96,7 @@ def runtest(ns, test): ENV_CHANGED test failed because it changed the execution environment FAILED test failed PASSED test passed + EMPTY_TEST_SUITE test ran no subtests. If ns.xmlpath is not None, xml_data is a list containing each generated testsuite element. @@ -197,6 +200,8 @@ def test_runner(): else: print("test", test, "failed", file=sys.stderr, flush=True) return FAILED, test_time + except support.TestDidNotRun: + return TEST_DID_NOT_RUN, test_time except: msg = traceback.format_exc() if not ns.pgo: diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index f7a60d4bf2a3..f90212cd7ecf 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -72,7 +72,7 @@ # globals "PIPE_MAX_SIZE", "verbose", "max_memuse", "use_resources", "failfast", # exceptions - "Error", "TestFailed", "ResourceDenied", + "Error", "TestFailed", "TestDidNotRun", "ResourceDenied", # imports "import_module", "import_fresh_module", "CleanImport", # modules @@ -120,6 +120,9 @@ class Error(Exception): class TestFailed(Error): """Test failed.""" +class TestDidNotRun(Error): + """Test did not run any subtests.""" + class ResourceDenied(unittest.SkipTest): """Test skipped because it requested a disallowed resource. @@ -1930,6 +1933,8 @@ def _run_suite(suite): if junit_xml_list is not None: junit_xml_list.append(result.get_xml_element()) + if not result.testsRun: + raise TestDidNotRun if not result.wasSuccessful(): if len(result.errors) == 1 and not result.failures: err = result.errors[0][1] diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py index 8c5238066244..db9bd6dfc043 100644 --- a/Lib/test/test_regrtest.py +++ b/Lib/test/test_regrtest.py @@ -351,11 +351,20 @@ def setUp(self): self.tmptestdir = tempfile.mkdtemp() self.addCleanup(support.rmtree, self.tmptestdir) - def create_test(self, name=None, code=''): + def create_test(self, name=None, code=None): if not name: name = 'noop%s' % BaseTestCase.TEST_UNIQUE_ID BaseTestCase.TEST_UNIQUE_ID += 1 + if code is None: + code = textwrap.dedent(""" + import unittest + + class Tests(unittest.TestCase): + def test_empty_test(self): + pass + """) + # test_regrtest cannot be run twice in parallel because # of setUp() and create_test() name = self.TESTNAME_PREFIX + name @@ -390,7 +399,7 @@ def parse_executed_tests(self, output): def check_executed_tests(self, output, tests, skipped=(), failed=(), env_changed=(), omitted=(), - rerun=(), + rerun=(), no_test_ran=(), randomize=False, interrupted=False, fail_env_changed=False): if isinstance(tests, str): @@ -405,6 +414,8 @@ def check_executed_tests(self, output, tests, skipped=(), failed=(), omitted = [omitted] if isinstance(rerun, str): rerun = [rerun] + if isinstance(no_test_ran, str): + no_test_ran = [no_test_ran] executed = self.parse_executed_tests(output) if randomize: @@ -447,8 +458,12 @@ def list_regex(line_format, tests): regex = "Re-running test %r in verbose mode" % name self.check_line(output, regex) + if no_test_ran: + regex = list_regex('%s test%s run no tests', no_test_ran) + self.check_line(output, regex) + good = (len(tests) - len(skipped) - len(failed) - - len(omitted) - len(env_changed)) + - len(omitted) - len(env_changed) - len(no_test_ran)) if good: regex = r'%s test%s OK\.$' % (good, plural(good)) if not skipped and not failed and good > 1: @@ -465,12 +480,16 @@ def list_regex(line_format, tests): result.append('ENV CHANGED') if interrupted: result.append('INTERRUPTED') - if not result: + if not any((good, result, failed, interrupted, skipped, + env_changed, fail_env_changed)): + result.append("NO TEST RUN") + elif not result: result.append('SUCCESS') result = ', '.join(result) if rerun: self.check_line(output, 'Tests result: %s' % result) result = 'FAILURE then %s' % result + self.check_line(output, 'Tests result: %s' % result) def parse_random_seed(self, output): @@ -649,7 +668,14 @@ def test_resources(self): # test -u command line option tests = {} for resource in ('audio', 'network'): - code = 'from test import support\nsupport.requires(%r)' % resource + code = textwrap.dedent(""" + from test import support; support.requires(%r) + import unittest + class PassingTest(unittest.TestCase): + def test_pass(self): + pass + """ % resource) + tests[resource] = self.create_test(resource, code) test_names = sorted(tests.values()) @@ -978,6 +1004,56 @@ def test_bug(self): output = self.run_tests("-w", testname, exitcode=2) self.check_executed_tests(output, [testname], failed=testname, rerun=testname) + def test_no_tests_ran(self): + code = textwrap.dedent(""" + import unittest + + class Tests(unittest.TestCase): + def test_bug(self): + pass + """) + testname = self.create_test(code=code) + + output = self.run_tests(testname, "-m", "nosuchtest", exitcode=0) + self.check_executed_tests(output, [testname], no_test_ran=testname) + + def test_no_tests_ran_multiple_tests_nonexistent(self): + code = textwrap.dedent(""" + import unittest + + class Tests(unittest.TestCase): + def test_bug(self): + pass + """) + testname = self.create_test(code=code) + testname2 = self.create_test(code=code) + + output = self.run_tests(testname, testname2, "-m", "nosuchtest", exitcode=0) + self.check_executed_tests(output, [testname, testname2], + no_test_ran=[testname, testname2]) + + def test_no_test_ran_some_test_exist_some_not(self): + code = textwrap.dedent(""" + import unittest + + class Tests(unittest.TestCase): + def test_bug(self): + pass + """) + testname = self.create_test(code=code) + other_code = textwrap.dedent(""" + import unittest + + class Tests(unittest.TestCase): + def test_other_bug(self): + pass + """) + testname2 = self.create_test(code=other_code) + + output = self.run_tests(testname, testname2, "-m", "nosuchtest", + "-m", "test_other_bug", exitcode=0) + self.check_executed_tests(output, [testname, testname2], + no_test_ran=[testname]) class TestUtils(unittest.TestCase): diff --git a/Misc/NEWS.d/next/Tests/2018-10-27-13-41-55.bpo-34279.v0Xqxe.rst b/Misc/NEWS.d/next/Tests/2018-10-27-13-41-55.bpo-34279.v0Xqxe.rst new file mode 100644 index 000000000000..a82fa6b304ac --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2018-10-27-13-41-55.bpo-34279.v0Xqxe.rst @@ -0,0 +1,3 @@ +regrtest issue a warning when no tests have been executed in a particular +test file. Also, a new final result state is issued if no test have been +executed across all test files. Patch by Pablo Galindo. From webhook-mailer at python.org Thu Nov 29 15:14:48 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 29 Nov 2018 20:14:48 -0000 Subject: [Python-checkins] bpo-34279, regrtest: Issue a warning if no tests have been executed (GH-10801) Message-ID: https://github.com/python/cpython/commit/36003003f26d0c30fc15ec4dc3b0d7697dff908e commit: 36003003f26d0c30fc15ec4dc3b0d7697dff908e branch: 2.7 author: Victor Stinner committer: GitHub date: 2018-11-29T21:14:42+01:00 summary: bpo-34279, regrtest: Issue a warning if no tests have been executed (GH-10801) Co-Authored-By: Pablo Galindo files: A Misc/NEWS.d/next/Tests/2018-10-27-13-41-55.bpo-34279.v0Xqxe.rst M Lib/test/regrtest.py M Lib/test/support/__init__.py M Lib/test/test_regrtest.py diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index 6b49dafd9368..70c51226e923 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -241,6 +241,7 @@ RESOURCE_DENIED = -3 INTERRUPTED = -4 CHILD_ERROR = -5 # error in a child process +TEST_DID_NOT_RUN = -6 # error in a child process # Minimum duration of a test to display its duration or to mention that # the test is running in background @@ -300,6 +301,7 @@ def format_duration(seconds): RESOURCE_DENIED: '%s skipped (resource denied)', INTERRUPTED: '%s interrupted', CHILD_ERROR: '%s crashed', + TEST_DID_NOT_RUN: '%s run no tests', } @@ -548,6 +550,7 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, resource_denieds = [] environment_changed = [] rerun = [] + run_no_tests = [] first_result = None interrupted = False @@ -644,6 +647,8 @@ def accumulate_result(test, result): elif ok == RESOURCE_DENIED: skipped.append(test) resource_denieds.append(test) + elif ok == TEST_DID_NOT_RUN: + run_no_tests.append(test) elif ok != INTERRUPTED: raise ValueError("invalid test result: %r" % ok) @@ -925,6 +930,8 @@ def get_tests_result(): result.append("FAILURE") elif fail_env_changed and environment_changed: result.append("ENV CHANGED") + elif not any((good, bad, skipped, interrupted, environment_changed)): + result.append("NO TEST RUN") if interrupted: result.append("INTERRUPTED") @@ -994,10 +1001,15 @@ def display_result(): print "expected to get skipped on", plat + "." if rerun: - print + print("") print("%s:" % count(len(rerun), "re-run test")) printlist(rerun) + if run_no_tests: + print("") + print("%s run no tests:" % count(len(run_no_tests), "test")) + printlist(run_no_tests) + display_result() @@ -1109,6 +1121,7 @@ def runtest(test, verbose, quiet, ENV_CHANGED test failed because it changed the execution environment FAILED test failed PASSED test passed + EMPTY_TEST_SUITE test ran no subtests. """ support.verbose = verbose # Tell tests to be moderately quiet @@ -1344,6 +1357,8 @@ def runtest_inner(test, verbose, quiet, huntrleaks=False, pgo=False, testdir=Non print >>sys.stderr, "test", test, "failed --", msg sys.stderr.flush() return FAILED, test_time + except support.TestDidNotRun: + return TEST_DID_NOT_RUN, test_time except: type, value = sys.exc_info()[:2] if not pgo: diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index c2cc009b9f48..23b7065174ee 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -29,7 +29,7 @@ except ImportError: thread = None -__all__ = ["Error", "TestFailed", "ResourceDenied", "import_module", +__all__ = ["Error", "TestFailed", "TestDidNotRun", "ResourceDenied", "import_module", "verbose", "use_resources", "max_memuse", "record_original_stdout", "get_original_stdout", "unload", "unlink", "rmtree", "forget", "is_resource_enabled", "requires", "requires_mac_ver", @@ -53,6 +53,9 @@ class Error(Exception): class TestFailed(Error): """Test failed.""" +class TestDidNotRun(Error): + """Test did not run any subtests.""" + class ResourceDenied(unittest.SkipTest): """Test skipped because it requested a disallowed resource. @@ -1536,6 +1539,8 @@ def _run_suite(suite): runner = BasicTestRunner() result = runner.run(suite) + if not result.testsRun: + raise TestDidNotRun if not result.wasSuccessful(): if len(result.errors) == 1 and not result.failures: err = result.errors[0][1] diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py index a459504e445e..593df7ac8ff9 100644 --- a/Lib/test/test_regrtest.py +++ b/Lib/test/test_regrtest.py @@ -51,11 +51,24 @@ def setUp(self): self.tmptestdir = tempfile.mkdtemp() self.addCleanup(support.rmtree, self.tmptestdir) - def create_test(self, name=None, code=''): + def create_test(self, name=None, code=None): if not name: name = 'noop%s' % BaseTestCase.TEST_UNIQUE_ID BaseTestCase.TEST_UNIQUE_ID += 1 + if code is None: + code = textwrap.dedent(""" + import unittest + from test import support + + class Tests(unittest.TestCase): + def test_empty_test(self): + pass + + def test_main(): + support.run_unittest(Tests) + """) + # test_regrtest cannot be run twice in parallel because # of setUp() and create_test() name = self.TESTNAME_PREFIX + name @@ -94,7 +107,7 @@ def parse_executed_tests(self, output): def check_executed_tests(self, output, tests, skipped=(), failed=(), env_changed=(), omitted=(), - rerun=(), + rerun=(), no_test_ran=(), randomize=False, interrupted=False, fail_env_changed=False): if isinstance(tests, str): @@ -109,6 +122,8 @@ def check_executed_tests(self, output, tests, skipped=(), failed=(), omitted = [omitted] if isinstance(rerun, str): rerun = [rerun] + if isinstance(no_test_ran, str): + no_test_ran = [no_test_ran] executed = self.parse_executed_tests(output) if randomize: @@ -152,7 +167,7 @@ def list_regex(line_format, tests): self.check_line(output, regex) good = (len(tests) - len(skipped) - len(failed) - - len(omitted) - len(env_changed)) + - len(omitted) - len(env_changed) - len(no_test_ran)) if good: regex = r'%s test%s OK\.$' % (good, plural(good)) if not skipped and not failed and good > 1: @@ -169,12 +184,16 @@ def list_regex(line_format, tests): result.append('ENV CHANGED') if interrupted: result.append('INTERRUPTED') - if not result: + if not any((good, result, failed, interrupted, skipped, + env_changed, fail_env_changed)): + result.append("NO TEST RUN") + elif not result: result.append('SUCCESS') result = ', '.join(result) if rerun: self.check_line(output, 'Tests result: %s' % result) result = 'FAILURE then %s' % result + self.check_line(output, 'Tests result: %s' % result) def parse_random_seed(self, output): @@ -358,7 +377,17 @@ def test_resources(self): # test -u command line option tests = {} for resource in ('audio', 'network'): - code = 'from test import support\nsupport.requires(%r)' % resource + code = textwrap.dedent(""" + from test import support; support.requires(%r) + import unittest + class PassingTest(unittest.TestCase): + def test_pass(self): + pass + + def test_main(): + support.run_unittest(PassingTest) + """ % resource) + tests[resource] = self.create_test(resource, code) test_names = sorted(tests.values()) @@ -669,6 +698,7 @@ def test_main(): def test_rerun_fail(self): code = textwrap.dedent(""" import unittest + from test import support class Tests(unittest.TestCase): def test_bug(self): @@ -684,6 +714,76 @@ def test_main(): self.check_executed_tests(output, [testname], failed=testname, rerun=testname) + def test_no_tests_ran(self): + code = textwrap.dedent(""" + import unittest + from test import support + + class Tests(unittest.TestCase): + def test_bug(self): + pass + + def test_main(): + support.run_unittest(Tests) + """) + testname = self.create_test(code=code) + + output = self.run_tests("-m", "nosuchtest", testname, exitcode=0) + self.check_executed_tests(output, [testname], no_test_ran=testname) + + def test_no_tests_ran_multiple_tests_nonexistent(self): + code = textwrap.dedent(""" + import unittest + from test import support + + class Tests(unittest.TestCase): + def test_bug(self): + pass + + def test_main(): + support.run_unittest(Tests) + """) + testname = self.create_test(code=code) + testname2 = self.create_test(code=code) + + output = self.run_tests("-m", "nosuchtest", + testname, testname2, + exitcode=0) + self.check_executed_tests(output, [testname, testname2], + no_test_ran=[testname, testname2]) + + def test_no_test_ran_some_test_exist_some_not(self): + code = textwrap.dedent(""" + import unittest + from test import support + + class Tests(unittest.TestCase): + def test_bug(self): + pass + + def test_main(): + support.run_unittest(Tests) + """) + testname = self.create_test(code=code) + other_code = textwrap.dedent(""" + import unittest + from test import support + + class Tests(unittest.TestCase): + def test_other_bug(self): + pass + + def test_main(): + support.run_unittest(Tests) + """) + testname2 = self.create_test(code=other_code) + + output = self.run_tests("-m", "nosuchtest", "-m", "test_other_bug", + testname, testname2, + exitcode=0) + self.check_executed_tests(output, [testname, testname2], + no_test_ran=[testname]) + class TestUtils(unittest.TestCase): def test_format_duration(self): diff --git a/Misc/NEWS.d/next/Tests/2018-10-27-13-41-55.bpo-34279.v0Xqxe.rst b/Misc/NEWS.d/next/Tests/2018-10-27-13-41-55.bpo-34279.v0Xqxe.rst new file mode 100644 index 000000000000..a82fa6b304ac --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2018-10-27-13-41-55.bpo-34279.v0Xqxe.rst @@ -0,0 +1,3 @@ +regrtest issue a warning when no tests have been executed in a particular +test file. Also, a new final result state is issued if no test have been +executed across all test files. Patch by Pablo Galindo. From webhook-mailer at python.org Thu Nov 29 15:15:05 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 29 Nov 2018 20:15:05 -0000 Subject: [Python-checkins] [3.7] bpo-34279: Synchronize regrtest with master (GH-10800) Message-ID: https://github.com/python/cpython/commit/8a73cac618a050f4e74eb38ff43e48d9957a6dec commit: 8a73cac618a050f4e74eb38ff43e48d9957a6dec branch: 3.7 author: Victor Stinner committer: GitHub date: 2018-11-29T21:14:59+01:00 summary: [3.7] bpo-34279: Synchronize regrtest with master (GH-10800) * bpo-34605, libregrtest: Rename --slaveargs to --worker-args (GH-9099) Rename also run_tests_slave() to run_tests_worker(). (cherry picked from commit 012f5b968a738b15ae9b40c499a1c0778b0615a9) * bpo-34279, regrtest: Issue a warning if no tests have been executed (GH-10150) (cherry picked from commit 9724348b43a9005a449ba532ccd3c6726f031097) * test_regrtest: remove unused threading import files: A Misc/NEWS.d/next/Tests/2018-10-27-13-41-55.bpo-34279.v0Xqxe.rst M Lib/test/libregrtest/cmdline.py M Lib/test/libregrtest/main.py M Lib/test/libregrtest/runtest.py M Lib/test/libregrtest/runtest_mp.py M Lib/test/support/__init__.py M Lib/test/test_regrtest.py diff --git a/Lib/test/libregrtest/cmdline.py b/Lib/test/libregrtest/cmdline.py index c08491fc0462..09270323611f 100644 --- a/Lib/test/libregrtest/cmdline.py +++ b/Lib/test/libregrtest/cmdline.py @@ -170,7 +170,7 @@ def _create_parser(): group.add_argument('--wait', action='store_true', help='wait for user input, e.g., allow a debugger ' 'to be attached') - group.add_argument('--slaveargs', metavar='ARGS') + group.add_argument('--worker-args', metavar='ARGS') group.add_argument('-S', '--start', metavar='START', help='the name of the test at which to start.' + more_details) diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py index 1438966d4a50..8d44caf2999a 100644 --- a/Lib/test/libregrtest/main.py +++ b/Lib/test/libregrtest/main.py @@ -14,7 +14,7 @@ from test.libregrtest.runtest import ( findtests, runtest, get_abs_module, STDTESTS, NOTTESTS, PASSED, FAILED, ENV_CHANGED, SKIPPED, RESOURCE_DENIED, - INTERRUPTED, CHILD_ERROR, + INTERRUPTED, CHILD_ERROR, TEST_DID_NOT_RUN, PROGRESS_MIN_TIME, format_test_result) from test.libregrtest.setup import setup_tests from test.libregrtest.utils import removepy, count, format_duration, printlist @@ -79,6 +79,7 @@ def __init__(self): self.resource_denieds = [] self.environment_changed = [] self.rerun = [] + self.run_no_tests = [] self.first_result = None self.interrupted = False @@ -118,6 +119,8 @@ def accumulate_result(self, test, result): elif ok == RESOURCE_DENIED: self.skipped.append(test) self.resource_denieds.append(test) + elif ok == TEST_DID_NOT_RUN: + self.run_no_tests.append(test) elif ok != INTERRUPTED: raise ValueError("invalid test result: %r" % ok) @@ -368,6 +371,11 @@ def display_result(self): print("%s:" % count(len(self.rerun), "re-run test")) printlist(self.rerun) + if self.run_no_tests: + print() + print(count(len(self.run_no_tests), "test"), "run no tests:") + printlist(self.run_no_tests) + def run_tests_sequential(self): if self.ns.trace: import trace @@ -458,6 +466,9 @@ def get_tests_result(self): result.append("FAILURE") elif self.ns.fail_env_changed and self.environment_changed: result.append("ENV CHANGED") + elif not any((self.good, self.bad, self.skipped, self.interrupted, + self.environment_changed)): + result.append("NO TEST RUN") if self.interrupted: result.append("INTERRUPTED") @@ -580,9 +591,9 @@ def _main(self, tests, kwargs): print(msg, file=sys.stderr, flush=True) sys.exit(2) - if self.ns.slaveargs is not None: - from test.libregrtest.runtest_mp import run_tests_slave - run_tests_slave(self.ns.slaveargs) + if self.ns.worker_args is not None: + from test.libregrtest.runtest_mp import run_tests_worker + run_tests_worker(self.ns.worker_args) if self.ns.wait: input("Press any key to continue...") diff --git a/Lib/test/libregrtest/runtest.py b/Lib/test/libregrtest/runtest.py index 4f41080d37b9..466b522db9ed 100644 --- a/Lib/test/libregrtest/runtest.py +++ b/Lib/test/libregrtest/runtest.py @@ -19,6 +19,7 @@ RESOURCE_DENIED = -3 INTERRUPTED = -4 CHILD_ERROR = -5 # error in a child process +TEST_DID_NOT_RUN = -6 # error in a child process _FORMAT_TEST_RESULT = { PASSED: '%s passed', @@ -28,6 +29,7 @@ RESOURCE_DENIED: '%s skipped (resource denied)', INTERRUPTED: '%s interrupted', CHILD_ERROR: '%s crashed', + TEST_DID_NOT_RUN: '%s run no tests', } # Minimum duration of a test to display its duration or to mention that @@ -94,6 +96,7 @@ def runtest(ns, test): ENV_CHANGED test failed because it changed the execution environment FAILED test failed PASSED test passed + EMPTY_TEST_SUITE test ran no subtests. If ns.xmlpath is not None, xml_data is a list containing each generated testsuite element. @@ -197,6 +200,8 @@ def test_runner(): else: print("test", test, "failed", file=sys.stderr, flush=True) return FAILED, test_time + except support.TestDidNotRun: + return TEST_DID_NOT_RUN, test_time except: msg = traceback.format_exc() if not ns.pgo: diff --git a/Lib/test/libregrtest/runtest_mp.py b/Lib/test/libregrtest/runtest_mp.py index 779c429bff52..6190574afdf8 100644 --- a/Lib/test/libregrtest/runtest_mp.py +++ b/Lib/test/libregrtest/runtest_mp.py @@ -24,23 +24,23 @@ def run_test_in_subprocess(testname, ns): - """Run the given test in a subprocess with --slaveargs. + """Run the given test in a subprocess with --worker-args. ns is the option Namespace parsed from command-line arguments. regrtest - is invoked in a subprocess with the --slaveargs argument; when the + is invoked in a subprocess with the --worker-args argument; when the subprocess exits, its return code, stdout and stderr are returned as a 3-tuple. """ from subprocess import Popen, PIPE ns_dict = vars(ns) - slaveargs = (ns_dict, testname) - slaveargs = json.dumps(slaveargs) + worker_args = (ns_dict, testname) + worker_args = json.dumps(worker_args) cmd = [sys.executable, *support.args_from_interpreter_flags(), '-u', # Unbuffered stdout and stderr '-m', 'test.regrtest', - '--slaveargs', slaveargs] + '--worker-args', worker_args] if ns.pgo: cmd += ['--pgo'] @@ -58,8 +58,8 @@ def run_test_in_subprocess(testname, ns): return retcode, stdout, stderr -def run_tests_slave(slaveargs): - ns_dict, testname = json.loads(slaveargs) +def run_tests_worker(worker_args): + ns_dict, testname = json.loads(worker_args) ns = types.SimpleNamespace(**ns_dict) setup_tests(ns) diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index ce455e0dc461..2768e1147946 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -71,7 +71,7 @@ # globals "PIPE_MAX_SIZE", "verbose", "max_memuse", "use_resources", "failfast", # exceptions - "Error", "TestFailed", "ResourceDenied", + "Error", "TestFailed", "TestDidNotRun", "ResourceDenied", # imports "import_module", "import_fresh_module", "CleanImport", # modules @@ -117,6 +117,9 @@ class Error(Exception): class TestFailed(Error): """Test failed.""" +class TestDidNotRun(Error): + """Test did not run any subtests.""" + class ResourceDenied(unittest.SkipTest): """Test skipped because it requested a disallowed resource. @@ -1890,6 +1893,8 @@ def _run_suite(suite): if junit_xml_list is not None: junit_xml_list.append(result.get_xml_element()) + if not result.testsRun: + raise TestDidNotRun if not result.wasSuccessful(): if len(result.errors) == 1 and not result.failures: err = result.errors[0][1] diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py index af332ad15d92..db9bd6dfc043 100644 --- a/Lib/test/test_regrtest.py +++ b/Lib/test/test_regrtest.py @@ -15,7 +15,6 @@ import sysconfig import tempfile import textwrap -import threading import unittest from test import libregrtest from test import support @@ -67,10 +66,10 @@ def test_wait(self): ns = libregrtest._parse_args(['--wait']) self.assertTrue(ns.wait) - def test_slaveargs(self): - ns = libregrtest._parse_args(['--slaveargs', '[[], {}]']) - self.assertEqual(ns.slaveargs, '[[], {}]') - self.checkError(['--slaveargs'], 'expected one argument') + def test_worker_args(self): + ns = libregrtest._parse_args(['--worker-args', '[[], {}]']) + self.assertEqual(ns.worker_args, '[[], {}]') + self.checkError(['--worker-args'], 'expected one argument') def test_start(self): for opt in '-S', '--start': @@ -352,11 +351,20 @@ def setUp(self): self.tmptestdir = tempfile.mkdtemp() self.addCleanup(support.rmtree, self.tmptestdir) - def create_test(self, name=None, code=''): + def create_test(self, name=None, code=None): if not name: name = 'noop%s' % BaseTestCase.TEST_UNIQUE_ID BaseTestCase.TEST_UNIQUE_ID += 1 + if code is None: + code = textwrap.dedent(""" + import unittest + + class Tests(unittest.TestCase): + def test_empty_test(self): + pass + """) + # test_regrtest cannot be run twice in parallel because # of setUp() and create_test() name = self.TESTNAME_PREFIX + name @@ -391,7 +399,7 @@ def parse_executed_tests(self, output): def check_executed_tests(self, output, tests, skipped=(), failed=(), env_changed=(), omitted=(), - rerun=(), + rerun=(), no_test_ran=(), randomize=False, interrupted=False, fail_env_changed=False): if isinstance(tests, str): @@ -406,6 +414,8 @@ def check_executed_tests(self, output, tests, skipped=(), failed=(), omitted = [omitted] if isinstance(rerun, str): rerun = [rerun] + if isinstance(no_test_ran, str): + no_test_ran = [no_test_ran] executed = self.parse_executed_tests(output) if randomize: @@ -448,8 +458,12 @@ def list_regex(line_format, tests): regex = "Re-running test %r in verbose mode" % name self.check_line(output, regex) + if no_test_ran: + regex = list_regex('%s test%s run no tests', no_test_ran) + self.check_line(output, regex) + good = (len(tests) - len(skipped) - len(failed) - - len(omitted) - len(env_changed)) + - len(omitted) - len(env_changed) - len(no_test_ran)) if good: regex = r'%s test%s OK\.$' % (good, plural(good)) if not skipped and not failed and good > 1: @@ -466,12 +480,16 @@ def list_regex(line_format, tests): result.append('ENV CHANGED') if interrupted: result.append('INTERRUPTED') - if not result: + if not any((good, result, failed, interrupted, skipped, + env_changed, fail_env_changed)): + result.append("NO TEST RUN") + elif not result: result.append('SUCCESS') result = ', '.join(result) if rerun: self.check_line(output, 'Tests result: %s' % result) result = 'FAILURE then %s' % result + self.check_line(output, 'Tests result: %s' % result) def parse_random_seed(self, output): @@ -650,7 +668,14 @@ def test_resources(self): # test -u command line option tests = {} for resource in ('audio', 'network'): - code = 'from test import support\nsupport.requires(%r)' % resource + code = textwrap.dedent(""" + from test import support; support.requires(%r) + import unittest + class PassingTest(unittest.TestCase): + def test_pass(self): + pass + """ % resource) + tests[resource] = self.create_test(resource, code) test_names = sorted(tests.values()) @@ -979,6 +1004,56 @@ def test_bug(self): output = self.run_tests("-w", testname, exitcode=2) self.check_executed_tests(output, [testname], failed=testname, rerun=testname) + def test_no_tests_ran(self): + code = textwrap.dedent(""" + import unittest + + class Tests(unittest.TestCase): + def test_bug(self): + pass + """) + testname = self.create_test(code=code) + + output = self.run_tests(testname, "-m", "nosuchtest", exitcode=0) + self.check_executed_tests(output, [testname], no_test_ran=testname) + + def test_no_tests_ran_multiple_tests_nonexistent(self): + code = textwrap.dedent(""" + import unittest + + class Tests(unittest.TestCase): + def test_bug(self): + pass + """) + testname = self.create_test(code=code) + testname2 = self.create_test(code=code) + + output = self.run_tests(testname, testname2, "-m", "nosuchtest", exitcode=0) + self.check_executed_tests(output, [testname, testname2], + no_test_ran=[testname, testname2]) + + def test_no_test_ran_some_test_exist_some_not(self): + code = textwrap.dedent(""" + import unittest + + class Tests(unittest.TestCase): + def test_bug(self): + pass + """) + testname = self.create_test(code=code) + other_code = textwrap.dedent(""" + import unittest + + class Tests(unittest.TestCase): + def test_other_bug(self): + pass + """) + testname2 = self.create_test(code=other_code) + + output = self.run_tests(testname, testname2, "-m", "nosuchtest", + "-m", "test_other_bug", exitcode=0) + self.check_executed_tests(output, [testname, testname2], + no_test_ran=[testname]) class TestUtils(unittest.TestCase): diff --git a/Misc/NEWS.d/next/Tests/2018-10-27-13-41-55.bpo-34279.v0Xqxe.rst b/Misc/NEWS.d/next/Tests/2018-10-27-13-41-55.bpo-34279.v0Xqxe.rst new file mode 100644 index 000000000000..a82fa6b304ac --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2018-10-27-13-41-55.bpo-34279.v0Xqxe.rst @@ -0,0 +1,3 @@ +regrtest issue a warning when no tests have been executed in a particular +test file. Also, a new final result state is issued if no test have been +executed across all test files. Patch by Pablo Galindo. From webhook-mailer at python.org Thu Nov 29 15:39:09 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 29 Nov 2018 20:39:09 -0000 Subject: [Python-checkins] [3.7] bpo-34279: Synchronize regrtest with master (GH-10800) Message-ID: https://github.com/python/cpython/commit/43d812692f9207520e1169ff88cd8d6c59cc4804 commit: 43d812692f9207520e1169ff88cd8d6c59cc4804 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-29T12:39:04-08:00 summary: [3.7] bpo-34279: Synchronize regrtest with master (GH-10800) * bpo-34605, libregrtest: Rename --slaveargs to --worker-args (GH-9099) Rename also run_tests_slave() to run_tests_worker(). (cherry picked from commit 012f5b968a738b15ae9b40c499a1c0778b0615a9) * bpo-34279, regrtest: Issue a warning if no tests have been executed (GH-10150) (cherry picked from commit 9724348b43a9005a449ba532ccd3c6726f031097) * test_regrtest: remove unused threading import (cherry picked from commit 8a73cac618a050f4e74eb38ff43e48d9957a6dec) Co-authored-by: Victor Stinner files: A Misc/NEWS.d/next/Tests/2018-10-27-13-41-55.bpo-34279.v0Xqxe.rst M Lib/test/libregrtest/cmdline.py M Lib/test/libregrtest/main.py M Lib/test/libregrtest/runtest.py M Lib/test/libregrtest/runtest_mp.py M Lib/test/support/__init__.py M Lib/test/test_regrtest.py diff --git a/Lib/test/libregrtest/cmdline.py b/Lib/test/libregrtest/cmdline.py index 2af839a182db..538ff05489ea 100644 --- a/Lib/test/libregrtest/cmdline.py +++ b/Lib/test/libregrtest/cmdline.py @@ -170,7 +170,7 @@ def _create_parser(): group.add_argument('--wait', action='store_true', help='wait for user input, e.g., allow a debugger ' 'to be attached') - group.add_argument('--slaveargs', metavar='ARGS') + group.add_argument('--worker-args', metavar='ARGS') group.add_argument('-S', '--start', metavar='START', help='the name of the test at which to start.' + more_details) diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py index b491a08c2424..b6d05f63d32d 100644 --- a/Lib/test/libregrtest/main.py +++ b/Lib/test/libregrtest/main.py @@ -14,7 +14,7 @@ from test.libregrtest.runtest import ( findtests, runtest, get_abs_module, STDTESTS, NOTTESTS, PASSED, FAILED, ENV_CHANGED, SKIPPED, RESOURCE_DENIED, - INTERRUPTED, CHILD_ERROR, + INTERRUPTED, CHILD_ERROR, TEST_DID_NOT_RUN, PROGRESS_MIN_TIME, format_test_result) from test.libregrtest.setup import setup_tests from test.libregrtest.utils import removepy, count, format_duration, printlist @@ -79,6 +79,7 @@ def __init__(self): self.resource_denieds = [] self.environment_changed = [] self.rerun = [] + self.run_no_tests = [] self.first_result = None self.interrupted = False @@ -118,6 +119,8 @@ def accumulate_result(self, test, result): elif ok == RESOURCE_DENIED: self.skipped.append(test) self.resource_denieds.append(test) + elif ok == TEST_DID_NOT_RUN: + self.run_no_tests.append(test) elif ok != INTERRUPTED: raise ValueError("invalid test result: %r" % ok) @@ -368,6 +371,11 @@ def display_result(self): print("%s:" % count(len(self.rerun), "re-run test")) printlist(self.rerun) + if self.run_no_tests: + print() + print(count(len(self.run_no_tests), "test"), "run no tests:") + printlist(self.run_no_tests) + def run_tests_sequential(self): if self.ns.trace: import trace @@ -458,6 +466,9 @@ def get_tests_result(self): result.append("FAILURE") elif self.ns.fail_env_changed and self.environment_changed: result.append("ENV CHANGED") + elif not any((self.good, self.bad, self.skipped, self.interrupted, + self.environment_changed)): + result.append("NO TEST RUN") if self.interrupted: result.append("INTERRUPTED") @@ -582,9 +593,9 @@ def _main(self, tests, kwargs): print(msg, file=sys.stderr, flush=True) sys.exit(2) - if self.ns.slaveargs is not None: - from test.libregrtest.runtest_mp import run_tests_slave - run_tests_slave(self.ns.slaveargs) + if self.ns.worker_args is not None: + from test.libregrtest.runtest_mp import run_tests_worker + run_tests_worker(self.ns.worker_args) if self.ns.wait: input("Press any key to continue...") diff --git a/Lib/test/libregrtest/runtest.py b/Lib/test/libregrtest/runtest.py index 4f41080d37b9..466b522db9ed 100644 --- a/Lib/test/libregrtest/runtest.py +++ b/Lib/test/libregrtest/runtest.py @@ -19,6 +19,7 @@ RESOURCE_DENIED = -3 INTERRUPTED = -4 CHILD_ERROR = -5 # error in a child process +TEST_DID_NOT_RUN = -6 # error in a child process _FORMAT_TEST_RESULT = { PASSED: '%s passed', @@ -28,6 +29,7 @@ RESOURCE_DENIED: '%s skipped (resource denied)', INTERRUPTED: '%s interrupted', CHILD_ERROR: '%s crashed', + TEST_DID_NOT_RUN: '%s run no tests', } # Minimum duration of a test to display its duration or to mention that @@ -94,6 +96,7 @@ def runtest(ns, test): ENV_CHANGED test failed because it changed the execution environment FAILED test failed PASSED test passed + EMPTY_TEST_SUITE test ran no subtests. If ns.xmlpath is not None, xml_data is a list containing each generated testsuite element. @@ -197,6 +200,8 @@ def test_runner(): else: print("test", test, "failed", file=sys.stderr, flush=True) return FAILED, test_time + except support.TestDidNotRun: + return TEST_DID_NOT_RUN, test_time except: msg = traceback.format_exc() if not ns.pgo: diff --git a/Lib/test/libregrtest/runtest_mp.py b/Lib/test/libregrtest/runtest_mp.py index e5e808a6aa53..fdbd73313bc0 100644 --- a/Lib/test/libregrtest/runtest_mp.py +++ b/Lib/test/libregrtest/runtest_mp.py @@ -28,23 +28,23 @@ def run_test_in_subprocess(testname, ns): - """Run the given test in a subprocess with --slaveargs. + """Run the given test in a subprocess with --worker-args. ns is the option Namespace parsed from command-line arguments. regrtest - is invoked in a subprocess with the --slaveargs argument; when the + is invoked in a subprocess with the --worker-args argument; when the subprocess exits, its return code, stdout and stderr are returned as a 3-tuple. """ from subprocess import Popen, PIPE ns_dict = vars(ns) - slaveargs = (ns_dict, testname) - slaveargs = json.dumps(slaveargs) + worker_args = (ns_dict, testname) + worker_args = json.dumps(worker_args) cmd = [sys.executable, *support.args_from_interpreter_flags(), '-u', # Unbuffered stdout and stderr '-m', 'test.regrtest', - '--slaveargs', slaveargs] + '--worker-args', worker_args] if ns.pgo: cmd += ['--pgo'] @@ -62,8 +62,8 @@ def run_test_in_subprocess(testname, ns): return retcode, stdout, stderr -def run_tests_slave(slaveargs): - ns_dict, testname = json.loads(slaveargs) +def run_tests_worker(worker_args): + ns_dict, testname = json.loads(worker_args) ns = types.SimpleNamespace(**ns_dict) setup_tests(ns) diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index 7c16c985db28..c0627dc14ef0 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -74,7 +74,7 @@ # globals "PIPE_MAX_SIZE", "verbose", "max_memuse", "use_resources", "failfast", # exceptions - "Error", "TestFailed", "ResourceDenied", + "Error", "TestFailed", "TestDidNotRun", "ResourceDenied", # imports "import_module", "import_fresh_module", "CleanImport", # modules @@ -120,6 +120,9 @@ class Error(Exception): class TestFailed(Error): """Test failed.""" +class TestDidNotRun(Error): + """Test did not run any subtests.""" + class ResourceDenied(unittest.SkipTest): """Test skipped because it requested a disallowed resource. @@ -1916,6 +1919,8 @@ def _run_suite(suite): if junit_xml_list is not None: junit_xml_list.append(result.get_xml_element()) + if not result.testsRun: + raise TestDidNotRun if not result.wasSuccessful(): if len(result.errors) == 1 and not result.failures: err = result.errors[0][1] diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py index 0b590ad8f188..5347bb171839 100644 --- a/Lib/test/test_regrtest.py +++ b/Lib/test/test_regrtest.py @@ -66,10 +66,10 @@ def test_wait(self): ns = libregrtest._parse_args(['--wait']) self.assertTrue(ns.wait) - def test_slaveargs(self): - ns = libregrtest._parse_args(['--slaveargs', '[[], {}]']) - self.assertEqual(ns.slaveargs, '[[], {}]') - self.checkError(['--slaveargs'], 'expected one argument') + def test_worker_args(self): + ns = libregrtest._parse_args(['--worker-args', '[[], {}]']) + self.assertEqual(ns.worker_args, '[[], {}]') + self.checkError(['--worker-args'], 'expected one argument') def test_start(self): for opt in '-S', '--start': @@ -351,11 +351,20 @@ def setUp(self): self.tmptestdir = tempfile.mkdtemp() self.addCleanup(support.rmtree, self.tmptestdir) - def create_test(self, name=None, code=''): + def create_test(self, name=None, code=None): if not name: name = 'noop%s' % BaseTestCase.TEST_UNIQUE_ID BaseTestCase.TEST_UNIQUE_ID += 1 + if code is None: + code = textwrap.dedent(""" + import unittest + + class Tests(unittest.TestCase): + def test_empty_test(self): + pass + """) + # test_regrtest cannot be run twice in parallel because # of setUp() and create_test() name = self.TESTNAME_PREFIX + name @@ -390,7 +399,7 @@ def parse_executed_tests(self, output): def check_executed_tests(self, output, tests, skipped=(), failed=(), env_changed=(), omitted=(), - rerun=(), + rerun=(), no_test_ran=(), randomize=False, interrupted=False, fail_env_changed=False): if isinstance(tests, str): @@ -405,6 +414,8 @@ def check_executed_tests(self, output, tests, skipped=(), failed=(), omitted = [omitted] if isinstance(rerun, str): rerun = [rerun] + if isinstance(no_test_ran, str): + no_test_ran = [no_test_ran] executed = self.parse_executed_tests(output) if randomize: @@ -447,8 +458,12 @@ def list_regex(line_format, tests): regex = "Re-running test %r in verbose mode" % name self.check_line(output, regex) + if no_test_ran: + regex = list_regex('%s test%s run no tests', no_test_ran) + self.check_line(output, regex) + good = (len(tests) - len(skipped) - len(failed) - - len(omitted) - len(env_changed)) + - len(omitted) - len(env_changed) - len(no_test_ran)) if good: regex = r'%s test%s OK\.$' % (good, plural(good)) if not skipped and not failed and good > 1: @@ -465,12 +480,16 @@ def list_regex(line_format, tests): result.append('ENV CHANGED') if interrupted: result.append('INTERRUPTED') - if not result: + if not any((good, result, failed, interrupted, skipped, + env_changed, fail_env_changed)): + result.append("NO TEST RUN") + elif not result: result.append('SUCCESS') result = ', '.join(result) if rerun: self.check_line(output, 'Tests result: %s' % result) result = 'FAILURE then %s' % result + self.check_line(output, 'Tests result: %s' % result) def parse_random_seed(self, output): @@ -649,7 +668,14 @@ def test_resources(self): # test -u command line option tests = {} for resource in ('audio', 'network'): - code = 'from test import support\nsupport.requires(%r)' % resource + code = textwrap.dedent(""" + from test import support; support.requires(%r) + import unittest + class PassingTest(unittest.TestCase): + def test_pass(self): + pass + """ % resource) + tests[resource] = self.create_test(resource, code) test_names = sorted(tests.values()) @@ -983,6 +1009,56 @@ def test_bug(self): output = self.run_tests("-w", testname, exitcode=2) self.check_executed_tests(output, [testname], failed=testname, rerun=testname) + def test_no_tests_ran(self): + code = textwrap.dedent(""" + import unittest + + class Tests(unittest.TestCase): + def test_bug(self): + pass + """) + testname = self.create_test(code=code) + + output = self.run_tests(testname, "-m", "nosuchtest", exitcode=0) + self.check_executed_tests(output, [testname], no_test_ran=testname) + + def test_no_tests_ran_multiple_tests_nonexistent(self): + code = textwrap.dedent(""" + import unittest + + class Tests(unittest.TestCase): + def test_bug(self): + pass + """) + testname = self.create_test(code=code) + testname2 = self.create_test(code=code) + + output = self.run_tests(testname, testname2, "-m", "nosuchtest", exitcode=0) + self.check_executed_tests(output, [testname, testname2], + no_test_ran=[testname, testname2]) + + def test_no_test_ran_some_test_exist_some_not(self): + code = textwrap.dedent(""" + import unittest + + class Tests(unittest.TestCase): + def test_bug(self): + pass + """) + testname = self.create_test(code=code) + other_code = textwrap.dedent(""" + import unittest + + class Tests(unittest.TestCase): + def test_other_bug(self): + pass + """) + testname2 = self.create_test(code=other_code) + + output = self.run_tests(testname, testname2, "-m", "nosuchtest", + "-m", "test_other_bug", exitcode=0) + self.check_executed_tests(output, [testname, testname2], + no_test_ran=[testname]) class TestUtils(unittest.TestCase): diff --git a/Misc/NEWS.d/next/Tests/2018-10-27-13-41-55.bpo-34279.v0Xqxe.rst b/Misc/NEWS.d/next/Tests/2018-10-27-13-41-55.bpo-34279.v0Xqxe.rst new file mode 100644 index 000000000000..a82fa6b304ac --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2018-10-27-13-41-55.bpo-34279.v0Xqxe.rst @@ -0,0 +1,3 @@ +regrtest issue a warning when no tests have been executed in a particular +test file. Also, a new final result state is issued if no test have been +executed across all test files. Patch by Pablo Galindo. From webhook-mailer at python.org Thu Nov 29 17:38:38 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 29 Nov 2018 22:38:38 -0000 Subject: [Python-checkins] bpo-34021: Windows skips test_regrtest.test_env_changed() (GH-10804) Message-ID: https://github.com/python/cpython/commit/f681e93e46925e862a8b0fa4b6e9e341fd8de3c2 commit: f681e93e46925e862a8b0fa4b6e9e341fd8de3c2 branch: 2.7 author: Victor Stinner committer: GitHub date: 2018-11-29T23:38:35+01:00 summary: bpo-34021: Windows skips test_regrtest.test_env_changed() (GH-10804) On Windows, test_env_changed() of test_regrtest is now skipped because it fails randomly for an unknown reason on "x86 Windows XP VS9.0 2.7" buildbot worker. files: M Lib/test/test_regrtest.py diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py index 593df7ac8ff9..015adc3fa06c 100644 --- a/Lib/test/test_regrtest.py +++ b/Lib/test/test_regrtest.py @@ -672,6 +672,9 @@ def test_main(): subset = ['test_method1', 'test_method3'] self.assertEqual(methods, subset) + # bpo-34021: The test fails randomly for an unknown reason + # on "x86 Windows XP VS9.0 2.7" buildbot worker. + @unittest.skipIf(sys.platform == "win32", "test fails randomly on Windows") def test_env_changed(self): code = textwrap.dedent(""" import unittest From webhook-mailer at python.org Fri Nov 30 02:40:21 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Fri, 30 Nov 2018 07:40:21 -0000 Subject: [Python-checkins] bpo-35356: Fix a possible reference leak in nis.maps(). (GH-10808) Message-ID: https://github.com/python/cpython/commit/a2e3585e79c93b2372dbad46a744e28fcc6dad6d commit: a2e3585e79c93b2372dbad46a744e28fcc6dad6d branch: master author: Zackery Spytz committer: Serhiy Storchaka date: 2018-11-30T09:40:16+02:00 summary: bpo-35356: Fix a possible reference leak in nis.maps(). (GH-10808) files: M Modules/nismodule.c diff --git a/Modules/nismodule.c b/Modules/nismodule.c index bc6796c278ca..a24978e06867 100644 --- a/Modules/nismodule.c +++ b/Modules/nismodule.c @@ -412,6 +412,7 @@ nis_maps (PyObject *self, PyObject *args, PyObject *kwdict) PyObject *str = PyUnicode_FromString(maps->map); if (!str || PyList_Append(list, str) < 0) { + Py_XDECREF(str); Py_DECREF(list); list = NULL; break; From webhook-mailer at python.org Fri Nov 30 02:42:51 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Fri, 30 Nov 2018 07:42:51 -0000 Subject: [Python-checkins] Fix typo in Memory Management doc. (GH-10798) Message-ID: https://github.com/python/cpython/commit/a40700439195a119878150f4f0d425c42ca957ef commit: a40700439195a119878150f4f0d425c42ca957ef branch: master author: Kevin Adler committer: Serhiy Storchaka date: 2018-11-30T09:42:47+02:00 summary: Fix typo in Memory Management doc. (GH-10798) files: M Doc/c-api/memory.rst diff --git a/Doc/c-api/memory.rst b/Doc/c-api/memory.rst index 9f7b13c14729..b79b7e49b67e 100644 --- a/Doc/c-api/memory.rst +++ b/Doc/c-api/memory.rst @@ -342,7 +342,7 @@ Configuration Name PyMem_RawMalloc PyMem Release build ``"pymalloc"`` ``malloc`` ``pymalloc`` ``pymalloc`` Debug build ``"pymalloc_debug"`` ``malloc`` + debug ``pymalloc`` + debug ``pymalloc`` + debug Release build, without pymalloc ``"malloc"`` ``malloc`` ``malloc`` ``malloc`` -Release build, without pymalloc ``"malloc_debug"`` ``malloc`` + debug ``malloc`` + debug ``malloc`` + debug +Debug build, without pymalloc ``"malloc_debug"`` ``malloc`` + debug ``malloc`` + debug ``malloc`` + debug =============================== ==================== ================== ===================== ==================== Legend: From webhook-mailer at python.org Fri Nov 30 02:59:44 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 30 Nov 2018 07:59:44 -0000 Subject: [Python-checkins] bpo-35356: Fix a possible reference leak in nis.maps(). (GH-10808) Message-ID: https://github.com/python/cpython/commit/3473ca424142cb8f1453ba802ba642060b5ce779 commit: 3473ca424142cb8f1453ba802ba642060b5ce779 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-29T23:59:41-08:00 summary: bpo-35356: Fix a possible reference leak in nis.maps(). (GH-10808) (cherry picked from commit a2e3585e79c93b2372dbad46a744e28fcc6dad6d) Co-authored-by: Zackery Spytz files: M Modules/nismodule.c diff --git a/Modules/nismodule.c b/Modules/nismodule.c index a9028bbfe54c..11df679b745b 100644 --- a/Modules/nismodule.c +++ b/Modules/nismodule.c @@ -412,6 +412,7 @@ nis_maps (PyObject *self, PyObject *args, PyObject *kwdict) PyObject *str = PyUnicode_FromString(maps->map); if (!str || PyList_Append(list, str) < 0) { + Py_XDECREF(str); Py_DECREF(list); list = NULL; break; From webhook-mailer at python.org Fri Nov 30 03:00:10 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 30 Nov 2018 08:00:10 -0000 Subject: [Python-checkins] bpo-35356: Fix a possible reference leak in nis.maps(). (GH-10808) Message-ID: https://github.com/python/cpython/commit/e604b6c53e7dce6d4cf52525f4ae57352d489cba commit: e604b6c53e7dce6d4cf52525f4ae57352d489cba branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-30T00:00:07-08:00 summary: bpo-35356: Fix a possible reference leak in nis.maps(). (GH-10808) (cherry picked from commit a2e3585e79c93b2372dbad46a744e28fcc6dad6d) Co-authored-by: Zackery Spytz files: M Modules/nismodule.c diff --git a/Modules/nismodule.c b/Modules/nismodule.c index a9028bbfe54c..11df679b745b 100644 --- a/Modules/nismodule.c +++ b/Modules/nismodule.c @@ -412,6 +412,7 @@ nis_maps (PyObject *self, PyObject *args, PyObject *kwdict) PyObject *str = PyUnicode_FromString(maps->map); if (!str || PyList_Append(list, str) < 0) { + Py_XDECREF(str); Py_DECREF(list); list = NULL; break; From webhook-mailer at python.org Fri Nov 30 03:04:46 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 30 Nov 2018 08:04:46 -0000 Subject: [Python-checkins] bpo-35356: Fix a possible reference leak in nis.maps(). (GH-10808) Message-ID: https://github.com/python/cpython/commit/f3fe21a3cacbc5d13c3e61cefb36ce0efe617cd7 commit: f3fe21a3cacbc5d13c3e61cefb36ce0efe617cd7 branch: 2.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-30T00:04:43-08:00 summary: bpo-35356: Fix a possible reference leak in nis.maps(). (GH-10808) (cherry picked from commit a2e3585e79c93b2372dbad46a744e28fcc6dad6d) Co-authored-by: Zackery Spytz files: M Modules/nismodule.c diff --git a/Modules/nismodule.c b/Modules/nismodule.c index 6acab63ddfd7..e8caea9c7e8d 100644 --- a/Modules/nismodule.c +++ b/Modules/nismodule.c @@ -405,6 +405,7 @@ nis_maps (PyObject *self, PyObject *args, PyObject *kwdict) PyObject *str = PyString_FromString(maps->map); if (!str || PyList_Append(list, str) < 0) { + Py_XDECREF(str); Py_DECREF(list); list = NULL; break; From webhook-mailer at python.org Fri Nov 30 03:05:54 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 30 Nov 2018 08:05:54 -0000 Subject: [Python-checkins] Fix typo in Memory Management doc. (GH-10798) Message-ID: https://github.com/python/cpython/commit/0df1f4576ed2b12acc96cbfd732db247249ac573 commit: 0df1f4576ed2b12acc96cbfd732db247249ac573 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-30T00:05:51-08:00 summary: Fix typo in Memory Management doc. (GH-10798) (cherry picked from commit a40700439195a119878150f4f0d425c42ca957ef) Co-authored-by: Kevin Adler files: M Doc/c-api/memory.rst diff --git a/Doc/c-api/memory.rst b/Doc/c-api/memory.rst index 9f7b13c14729..b79b7e49b67e 100644 --- a/Doc/c-api/memory.rst +++ b/Doc/c-api/memory.rst @@ -342,7 +342,7 @@ Configuration Name PyMem_RawMalloc PyMem Release build ``"pymalloc"`` ``malloc`` ``pymalloc`` ``pymalloc`` Debug build ``"pymalloc_debug"`` ``malloc`` + debug ``pymalloc`` + debug ``pymalloc`` + debug Release build, without pymalloc ``"malloc"`` ``malloc`` ``malloc`` ``malloc`` -Release build, without pymalloc ``"malloc_debug"`` ``malloc`` + debug ``malloc`` + debug ``malloc`` + debug +Debug build, without pymalloc ``"malloc_debug"`` ``malloc`` + debug ``malloc`` + debug ``malloc`` + debug =============================== ==================== ================== ===================== ==================== Legend: From solipsis at pitrou.net Fri Nov 30 04:10:14 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Fri, 30 Nov 2018 09:10:14 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=1 Message-ID: <20181130091014.1.D4E740C5522BA325@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_asyncio leaked [3, 0, 0] memory blocks, sum=3 test_collections leaked [-7, 1, 0] memory blocks, sum=-6 test_functools leaked [0, 3, 1] memory blocks, sum=4 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/refloggCX1kl', '--timeout', '7200'] From webhook-mailer at python.org Fri Nov 30 05:04:49 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 30 Nov 2018 10:04:49 -0000 Subject: [Python-checkins] Fix DeprecationWarning in test_bytes (GH-10805) Message-ID: https://github.com/python/cpython/commit/d7a880c3c2b73415a42c8a2f900c6bc597de115d commit: d7a880c3c2b73415a42c8a2f900c6bc597de115d branch: 2.7 author: Victor Stinner committer: GitHub date: 2018-11-30T11:04:42+01:00 summary: Fix DeprecationWarning in test_bytes (GH-10805) Running test_bytes with python -3 -Wd emits two DeprecationWarning on "1/0". Use "1//0" to prevent the warning. files: M Lib/test/test_bytes.py diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py index c04f7b305a0a..cb2a4d95787d 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -161,13 +161,13 @@ def test_constructor_exceptions(self): # exceptions. class BadInt: def __index__(self): - 1/0 + 1//0 self.assertRaises(ZeroDivisionError, self.type2test, BadInt()) self.assertRaises(ZeroDivisionError, self.type2test, [BadInt()]) class BadIterable: def __iter__(self): - 1/0 + 1//0 self.assertRaises(ZeroDivisionError, self.type2test, BadIterable()) def test_compare(self): From webhook-mailer at python.org Fri Nov 30 05:34:51 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 30 Nov 2018 10:34:51 -0000 Subject: [Python-checkins] bpo-35336: Fix PYTHONCOERCECLOCALE=1 (GH-10806) Message-ID: https://github.com/python/cpython/commit/55e498058faf8c97840556f6d791c2c392732dc3 commit: 55e498058faf8c97840556f6d791c2c392732dc3 branch: master author: Victor Stinner committer: GitHub date: 2018-11-30T11:34:47+01:00 summary: bpo-35336: Fix PYTHONCOERCECLOCALE=1 (GH-10806) Fix PYTHONCOERCECLOCALE=1 environment variable: only coerce the C locale if the LC_CTYPE locale is "C". files: A Misc/NEWS.d/next/Core and Builtins/2018-11-29-23-59-52.bpo-35336.8LOz4F.rst M Lib/test/test_c_locale_coercion.py M Python/coreconfig.c diff --git a/Lib/test/test_c_locale_coercion.py b/Lib/test/test_c_locale_coercion.py index ce8ac4eb843b..35272b5c15ac 100644 --- a/Lib/test/test_c_locale_coercion.py +++ b/Lib/test/test_c_locale_coercion.py @@ -1,11 +1,12 @@ # Tests the attempted automatic coercion of the C locale to a UTF-8 locale -import unittest import locale import os +import shutil +import subprocess import sys import sysconfig -import shutil +import unittest from collections import namedtuple from test import support @@ -25,6 +26,8 @@ # Set our expectation for the default locale used when none is specified EXPECT_COERCION_IN_DEFAULT_LOCALE = True +TARGET_LOCALES = ["C.UTF-8", "C.utf8", "UTF-8"] + # Apply some platform dependent overrides if sys.platform.startswith("linux"): if support.is_android: @@ -413,6 +416,27 @@ def test_LC_ALL_set_to_C(self): expected_warnings=[LEGACY_LOCALE_WARNING], coercion_expected=False) + def test_PYTHONCOERCECLOCALE_set_to_one(self): + # skip the test if the LC_CTYPE locale is C or coerced + old_loc = locale.setlocale(locale.LC_CTYPE, None) + self.addCleanup(locale.setlocale, locale.LC_CTYPE, old_loc) + loc = locale.setlocale(locale.LC_CTYPE, "") + if loc == "C": + self.skipTest("test requires LC_CTYPE locale different than C") + if loc in TARGET_LOCALES : + self.skipTest("coerced LC_CTYPE locale: %s" % loc) + + # bpo-35336: PYTHONCOERCECLOCALE=1 must not coerce the LC_CTYPE locale + # if it's not equal to "C" + code = 'import locale; print(locale.setlocale(locale.LC_CTYPE, None))' + env = dict(os.environ, PYTHONCOERCECLOCALE='1') + cmd = subprocess.run([sys.executable, '-c', code], + stdout=subprocess.PIPE, + env=env, + text=True) + self.assertEqual(cmd.stdout.rstrip(), loc) + + def test_main(): support.run_unittest( LocaleConfigurationTests, diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-11-29-23-59-52.bpo-35336.8LOz4F.rst b/Misc/NEWS.d/next/Core and Builtins/2018-11-29-23-59-52.bpo-35336.8LOz4F.rst new file mode 100644 index 000000000000..28f8f9bd4db7 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-11-29-23-59-52.bpo-35336.8LOz4F.rst @@ -0,0 +1,2 @@ +Fix PYTHONCOERCECLOCALE=1 environment variable: only coerce the C locale +if the LC_CTYPE locale is "C". diff --git a/Python/coreconfig.c b/Python/coreconfig.c index ad22300e56e4..2fb4e3fd196e 100644 --- a/Python/coreconfig.c +++ b/Python/coreconfig.c @@ -1061,11 +1061,17 @@ config_read_complex_options(_PyCoreConfig *config) static void config_init_locale(_PyCoreConfig *config) { - if (config->coerce_c_locale < 0) { + /* Test also if coerce_c_locale equals 1: PYTHONCOERCECLOCALE=1 doesn't + imply that the C locale is always coerced. It is only coerced if + if the LC_CTYPE locale is "C". */ + if (config->coerce_c_locale != 0) { /* The C locale enables the C locale coercion (PEP 538) */ if (_Py_LegacyLocaleDetected()) { config->coerce_c_locale = 1; } + else { + config->coerce_c_locale = 0; + } } #ifndef MS_WINDOWS @@ -1394,7 +1400,7 @@ _PyCoreConfig_Read(_PyCoreConfig *config) } } - if (config->utf8_mode < 0 || config->coerce_c_locale < 0) { + if (config->coerce_c_locale != 0 || config->utf8_mode < 0) { config_init_locale(config); } From webhook-mailer at python.org Fri Nov 30 06:19:51 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 30 Nov 2018 11:19:51 -0000 Subject: [Python-checkins] bpo-35336: Fix PYTHONCOERCECLOCALE=1 (GH-10806) (GH-10813) Message-ID: https://github.com/python/cpython/commit/df738d56fe798b3586ed71775df25bf127789cf6 commit: df738d56fe798b3586ed71775df25bf127789cf6 branch: 3.7 author: Victor Stinner committer: GitHub date: 2018-11-30T12:19:48+01:00 summary: bpo-35336: Fix PYTHONCOERCECLOCALE=1 (GH-10806) (GH-10813) Fix PYTHONCOERCECLOCALE=1 environment variable: only coerce the C locale if the LC_CTYPE locale is "C". (cherry picked from commit 55e498058faf8c97840556f6d791c2c392732dc3) files: A Misc/NEWS.d/next/Core and Builtins/2018-11-29-23-59-52.bpo-35336.8LOz4F.rst M Lib/test/test_c_locale_coercion.py M Modules/main.c diff --git a/Lib/test/test_c_locale_coercion.py b/Lib/test/test_c_locale_coercion.py index 1db293b9c373..134f07a17ec1 100644 --- a/Lib/test/test_c_locale_coercion.py +++ b/Lib/test/test_c_locale_coercion.py @@ -1,11 +1,12 @@ # Tests the attempted automatic coercion of the C locale to a UTF-8 locale -import unittest import locale import os +import shutil +import subprocess import sys import sysconfig -import shutil +import unittest from collections import namedtuple import test.support @@ -25,6 +26,8 @@ # Set our expectation for the default locale used when none is specified EXPECT_COERCION_IN_DEFAULT_LOCALE = True +TARGET_LOCALES = ["C.UTF-8", "C.utf8", "UTF-8"] + # Apply some platform dependent overrides if sys.platform.startswith("linux"): if test.support.is_android: @@ -404,6 +407,27 @@ def test_LC_ALL_set_to_C(self): expected_warnings=[LEGACY_LOCALE_WARNING], coercion_expected=False) + def test_PYTHONCOERCECLOCALE_set_to_one(self): + # skip the test if the LC_CTYPE locale is C or coerced + old_loc = locale.setlocale(locale.LC_CTYPE, None) + self.addCleanup(locale.setlocale, locale.LC_CTYPE, old_loc) + loc = locale.setlocale(locale.LC_CTYPE, "") + if loc == "C": + self.skipTest("test requires LC_CTYPE locale different than C") + if loc in TARGET_LOCALES : + self.skipTest("coerced LC_CTYPE locale: %s" % loc) + + # bpo-35336: PYTHONCOERCECLOCALE=1 must not coerce the LC_CTYPE locale + # if it's not equal to "C" + code = 'import locale; print(locale.setlocale(locale.LC_CTYPE, None))' + env = dict(os.environ, PYTHONCOERCECLOCALE='1') + cmd = subprocess.run([sys.executable, '-c', code], + stdout=subprocess.PIPE, + env=env, + text=True) + self.assertEqual(cmd.stdout.rstrip(), loc) + + def test_main(): test.support.run_unittest( LocaleConfigurationTests, diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-11-29-23-59-52.bpo-35336.8LOz4F.rst b/Misc/NEWS.d/next/Core and Builtins/2018-11-29-23-59-52.bpo-35336.8LOz4F.rst new file mode 100644 index 000000000000..28f8f9bd4db7 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-11-29-23-59-52.bpo-35336.8LOz4F.rst @@ -0,0 +1,2 @@ +Fix PYTHONCOERCECLOCALE=1 environment variable: only coerce the C locale +if the LC_CTYPE locale is "C". diff --git a/Modules/main.c b/Modules/main.c index 6dbe6a30786b..af2c191b9b9b 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -2191,11 +2191,17 @@ pymain_read_conf(_PyMain *pymain, _PyCoreConfig *config, _PyCmdline *cmdline) static void config_init_locale(_PyCoreConfig *config) { - if (config->coerce_c_locale < 0) { + /* Test also if coerce_c_locale equals 1: PYTHONCOERCECLOCALE=1 doesn't + imply that the C locale is always coerced. It is only coerced if + if the LC_CTYPE locale is "C". */ + if (config->coerce_c_locale != 0) { /* The C locale enables the C locale coercion (PEP 538) */ if (_Py_LegacyLocaleDetected()) { config->coerce_c_locale = 1; } + else { + config->coerce_c_locale = 0; + } } #ifndef MS_WINDOWS @@ -2376,7 +2382,7 @@ _PyCoreConfig_Read(_PyCoreConfig *config) } } - if (config->utf8_mode < 0 || config->coerce_c_locale < 0) { + if (config->coerce_c_locale != 0 || config->utf8_mode < 0) { config_init_locale(config); } From webhook-mailer at python.org Fri Nov 30 06:29:28 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 30 Nov 2018 11:29:28 -0000 Subject: [Python-checkins] bpo-35347: Fix test_socket.NonBlockingTCPTests (GH-10791) Message-ID: https://github.com/python/cpython/commit/ebd5d6d6e6e4e751ba9c7534004aadfc27ba9265 commit: ebd5d6d6e6e4e751ba9c7534004aadfc27ba9265 branch: master author: Victor Stinner committer: GitHub date: 2018-11-30T12:29:25+01:00 summary: bpo-35347: Fix test_socket.NonBlockingTCPTests (GH-10791) testAccept() and testRecv() of test_socket.NonBlockingTCPTests have a race condition: time.sleep() is used as a weak synchronization primitive and the tests fail randomly on slow buildbots. Use a reliable threading.Event to fix these tests. Other changes: * Replace send() with sendall() * Expect specific BlockingIOError rather than generic OSError * Add a timeout to select() in testAccept() and testRecv() * Use addCleanup() to close sockets * Use assertRaises() files: M Lib/test/test_socket.py diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 663a018dcfda..ececebfd1b12 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -35,6 +35,7 @@ HOST = support.HOST MSG = 'Michael Gilfix was here\u1234\r\n'.encode('utf-8') ## test unicode string and carriage return +MAIN_TIMEOUT = 60.0 VSOCKPORT = 1234 @@ -4214,6 +4215,7 @@ def _testSend(self): class NonBlockingTCPTests(ThreadedTCPSocketTest): def __init__(self, methodName='runTest'): + self.event = threading.Event() ThreadedTCPSocketTest.__init__(self, methodName=methodName) def testSetBlocking(self): @@ -4326,22 +4328,27 @@ def _testInheritFlags(self): def testAccept(self): # Testing non-blocking accept self.serv.setblocking(0) - try: - conn, addr = self.serv.accept() - except OSError: - pass - else: - self.fail("Error trying to do non-blocking accept.") - read, write, err = select.select([self.serv], [], []) - if self.serv in read: + + # connect() didn't start: non-blocking accept() fails + with self.assertRaises(BlockingIOError): conn, addr = self.serv.accept() - self.assertIsNone(conn.gettimeout()) - conn.close() - else: + + self.event.set() + + read, write, err = select.select([self.serv], [], [], MAIN_TIMEOUT) + if self.serv not in read: self.fail("Error trying to do accept after select.") + # connect() completed: non-blocking accept() doesn't block + conn, addr = self.serv.accept() + self.addCleanup(conn.close) + self.assertIsNone(conn.gettimeout()) + def _testAccept(self): - time.sleep(0.1) + # don't connect before event is set to check + # that non-blocking accept() raises BlockingIOError + self.event.wait() + self.cli.connect((HOST, self.port)) def testConnect(self): @@ -4356,25 +4363,32 @@ def _testConnect(self): def testRecv(self): # Testing non-blocking recv conn, addr = self.serv.accept() + self.addCleanup(conn.close) conn.setblocking(0) - try: - msg = conn.recv(len(MSG)) - except OSError: - pass - else: - self.fail("Error trying to do non-blocking recv.") - read, write, err = select.select([conn], [], []) - if conn in read: + + # the server didn't send data yet: non-blocking recv() fails + with self.assertRaises(BlockingIOError): msg = conn.recv(len(MSG)) - conn.close() - self.assertEqual(msg, MSG) - else: + + self.event.set() + + read, write, err = select.select([conn], [], [], MAIN_TIMEOUT) + if conn not in read: self.fail("Error during select call to non-blocking socket.") + # the server sent data yet: non-blocking recv() doesn't block + msg = conn.recv(len(MSG)) + self.assertEqual(msg, MSG) + def _testRecv(self): self.cli.connect((HOST, self.port)) - time.sleep(0.1) - self.cli.send(MSG) + + # don't send anything before event is set to check + # that non-blocking recv() raises BlockingIOError + self.event.wait() + + # send data: recv() will no longer block + self.cli.sendall(MSG) class FileObjectClassTestCase(SocketConnectedTest): From webhook-mailer at python.org Fri Nov 30 06:48:20 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 30 Nov 2018 11:48:20 -0000 Subject: [Python-checkins] bpo-35347: Fix test_socket.NonBlockingTCPTests (GH-10791) Message-ID: https://github.com/python/cpython/commit/365f21c2d3756a6768c5b0d479aaf5c2a568b80b commit: 365f21c2d3756a6768c5b0d479aaf5c2a568b80b branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-30T03:48:17-08:00 summary: bpo-35347: Fix test_socket.NonBlockingTCPTests (GH-10791) testAccept() and testRecv() of test_socket.NonBlockingTCPTests have a race condition: time.sleep() is used as a weak synchronization primitive and the tests fail randomly on slow buildbots. Use a reliable threading.Event to fix these tests. Other changes: * Replace send() with sendall() * Expect specific BlockingIOError rather than generic OSError * Add a timeout to select() in testAccept() and testRecv() * Use addCleanup() to close sockets * Use assertRaises() (cherry picked from commit ebd5d6d6e6e4e751ba9c7534004aadfc27ba9265) Co-authored-by: Victor Stinner files: M Lib/test/test_socket.py diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 5f9891de4936..db2160eaf583 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -35,6 +35,7 @@ HOST = support.HOST MSG = 'Michael Gilfix was here\u1234\r\n'.encode('utf-8') ## test unicode string and carriage return +MAIN_TIMEOUT = 60.0 VSOCKPORT = 1234 @@ -4174,6 +4175,7 @@ def _testSend(self): class NonBlockingTCPTests(ThreadedTCPSocketTest): def __init__(self, methodName='runTest'): + self.event = threading.Event() ThreadedTCPSocketTest.__init__(self, methodName=methodName) def testSetBlocking(self): @@ -4286,22 +4288,27 @@ def _testInheritFlags(self): def testAccept(self): # Testing non-blocking accept self.serv.setblocking(0) - try: - conn, addr = self.serv.accept() - except OSError: - pass - else: - self.fail("Error trying to do non-blocking accept.") - read, write, err = select.select([self.serv], [], []) - if self.serv in read: + + # connect() didn't start: non-blocking accept() fails + with self.assertRaises(BlockingIOError): conn, addr = self.serv.accept() - self.assertIsNone(conn.gettimeout()) - conn.close() - else: + + self.event.set() + + read, write, err = select.select([self.serv], [], [], MAIN_TIMEOUT) + if self.serv not in read: self.fail("Error trying to do accept after select.") + # connect() completed: non-blocking accept() doesn't block + conn, addr = self.serv.accept() + self.addCleanup(conn.close) + self.assertIsNone(conn.gettimeout()) + def _testAccept(self): - time.sleep(0.1) + # don't connect before event is set to check + # that non-blocking accept() raises BlockingIOError + self.event.wait() + self.cli.connect((HOST, self.port)) def testConnect(self): @@ -4316,25 +4323,32 @@ def _testConnect(self): def testRecv(self): # Testing non-blocking recv conn, addr = self.serv.accept() + self.addCleanup(conn.close) conn.setblocking(0) - try: - msg = conn.recv(len(MSG)) - except OSError: - pass - else: - self.fail("Error trying to do non-blocking recv.") - read, write, err = select.select([conn], [], []) - if conn in read: + + # the server didn't send data yet: non-blocking recv() fails + with self.assertRaises(BlockingIOError): msg = conn.recv(len(MSG)) - conn.close() - self.assertEqual(msg, MSG) - else: + + self.event.set() + + read, write, err = select.select([conn], [], [], MAIN_TIMEOUT) + if conn not in read: self.fail("Error during select call to non-blocking socket.") + # the server sent data yet: non-blocking recv() doesn't block + msg = conn.recv(len(MSG)) + self.assertEqual(msg, MSG) + def _testRecv(self): self.cli.connect((HOST, self.port)) - time.sleep(0.1) - self.cli.send(MSG) + + # don't send anything before event is set to check + # that non-blocking recv() raises BlockingIOError + self.event.wait() + + # send data: recv() will no longer block + self.cli.sendall(MSG) class FileObjectClassTestCase(SocketConnectedTest): From webhook-mailer at python.org Fri Nov 30 06:51:46 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 30 Nov 2018 11:51:46 -0000 Subject: [Python-checkins] bpo-35347: Fix test_socket.NonBlockingTCPTests (GH-10791) Message-ID: https://github.com/python/cpython/commit/af7e81f71858519de8d2bafcb38fce8cca86aa0a commit: af7e81f71858519de8d2bafcb38fce8cca86aa0a branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-30T03:51:42-08:00 summary: bpo-35347: Fix test_socket.NonBlockingTCPTests (GH-10791) testAccept() and testRecv() of test_socket.NonBlockingTCPTests have a race condition: time.sleep() is used as a weak synchronization primitive and the tests fail randomly on slow buildbots. Use a reliable threading.Event to fix these tests. Other changes: * Replace send() with sendall() * Expect specific BlockingIOError rather than generic OSError * Add a timeout to select() in testAccept() and testRecv() * Use addCleanup() to close sockets * Use assertRaises() (cherry picked from commit ebd5d6d6e6e4e751ba9c7534004aadfc27ba9265) Co-authored-by: Victor Stinner files: M Lib/test/test_socket.py diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index fbbc9f9abfb0..6b7afba49d9e 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -32,6 +32,7 @@ HOST = support.HOST MSG = 'Michael Gilfix was here\u1234\r\n'.encode('utf-8') ## test unicode string and carriage return +MAIN_TIMEOUT = 60.0 try: import _thread as thread @@ -3870,6 +3871,7 @@ def _testSend(self): class NonBlockingTCPTests(ThreadedTCPSocketTest): def __init__(self, methodName='runTest'): + self.event = threading.Event() ThreadedTCPSocketTest.__init__(self, methodName=methodName) def testSetBlocking(self): @@ -3944,22 +3946,27 @@ def _testInheritFlags(self): def testAccept(self): # Testing non-blocking accept self.serv.setblocking(0) - try: - conn, addr = self.serv.accept() - except OSError: - pass - else: - self.fail("Error trying to do non-blocking accept.") - read, write, err = select.select([self.serv], [], []) - if self.serv in read: + + # connect() didn't start: non-blocking accept() fails + with self.assertRaises(BlockingIOError): conn, addr = self.serv.accept() - self.assertIsNone(conn.gettimeout()) - conn.close() - else: + + self.event.set() + + read, write, err = select.select([self.serv], [], [], MAIN_TIMEOUT) + if self.serv not in read: self.fail("Error trying to do accept after select.") + # connect() completed: non-blocking accept() doesn't block + conn, addr = self.serv.accept() + self.addCleanup(conn.close) + self.assertIsNone(conn.gettimeout()) + def _testAccept(self): - time.sleep(0.1) + # don't connect before event is set to check + # that non-blocking accept() raises BlockingIOError + self.event.wait() + self.cli.connect((HOST, self.port)) def testConnect(self): @@ -3974,25 +3981,32 @@ def _testConnect(self): def testRecv(self): # Testing non-blocking recv conn, addr = self.serv.accept() + self.addCleanup(conn.close) conn.setblocking(0) - try: - msg = conn.recv(len(MSG)) - except OSError: - pass - else: - self.fail("Error trying to do non-blocking recv.") - read, write, err = select.select([conn], [], []) - if conn in read: + + # the server didn't send data yet: non-blocking recv() fails + with self.assertRaises(BlockingIOError): msg = conn.recv(len(MSG)) - conn.close() - self.assertEqual(msg, MSG) - else: + + self.event.set() + + read, write, err = select.select([conn], [], [], MAIN_TIMEOUT) + if conn not in read: self.fail("Error during select call to non-blocking socket.") + # the server sent data yet: non-blocking recv() doesn't block + msg = conn.recv(len(MSG)) + self.assertEqual(msg, MSG) + def _testRecv(self): self.cli.connect((HOST, self.port)) - time.sleep(0.1) - self.cli.send(MSG) + + # don't send anything before event is set to check + # that non-blocking recv() raises BlockingIOError + self.event.wait() + + # send data: recv() will no longer block + self.cli.sendall(MSG) @unittest.skipUnless(thread, 'Threading required for this test.') class FileObjectClassTestCase(SocketConnectedTest): From webhook-mailer at python.org Fri Nov 30 07:02:45 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 30 Nov 2018 12:02:45 -0000 Subject: [Python-checkins] bpo-35347: Fix test_socket.NonBlockingTCPTests (GH-10791) (GH-10817) Message-ID: https://github.com/python/cpython/commit/dab59fa56054d6c0f75ae7013337f7baaa248076 commit: dab59fa56054d6c0f75ae7013337f7baaa248076 branch: 2.7 author: Victor Stinner committer: GitHub date: 2018-11-30T13:02:41+01:00 summary: bpo-35347: Fix test_socket.NonBlockingTCPTests (GH-10791) (GH-10817) testAccept() and testRecv() of test_socket.NonBlockingTCPTests have a race condition: time.sleep() is used as a weak synchronization primitive and the tests fail randomly on slow buildbots. Use a reliable threading.Event to fix these tests. Other changes: * Replace send() with sendall() * Add a timeout to select() in testAccept() and testRecv() * Use addCleanup() to close sockets * Use assertRaises() (cherry picked from commit ebd5d6d6e6e4e751ba9c7534004aadfc27ba9265) files: M Lib/test/test_socket.py diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 14607115928b..988e12a813d5 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -21,6 +21,9 @@ _socket = None +MAIN_TIMEOUT = 60.0 + + def try_address(host, port=0, family=socket.AF_INET): """Try to bind a socket on the given host:port and return True if that has been possible.""" @@ -947,6 +950,7 @@ def _testSend(self): class NonBlockingTCPTests(ThreadedTCPSocketTest): def __init__(self, methodName='runTest'): + self.event = threading.Event() ThreadedTCPSocketTest.__init__(self, methodName=methodName) def testSetBlocking(self): @@ -982,21 +986,27 @@ def testSetBlocking_overflow(self): def testAccept(self): # Testing non-blocking accept self.serv.setblocking(0) - try: - conn, addr = self.serv.accept() - except socket.error: - pass - else: - self.fail("Error trying to do non-blocking accept.") - read, write, err = select.select([self.serv], [], []) - if self.serv in read: + + # connect() didn't start: non-blocking accept() fails + with self.assertRaises(socket.error): conn, addr = self.serv.accept() - conn.close() - else: + + self.event.set() + + read, write, err = select.select([self.serv], [], [], MAIN_TIMEOUT) + if self.serv not in read: self.fail("Error trying to do accept after select.") + # connect() completed: non-blocking accept() doesn't block + conn, addr = self.serv.accept() + self.addCleanup(conn.close) + self.assertIsNone(conn.gettimeout()) + def _testAccept(self): - time.sleep(0.1) + # don't connect before event is set to check + # that non-blocking accept() raises socket.error + self.event.wait() + self.cli.connect((HOST, self.port)) def testConnect(self): @@ -1011,25 +1021,32 @@ def _testConnect(self): def testRecv(self): # Testing non-blocking recv conn, addr = self.serv.accept() + self.addCleanup(conn.close) conn.setblocking(0) - try: - msg = conn.recv(len(MSG)) - except socket.error: - pass - else: - self.fail("Error trying to do non-blocking recv.") - read, write, err = select.select([conn], [], []) - if conn in read: + + # the server didn't send data yet: non-blocking recv() fails + with self.assertRaises(socket.error): msg = conn.recv(len(MSG)) - conn.close() - self.assertEqual(msg, MSG) - else: + + self.event.set() + + read, write, err = select.select([conn], [], [], MAIN_TIMEOUT) + if conn not in read: self.fail("Error during select call to non-blocking socket.") + # the server sent data yet: non-blocking recv() doesn't block + msg = conn.recv(len(MSG)) + self.assertEqual(msg, MSG) + def _testRecv(self): self.cli.connect((HOST, self.port)) - time.sleep(0.1) - self.cli.send(MSG) + + # don't send anything before event is set to check + # that non-blocking recv() raises socket.error + self.event.wait() + + # send data: recv() will no longer block + self.cli.sendall(MSG) @unittest.skipUnless(thread, 'Threading required for this test.') class FileObjectClassTestCase(SocketConnectedTest): From webhook-mailer at python.org Fri Nov 30 07:22:48 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 30 Nov 2018 12:22:48 -0000 Subject: [Python-checkins] bpo-35347: Cleanup test_socket.NonBlockingTCPTests (GH-10818) Message-ID: https://github.com/python/cpython/commit/304315d251dbb4e85dd86056ba1925f25e646ca1 commit: 304315d251dbb4e85dd86056ba1925f25e646ca1 branch: master author: Victor Stinner committer: GitHub date: 2018-11-30T13:22:44+01:00 summary: bpo-35347: Cleanup test_socket.NonBlockingTCPTests (GH-10818) * Replace testInheritFlags() with two tests: testInheritFlagsBlocking() and testInheritFlagsTimeout() to test different default socket timeout. Moreover, the test now checks sock.gettimeout() rather than a functional test on recv(). * Replace time.time() with time.monotonic() * Add socket_setdefaulttimeout() context manager to restore the default timeout when the test completes. * Remove testConnect(): accept() wasn't blocking and testAccept() already tests non-blocking accept(). * Remove accept() functional test from testInitNonBlocking(): already tested by testAccept() * Rewrite testSetBlocking() with a new assert_sock_timeout() method * Use addCleanup() and context manager to close sockets * Replace assertTrue(x < y) with assertLess(x, y) files: M Lib/test/test_socket.py diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index ececebfd1b12..a2c047daa3a4 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -34,7 +34,8 @@ fcntl = None HOST = support.HOST -MSG = 'Michael Gilfix was here\u1234\r\n'.encode('utf-8') ## test unicode string and carriage return +# test unicode string and carriage return +MSG = 'Michael Gilfix was here\u1234\r\n'.encode('utf-8') MAIN_TIMEOUT = 60.0 VSOCKPORT = 1234 @@ -111,9 +112,14 @@ def _have_socket_vsock(): return ret -def _is_fd_in_blocking_mode(sock): - return not bool( - fcntl.fcntl(sock, fcntl.F_GETFL, os.O_NONBLOCK) & os.O_NONBLOCK) + at contextlib.contextmanager +def socket_setdefaulttimeout(timeout): + old_timeout = socket.getdefaulttimeout() + try: + socket.setdefaulttimeout(timeout) + yield + finally: + socket.setdefaulttimeout(old_timeout) HAVE_SOCKET_CAN = _have_socket_can() @@ -1069,18 +1075,16 @@ def testDefaultTimeout(self): s.close() # Set the default timeout to 10, and see if it propagates - socket.setdefaulttimeout(10) - self.assertEqual(socket.getdefaulttimeout(), 10) - s = socket.socket() - self.assertEqual(s.gettimeout(), 10) - s.close() + with socket_setdefaulttimeout(10): + self.assertEqual(socket.getdefaulttimeout(), 10) + with socket.socket() as sock: + self.assertEqual(sock.gettimeout(), 10) - # Reset the default timeout to None, and see if it propagates - socket.setdefaulttimeout(None) - self.assertEqual(socket.getdefaulttimeout(), None) - s = socket.socket() - self.assertEqual(s.gettimeout(), None) - s.close() + # Reset the default timeout to None, and see if it propagates + socket.setdefaulttimeout(None) + self.assertEqual(socket.getdefaulttimeout(), None) + with socket.socket() as sock: + self.assertEqual(sock.gettimeout(), None) # Check that setting it to an invalid value raises ValueError self.assertRaises(ValueError, socket.setdefaulttimeout, -1) @@ -4218,55 +4222,42 @@ def __init__(self, methodName='runTest'): self.event = threading.Event() ThreadedTCPSocketTest.__init__(self, methodName=methodName) + def assert_sock_timeout(self, sock, timeout): + self.assertEqual(self.serv.gettimeout(), timeout) + + blocking = (timeout != 0.0) + self.assertEqual(sock.getblocking(), blocking) + + if fcntl is not None: + # When a Python socket has a non-zero timeout, it's switched + # internally to a non-blocking mode. Later, sock.sendall(), + # sock.recv(), and other socket operations use a select() call and + # handle EWOULDBLOCK/EGAIN on all socket operations. That's how + # timeouts are enforced. + fd_blocking = (timeout is None) + + flag = fcntl.fcntl(sock, fcntl.F_GETFL, os.O_NONBLOCK) + self.assertEqual(not bool(flag & os.O_NONBLOCK), fd_blocking) + def testSetBlocking(self): - # Testing whether set blocking works + # Test setblocking() and settimeout() methods self.serv.setblocking(True) - self.assertIsNone(self.serv.gettimeout()) - self.assertTrue(self.serv.getblocking()) - if fcntl: - self.assertTrue(_is_fd_in_blocking_mode(self.serv)) + self.assert_sock_timeout(self.serv, None) self.serv.setblocking(False) - self.assertEqual(self.serv.gettimeout(), 0.0) - self.assertFalse(self.serv.getblocking()) - if fcntl: - self.assertFalse(_is_fd_in_blocking_mode(self.serv)) + self.assert_sock_timeout(self.serv, 0.0) self.serv.settimeout(None) - self.assertTrue(self.serv.getblocking()) - if fcntl: - self.assertTrue(_is_fd_in_blocking_mode(self.serv)) + self.assert_sock_timeout(self.serv, None) self.serv.settimeout(0) - self.assertFalse(self.serv.getblocking()) - self.assertEqual(self.serv.gettimeout(), 0) - if fcntl: - self.assertFalse(_is_fd_in_blocking_mode(self.serv)) + self.assert_sock_timeout(self.serv, 0) self.serv.settimeout(10) - self.assertTrue(self.serv.getblocking()) - self.assertEqual(self.serv.gettimeout(), 10) - if fcntl: - # When a Python socket has a non-zero timeout, it's - # switched internally to a non-blocking mode. - # Later, sock.sendall(), sock.recv(), and other socket - # operations use a `select()` call and handle EWOULDBLOCK/EGAIN - # on all socket operations. That's how timeouts are - # enforced. - self.assertFalse(_is_fd_in_blocking_mode(self.serv)) + self.assert_sock_timeout(self.serv, 10) self.serv.settimeout(0) - self.assertFalse(self.serv.getblocking()) - if fcntl: - self.assertFalse(_is_fd_in_blocking_mode(self.serv)) - - start = time.time() - try: - self.serv.accept() - except OSError: - pass - end = time.time() - self.assertTrue((end - start) < 1.0, "Error setting non-blocking mode.") + self.assert_sock_timeout(self.serv, 0) def _testSetBlocking(self): pass @@ -4277,8 +4268,10 @@ def testSetBlocking_overflow(self): import _testcapi if _testcapi.UINT_MAX >= _testcapi.ULONG_MAX: self.skipTest('needs UINT_MAX < ULONG_MAX') + self.serv.setblocking(False) self.assertEqual(self.serv.gettimeout(), 0.0) + self.serv.setblocking(_testcapi.UINT_MAX + 1) self.assertIsNone(self.serv.gettimeout()) @@ -4288,50 +4281,51 @@ def testSetBlocking_overflow(self): 'test needs socket.SOCK_NONBLOCK') @support.requires_linux_version(2, 6, 28) def testInitNonBlocking(self): - # reinit server socket + # create a socket with SOCK_NONBLOCK self.serv.close() - self.serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM | - socket.SOCK_NONBLOCK) - self.assertFalse(self.serv.getblocking()) - self.assertEqual(self.serv.gettimeout(), 0) - self.port = support.bind_port(self.serv) - self.serv.listen() - # actual testing - start = time.time() - try: - self.serv.accept() - except OSError: - pass - end = time.time() - self.assertTrue((end - start) < 1.0, "Error creating with non-blocking mode.") + self.serv = socket.socket(socket.AF_INET, + socket.SOCK_STREAM | socket.SOCK_NONBLOCK) + self.assert_sock_timeout(self.serv, 0) def _testInitNonBlocking(self): pass - def testInheritFlags(self): - # Issue #7995: when calling accept() on a listening socket with a - # timeout, the resulting socket should not be non-blocking. - self.serv.settimeout(10) - try: + def testInheritFlagsBlocking(self): + # bpo-7995: accept() on a listening socket with a timeout and the + # default timeout is None, the resulting socket must be blocking. + with socket_setdefaulttimeout(None): + self.serv.settimeout(10) conn, addr = self.serv.accept() - message = conn.recv(len(MSG)) - finally: - conn.close() - self.serv.settimeout(None) + self.addCleanup(conn.close) + self.assertIsNone(conn.gettimeout()) - def _testInheritFlags(self): - time.sleep(0.1) + def _testInheritFlagsBlocking(self): + self.cli.connect((HOST, self.port)) + + def testInheritFlagsTimeout(self): + # bpo-7995: accept() on a listening socket with a timeout and the + # default timeout is None, the resulting socket must inherit + # the default timeout. + default_timeout = 20.0 + with socket_setdefaulttimeout(default_timeout): + self.serv.settimeout(10) + conn, addr = self.serv.accept() + self.addCleanup(conn.close) + self.assertEqual(conn.gettimeout(), default_timeout) + + def _testInheritFlagsTimeout(self): self.cli.connect((HOST, self.port)) - time.sleep(0.5) - self.cli.send(MSG) def testAccept(self): # Testing non-blocking accept self.serv.setblocking(0) # connect() didn't start: non-blocking accept() fails + start_time = time.monotonic() with self.assertRaises(BlockingIOError): conn, addr = self.serv.accept() + dt = time.monotonic() - start_time + self.assertLess(dt, 1.0) self.event.set() @@ -4351,15 +4345,6 @@ def _testAccept(self): self.cli.connect((HOST, self.port)) - def testConnect(self): - # Testing non-blocking connect - conn, addr = self.serv.accept() - conn.close() - - def _testConnect(self): - self.cli.settimeout(10) - self.cli.connect((HOST, self.port)) - def testRecv(self): # Testing non-blocking recv conn, addr = self.serv.accept() From webhook-mailer at python.org Fri Nov 30 09:03:05 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Fri, 30 Nov 2018 14:03:05 -0000 Subject: [Python-checkins] Fix signature of xml.dom.minidom.Document.toprettyxml(). (GH-10814) Message-ID: https://github.com/python/cpython/commit/b7c2182604d5796b5af4c837991aa0b8c8a2d41f commit: b7c2182604d5796b5af4c837991aa0b8c8a2d41f branch: master author: E Kawashima committer: Serhiy Storchaka date: 2018-11-30T16:03:00+02:00 summary: Fix signature of xml.dom.minidom.Document.toprettyxml(). (GH-10814) files: M Doc/library/xml.dom.minidom.rst diff --git a/Doc/library/xml.dom.minidom.rst b/Doc/library/xml.dom.minidom.rst index a1f334d4178e..42340802f193 100644 --- a/Doc/library/xml.dom.minidom.rst +++ b/Doc/library/xml.dom.minidom.rst @@ -163,7 +163,7 @@ module documentation. This section lists the differences between the API and The :meth:`toxml` method now preserves the attribute order specified by the user. -.. method:: Node.toprettyxml(indent="", newl="", encoding="") +.. method:: Node.toprettyxml(indent="\t", newl="\n", encoding=None) Return a pretty-printed version of the document. *indent* specifies the indentation string and defaults to a tabulator; *newl* specifies the string From webhook-mailer at python.org Fri Nov 30 09:03:56 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 30 Nov 2018 14:03:56 -0000 Subject: [Python-checkins] Fix compiler warning in call_readline() (GH-10820) Message-ID: https://github.com/python/cpython/commit/1600f60414e620c4298c15dac803427d8f0a977c commit: 1600f60414e620c4298c15dac803427d8f0a977c branch: master author: Victor Stinner committer: GitHub date: 2018-11-30T15:03:53+01:00 summary: Fix compiler warning in call_readline() (GH-10820) Replace strncpy() with memcpy() in call_readline() to fix the following warning, the NUL byte is written manually just after: Modules/readline.c: In function ?call_readline?: Modules/readline.c:1303:9: warning: ?strncpy? output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation] strncpy(p, q, n); ^~~~~~~~~~~~~~~~ Modules/readline.c:1279:9: note: length computed here n = strlen(p); ^~~~~~~~~ files: M Modules/readline.c diff --git a/Modules/readline.c b/Modules/readline.c index 7756e6b2bc75..7f366aabfb4f 100644 --- a/Modules/readline.c +++ b/Modules/readline.c @@ -1240,7 +1240,7 @@ static char * call_readline(FILE *sys_stdin, FILE *sys_stdout, const char *prompt) { size_t n; - char *p, *q; + char *p; int signal; #ifdef SAVE_LOCALE @@ -1297,10 +1297,10 @@ call_readline(FILE *sys_stdin, FILE *sys_stdout, const char *prompt) } /* Copy the malloc'ed buffer into a PyMem_Malloc'ed one and release the original. */ - q = p; + char *q = p; p = PyMem_RawMalloc(n+2); if (p != NULL) { - strncpy(p, q, n); + memcpy(p, q, n); p[n] = '\n'; p[n+1] = '\0'; } From webhook-mailer at python.org Fri Nov 30 10:14:36 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 30 Nov 2018 15:14:36 -0000 Subject: [Python-checkins] bpo-33015: Fix UB in pthread PyThread_start_new_thread (GH-6008) Message-ID: https://github.com/python/cpython/commit/9eea6eaf23067880f4af3a130e3f67c9812e2f30 commit: 9eea6eaf23067880f4af3a130e3f67c9812e2f30 branch: master author: Siddhesh Poyarekar committer: Victor Stinner date: 2018-11-30T16:14:25+01:00 summary: bpo-33015: Fix UB in pthread PyThread_start_new_thread (GH-6008) Fix an undefined behaviour in the pthread implementation of PyThread_start_new_thread(): add a function wrapper to always return NULL. Add pythread_callback struct and pythread_wrapper() to thread_pthread.h. files: A Misc/NEWS.d/next/Build/2018-08-24-09-48-25.bpo-33015.s21y74.rst M Python/thread_pthread.h diff --git a/Misc/NEWS.d/next/Build/2018-08-24-09-48-25.bpo-33015.s21y74.rst b/Misc/NEWS.d/next/Build/2018-08-24-09-48-25.bpo-33015.s21y74.rst new file mode 100644 index 000000000000..8c5a0c91a46b --- /dev/null +++ b/Misc/NEWS.d/next/Build/2018-08-24-09-48-25.bpo-33015.s21y74.rst @@ -0,0 +1,3 @@ +Fix an undefined behaviour in the pthread implementation of +:c:func:`PyThread_start_new_thread`: add a function wrapper to always return +``NULL``. diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h index 6da8b3a44734..09e53a14aa47 100644 --- a/Python/thread_pthread.h +++ b/Python/thread_pthread.h @@ -152,6 +152,28 @@ PyThread__init_thread(void) * Thread support. */ +/* bpo-33015: pythread_callback struct and pythread_wrapper() cast + "void func(void *)" to "void* func(void *)": always return NULL. + + PyThread_start_new_thread() uses "void func(void *)" type, whereas + pthread_create() requires a void* return value. */ +typedef struct { + void (*func) (void *); + void *arg; +} pythread_callback; + +static void * +pythread_wrapper(void *arg) +{ + /* copy func and func_arg and free the temporary structure */ + pythread_callback *callback = arg; + void (*func)(void *) = callback->func; + void *func_arg = callback->arg; + PyMem_RawFree(arg); + + func(func_arg); + return NULL; +} unsigned long PyThread_start_new_thread(void (*func)(void *), void *arg) @@ -188,21 +210,31 @@ PyThread_start_new_thread(void (*func)(void *), void *arg) pthread_attr_setscope(&attrs, PTHREAD_SCOPE_SYSTEM); #endif + pythread_callback *callback = PyMem_RawMalloc(sizeof(pythread_callback)); + + if (callback == NULL) { + return PYTHREAD_INVALID_THREAD_ID; + } + + callback->func = func; + callback->arg = arg; + status = pthread_create(&th, #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED) &attrs, #else (pthread_attr_t*)NULL, #endif - (void* (*)(void *))func, - (void *)arg - ); + pythread_wrapper, callback); #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED) pthread_attr_destroy(&attrs); #endif - if (status != 0) + + if (status != 0) { + PyMem_RawFree(callback); return PYTHREAD_INVALID_THREAD_ID; + } pthread_detach(th); From webhook-mailer at python.org Fri Nov 30 10:32:16 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 30 Nov 2018 15:32:16 -0000 Subject: [Python-checkins] bpo-33015: Fix UB in pthread PyThread_start_new_thread (GH-6008) Message-ID: https://github.com/python/cpython/commit/b1355352d14a0a67107aba7ec6f233336f17716a commit: b1355352d14a0a67107aba7ec6f233336f17716a branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-11-30T07:32:12-08:00 summary: bpo-33015: Fix UB in pthread PyThread_start_new_thread (GH-6008) Fix an undefined behaviour in the pthread implementation of PyThread_start_new_thread(): add a function wrapper to always return NULL. Add pythread_callback struct and pythread_wrapper() to thread_pthread.h. (cherry picked from commit 9eea6eaf23067880f4af3a130e3f67c9812e2f30) Co-authored-by: Siddhesh Poyarekar files: A Misc/NEWS.d/next/Build/2018-08-24-09-48-25.bpo-33015.s21y74.rst M Python/thread_pthread.h diff --git a/Misc/NEWS.d/next/Build/2018-08-24-09-48-25.bpo-33015.s21y74.rst b/Misc/NEWS.d/next/Build/2018-08-24-09-48-25.bpo-33015.s21y74.rst new file mode 100644 index 000000000000..8c5a0c91a46b --- /dev/null +++ b/Misc/NEWS.d/next/Build/2018-08-24-09-48-25.bpo-33015.s21y74.rst @@ -0,0 +1,3 @@ +Fix an undefined behaviour in the pthread implementation of +:c:func:`PyThread_start_new_thread`: add a function wrapper to always return +``NULL``. diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h index 697140558fdc..f79f9b90a671 100644 --- a/Python/thread_pthread.h +++ b/Python/thread_pthread.h @@ -152,6 +152,28 @@ PyThread__init_thread(void) * Thread support. */ +/* bpo-33015: pythread_callback struct and pythread_wrapper() cast + "void func(void *)" to "void* func(void *)": always return NULL. + + PyThread_start_new_thread() uses "void func(void *)" type, whereas + pthread_create() requires a void* return value. */ +typedef struct { + void (*func) (void *); + void *arg; +} pythread_callback; + +static void * +pythread_wrapper(void *arg) +{ + /* copy func and func_arg and free the temporary structure */ + pythread_callback *callback = arg; + void (*func)(void *) = callback->func; + void *func_arg = callback->arg; + PyMem_RawFree(arg); + + func(func_arg); + return NULL; +} unsigned long PyThread_start_new_thread(void (*func)(void *), void *arg) @@ -188,21 +210,31 @@ PyThread_start_new_thread(void (*func)(void *), void *arg) pthread_attr_setscope(&attrs, PTHREAD_SCOPE_SYSTEM); #endif + pythread_callback *callback = PyMem_RawMalloc(sizeof(pythread_callback)); + + if (callback == NULL) { + return PYTHREAD_INVALID_THREAD_ID; + } + + callback->func = func; + callback->arg = arg; + status = pthread_create(&th, #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED) &attrs, #else (pthread_attr_t*)NULL, #endif - (void* (*)(void *))func, - (void *)arg - ); + pythread_wrapper, callback); #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED) pthread_attr_destroy(&attrs); #endif - if (status != 0) + + if (status != 0) { + PyMem_RawFree(callback); return PYTHREAD_INVALID_THREAD_ID; + } pthread_detach(th); From webhook-mailer at python.org Fri Nov 30 11:04:39 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 30 Nov 2018 16:04:39 -0000 Subject: [Python-checkins] bpo-33015: Fix UB in pthread PyThread_start_new_thread (GH-6008) (GH-10823) Message-ID: https://github.com/python/cpython/commit/8f83c2fb19c45350c2161d9e75dab4cd2bcaee28 commit: 8f83c2fb19c45350c2161d9e75dab4cd2bcaee28 branch: 2.7 author: Victor Stinner committer: GitHub date: 2018-11-30T17:04:35+01:00 summary: bpo-33015: Fix UB in pthread PyThread_start_new_thread (GH-6008) (GH-10823) Fix an undefined behaviour in the pthread implementation of PyThread_start_new_thread(): add a function wrapper to always return NULL. Add pythread_callback struct and pythread_wrapper() to thread_pthread.h. (cherry picked from commit 9eea6eaf23067880f4af3a130e3f67c9812e2f30) files: A Misc/NEWS.d/next/Build/2018-08-24-09-48-25.bpo-33015.s21y74.rst M Python/thread_pthread.h diff --git a/Misc/NEWS.d/next/Build/2018-08-24-09-48-25.bpo-33015.s21y74.rst b/Misc/NEWS.d/next/Build/2018-08-24-09-48-25.bpo-33015.s21y74.rst new file mode 100644 index 000000000000..8c5a0c91a46b --- /dev/null +++ b/Misc/NEWS.d/next/Build/2018-08-24-09-48-25.bpo-33015.s21y74.rst @@ -0,0 +1,3 @@ +Fix an undefined behaviour in the pthread implementation of +:c:func:`PyThread_start_new_thread`: add a function wrapper to always return +``NULL``. diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h index 79c66d4f32c5..ae6b6b683904 100644 --- a/Python/thread_pthread.h +++ b/Python/thread_pthread.h @@ -156,6 +156,28 @@ PyThread__init_thread(void) * Thread support. */ +/* bpo-33015: pythread_callback struct and pythread_wrapper() cast + "void func(void *)" to "void* func(void *)": always return NULL. + + PyThread_start_new_thread() uses "void func(void *)" type, whereas + pthread_create() requires a void* return value. */ +typedef struct { + void (*func) (void *); + void *arg; +} pythread_callback; + +static void * +pythread_wrapper(void *arg) +{ + /* copy func and func_arg and free the temporary structure */ + pythread_callback *callback = arg; + void (*func)(void *) = callback->func; + void *func_arg = callback->arg; + PyMem_Free(arg); + + func(func_arg); + return NULL; +} long PyThread_start_new_thread(void (*func)(void *), void *arg) @@ -191,21 +213,31 @@ PyThread_start_new_thread(void (*func)(void *), void *arg) pthread_attr_setscope(&attrs, PTHREAD_SCOPE_SYSTEM); #endif + pythread_callback *callback = PyMem_Malloc(sizeof(pythread_callback)); + + if (callback == NULL) { + return -1; + } + + callback->func = func; + callback->arg = arg; + status = pthread_create(&th, #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED) &attrs, #else (pthread_attr_t*)NULL, #endif - (void* (*)(void *))func, - (void *)arg - ); + pythread_wrapper, callback); #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED) pthread_attr_destroy(&attrs); #endif - if (status != 0) + + if (status != 0) { + PyMem_Free(callback); return -1; + } pthread_detach(th); From webhook-mailer at python.org Fri Nov 30 11:04:48 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 30 Nov 2018 16:04:48 -0000 Subject: [Python-checkins] bpo-33015: Fix UB in pthread PyThread_start_new_thread (GH-6008) (GH-10822) Message-ID: https://github.com/python/cpython/commit/03b1200dfd03061e9ad0bff8199967bd80b9b900 commit: 03b1200dfd03061e9ad0bff8199967bd80b9b900 branch: 3.6 author: Victor Stinner committer: GitHub date: 2018-11-30T17:04:46+01:00 summary: bpo-33015: Fix UB in pthread PyThread_start_new_thread (GH-6008) (GH-10822) Fix an undefined behaviour in the pthread implementation of PyThread_start_new_thread(): add a function wrapper to always return NULL. Add pythread_callback struct and pythread_wrapper() to thread_pthread.h. (cherry picked from commit 9eea6eaf23067880f4af3a130e3f67c9812e2f30) files: A Misc/NEWS.d/next/Build/2018-08-24-09-48-25.bpo-33015.s21y74.rst M Python/thread_pthread.h diff --git a/Misc/NEWS.d/next/Build/2018-08-24-09-48-25.bpo-33015.s21y74.rst b/Misc/NEWS.d/next/Build/2018-08-24-09-48-25.bpo-33015.s21y74.rst new file mode 100644 index 000000000000..8c5a0c91a46b --- /dev/null +++ b/Misc/NEWS.d/next/Build/2018-08-24-09-48-25.bpo-33015.s21y74.rst @@ -0,0 +1,3 @@ +Fix an undefined behaviour in the pthread implementation of +:c:func:`PyThread_start_new_thread`: add a function wrapper to always return +``NULL``. diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h index 3607341eaa58..baea71f9c33e 100644 --- a/Python/thread_pthread.h +++ b/Python/thread_pthread.h @@ -183,6 +183,28 @@ PyThread__init_thread(void) * Thread support. */ +/* bpo-33015: pythread_callback struct and pythread_wrapper() cast + "void func(void *)" to "void* func(void *)": always return NULL. + + PyThread_start_new_thread() uses "void func(void *)" type, whereas + pthread_create() requires a void* return value. */ +typedef struct { + void (*func) (void *); + void *arg; +} pythread_callback; + +static void * +pythread_wrapper(void *arg) +{ + /* copy func and func_arg and free the temporary structure */ + pythread_callback *callback = arg; + void (*func)(void *) = callback->func; + void *func_arg = callback->arg; + PyMem_RawFree(arg); + + func(func_arg); + return NULL; +} long PyThread_start_new_thread(void (*func)(void *), void *arg) @@ -218,21 +240,31 @@ PyThread_start_new_thread(void (*func)(void *), void *arg) pthread_attr_setscope(&attrs, PTHREAD_SCOPE_SYSTEM); #endif + pythread_callback *callback = PyMem_RawMalloc(sizeof(pythread_callback)); + + if (callback == NULL) { + return -1; + } + + callback->func = func; + callback->arg = arg; + status = pthread_create(&th, #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED) &attrs, #else (pthread_attr_t*)NULL, #endif - (void* (*)(void *))func, - (void *)arg - ); + pythread_wrapper, callback); #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED) pthread_attr_destroy(&attrs); #endif - if (status != 0) + + if (status != 0) { + PyMem_RawFree(callback); return -1; + } pthread_detach(th); From webhook-mailer at python.org Fri Nov 30 11:56:59 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 30 Nov 2018 16:56:59 -0000 Subject: [Python-checkins] bpo-35352: test_asyncio uses the certificate set from the test directory (GH-10826) Message-ID: https://github.com/python/cpython/commit/b062ba77b617b0f89b7ea25d14cc77c991462ad4 commit: b062ba77b617b0f89b7ea25d14cc77c991462ad4 branch: master author: stratakis committer: Victor Stinner date: 2018-11-30T17:56:56+01:00 summary: bpo-35352: test_asyncio uses the certificate set from the test directory (GH-10826) Modify asyncio tests to utilize the certificates from the test directory instead of its own set, as they are the same and with each update they had to be updated as well. files: A Misc/NEWS.d/next/Tests/2018-11-30-17-18-56.bpo-35352.8bD7GC.rst D Lib/test/test_asyncio/keycert3.pem D Lib/test/test_asyncio/pycacert.pem D Lib/test/test_asyncio/ssl_cert.pem D Lib/test/test_asyncio/ssl_key.pem M Lib/test/test_asyncio/utils.py diff --git a/Lib/test/test_asyncio/keycert3.pem b/Lib/test/test_asyncio/keycert3.pem deleted file mode 100644 index 5bfa62c4ca30..000000000000 --- a/Lib/test/test_asyncio/keycert3.pem +++ /dev/null @@ -1,73 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAMLgD0kAKDb5cFyP -jbwNfR5CtewdXC+kMXAWD8DLxiTTvhMW7qVnlwOm36mZlszHKvsRf05lT4pegiFM -9z2j1OlaN+ci/X7NU22TNN6crYSiN77FjYJP464j876ndSxyD+rzys386T+1r1aZ -aggEdkj1TsSsv1zWIYKlPIjlvhuxAgMBAAECgYA0aH+T2Vf3WOPv8KdkcJg6gCRe -yJKXOWgWRcicx/CUzOEsTxmFIDPLxqAWA3k7v0B+3vjGw5Y9lycV/5XqXNoQI14j -y09iNsumds13u5AKkGdTJnZhQ7UKdoVHfuP44ZdOv/rJ5/VD6F4zWywpe90pcbK+ -AWDVtusgGQBSieEl1QJBAOyVrUG5l2yoUBtd2zr/kiGm/DYyXlIthQO/A3/LngDW -5/ydGxVsT7lAVOgCsoT+0L4efTh90PjzW8LPQrPBWVMCQQDS3h/FtYYd5lfz+FNL -9CEe1F1w9l8P749uNUD0g317zv1tatIqVCsQWHfVHNdVvfQ+vSFw38OORO00Xqs9 -1GJrAkBkoXXEkxCZoy4PteheO/8IWWLGGr6L7di6MzFl1lIqwT6D8L9oaV2vynFT -DnKop0pa09Unhjyw57KMNmSE2SUJAkEArloTEzpgRmCq4IK2/NpCeGdHS5uqRlbh -1VIa/xGps7EWQl5Mn8swQDel/YP3WGHTjfx7pgSegQfkyaRtGpZ9OQJAa9Vumj8m -JAAtI0Bnga8hgQx7BhTQY4CadDxyiRGOGYhwUzYVCqkb2sbVRH9HnwUaJT7cWBY3 -RnJdHOMXWem7/w== ------END PRIVATE KEY----- -Certificate: - Data: - Version: 1 (0x0) - Serial Number: 12723342612721443281 (0xb09264b1f2da21d1) - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=XY, O=Python Software Foundation CA, CN=our-ca-server - Validity - Not Before: Jan 4 19:47:07 2013 GMT - Not After : Nov 13 19:47:07 2022 GMT - Subject: C=XY, L=Castle Anthrax, O=Python Software Foundation, CN=localhost - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - Public-Key: (1024 bit) - Modulus: - 00:c2:e0:0f:49:00:28:36:f9:70:5c:8f:8d:bc:0d: - 7d:1e:42:b5:ec:1d:5c:2f:a4:31:70:16:0f:c0:cb: - c6:24:d3:be:13:16:ee:a5:67:97:03:a6:df:a9:99: - 96:cc:c7:2a:fb:11:7f:4e:65:4f:8a:5e:82:21:4c: - f7:3d:a3:d4:e9:5a:37:e7:22:fd:7e:cd:53:6d:93: - 34:de:9c:ad:84:a2:37:be:c5:8d:82:4f:e3:ae:23: - f3:be:a7:75:2c:72:0f:ea:f3:ca:cd:fc:e9:3f:b5: - af:56:99:6a:08:04:76:48:f5:4e:c4:ac:bf:5c:d6: - 21:82:a5:3c:88:e5:be:1b:b1 - Exponent: 65537 (0x10001) - Signature Algorithm: sha1WithRSAEncryption - 2f:42:5f:a3:09:2c:fa:51:88:c7:37:7f:ea:0e:63:f0:a2:9a: - e5:5a:e2:c8:20:f0:3f:60:bc:c8:0f:b6:c6:76:ce:db:83:93: - f5:a3:33:67:01:8e:04:cd:00:9a:73:fd:f3:35:86:fa:d7:13: - e2:46:c6:9d:c0:29:53:d4:a9:90:b8:77:4b:e6:83:76:e4:92: - d6:9c:50:cf:43:d0:c6:01:77:61:9a:de:9b:70:f7:72:cd:59: - 00:31:69:d9:b4:ca:06:9c:6d:c3:c7:80:8c:68:e6:b5:a2:f8: - ef:1d:bb:16:9f:77:77:ef:87:62:22:9b:4d:69:a4:3a:1a:f1: - 21:5e:8c:32:ac:92:fd:15:6b:18:c2:7f:15:0d:98:30:ca:75: - 8f:1a:71:df:da:1d:b2:ef:9a:e8:2d:2e:02:fd:4a:3c:aa:96: - 0b:06:5d:35:b3:3d:24:87:4b:e0:b0:58:60:2f:45:ac:2e:48: - 8a:b0:99:10:65:27:ff:cc:b1:d8:fd:bd:26:6b:b9:0c:05:2a: - f4:45:63:35:51:07:ed:83:85:fe:6f:69:cb:bb:40:a8:ae:b6: - 3b:56:4a:2d:a4:ed:6d:11:2c:4d:ed:17:24:fd:47:bc:d3:41: - a2:d3:06:fe:0c:90:d8:d8:94:26:c4:ff:cc:a1:d8:42:77:eb: - fc:a9:94:71 ------BEGIN CERTIFICATE----- -MIICpDCCAYwCCQCwkmSx8toh0TANBgkqhkiG9w0BAQUFADBNMQswCQYDVQQGEwJY -WTEmMCQGA1UECgwdUHl0aG9uIFNvZnR3YXJlIEZvdW5kYXRpb24gQ0ExFjAUBgNV -BAMMDW91ci1jYS1zZXJ2ZXIwHhcNMTMwMTA0MTk0NzA3WhcNMjIxMTEzMTk0NzA3 -WjBfMQswCQYDVQQGEwJYWTEXMBUGA1UEBxMOQ2FzdGxlIEFudGhyYXgxIzAhBgNV -BAoTGlB5dGhvbiBTb2Z0d2FyZSBGb3VuZGF0aW9uMRIwEAYDVQQDEwlsb2NhbGhv -c3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMLgD0kAKDb5cFyPjbwNfR5C -tewdXC+kMXAWD8DLxiTTvhMW7qVnlwOm36mZlszHKvsRf05lT4pegiFM9z2j1Ola -N+ci/X7NU22TNN6crYSiN77FjYJP464j876ndSxyD+rzys386T+1r1aZaggEdkj1 -TsSsv1zWIYKlPIjlvhuxAgMBAAEwDQYJKoZIhvcNAQEFBQADggEBAC9CX6MJLPpR -iMc3f+oOY/CimuVa4sgg8D9gvMgPtsZ2ztuDk/WjM2cBjgTNAJpz/fM1hvrXE+JG -xp3AKVPUqZC4d0vmg3bkktacUM9D0MYBd2Ga3ptw93LNWQAxadm0ygacbcPHgIxo -5rWi+O8duxafd3fvh2Iim01ppDoa8SFejDKskv0VaxjCfxUNmDDKdY8acd/aHbLv -mugtLgL9SjyqlgsGXTWzPSSHS+CwWGAvRawuSIqwmRBlJ//Msdj9vSZruQwFKvRF -YzVRB+2Dhf5vacu7QKiutjtWSi2k7W0RLE3tFyT9R7zTQaLTBv4MkNjYlCbE/8yh -2EJ36/yplHE= ------END CERTIFICATE----- diff --git a/Lib/test/test_asyncio/pycacert.pem b/Lib/test/test_asyncio/pycacert.pem deleted file mode 100644 index 09b1f3e08aee..000000000000 --- a/Lib/test/test_asyncio/pycacert.pem +++ /dev/null @@ -1,78 +0,0 @@ -Certificate: - Data: - Version: 3 (0x2) - Serial Number: 12723342612721443280 (0xb09264b1f2da21d0) - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=XY, O=Python Software Foundation CA, CN=our-ca-server - Validity - Not Before: Jan 4 19:47:07 2013 GMT - Not After : Jan 2 19:47:07 2023 GMT - Subject: C=XY, O=Python Software Foundation CA, CN=our-ca-server - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - Public-Key: (2048 bit) - Modulus: - 00:e7:de:e9:e3:0c:9f:00:b6:a1:fd:2b:5b:96:d2: - 6f:cc:e0:be:86:b9:20:5e:ec:03:7a:55:ab:ea:a4: - e9:f9:49:85:d2:66:d5:ed:c7:7a:ea:56:8e:2d:8f: - e7:42:e2:62:28:a9:9f:d6:1b:8e:eb:b5:b4:9c:9f: - 14:ab:df:e6:94:8b:76:1d:3e:6d:24:61:ed:0c:bf: - 00:8a:61:0c:df:5c:c8:36:73:16:00:cd:47:ba:6d: - a4:a4:74:88:83:23:0a:19:fc:09:a7:3c:4a:4b:d3: - e7:1d:2d:e4:ea:4c:54:21:f3:26:db:89:37:18:d4: - 02:bb:40:32:5f:a4:ff:2d:1c:f7:d4:bb:ec:8e:cf: - 5c:82:ac:e6:7c:08:6c:48:85:61:07:7f:25:e0:5c: - e0:bc:34:5f:e0:b9:04:47:75:c8:47:0b:8d:bc:d6: - c8:68:5f:33:83:62:d2:20:44:35:b1:ad:81:1a:8a: - cd:bc:35:b0:5c:8b:47:d6:18:e9:9c:18:97:cc:01: - 3c:29:cc:e8:1e:e4:e4:c1:b8:de:e7:c2:11:18:87: - 5a:93:34:d8:a6:25:f7:14:71:eb:e4:21:a2:d2:0f: - 2e:2e:d4:62:00:35:d3:d6:ef:5c:60:4b:4c:a9:14: - e2:dd:15:58:46:37:33:26:b7:e7:2e:5d:ed:42:e4: - c5:4d - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Subject Key Identifier: - BC:DD:62:D9:76:DA:1B:D2:54:6B:CF:E0:66:9B:1E:1E:7B:56:0C:0B - X509v3 Authority Key Identifier: - keyid:BC:DD:62:D9:76:DA:1B:D2:54:6B:CF:E0:66:9B:1E:1E:7B:56:0C:0B - - X509v3 Basic Constraints: - CA:TRUE - Signature Algorithm: sha1WithRSAEncryption - 7d:0a:f5:cb:8d:d3:5d:bd:99:8e:f8:2b:0f:ba:eb:c2:d9:a6: - 27:4f:2e:7b:2f:0e:64:d8:1c:35:50:4e:ee:fc:90:b9:8d:6d: - a8:c5:c6:06:b0:af:f3:2d:bf:3b:b8:42:07:dd:18:7d:6d:95: - 54:57:85:18:60:47:2f:eb:78:1b:f9:e8:17:fd:5a:0d:87:17: - 28:ac:4c:6a:e6:bc:29:f4:f4:55:70:29:42:de:85:ea:ab:6c: - 23:06:64:30:75:02:8e:53:bc:5e:01:33:37:cc:1e:cd:b8:a4: - fd:ca:e4:5f:65:3b:83:1c:86:f1:55:02:a0:3a:8f:db:91:b7: - 40:14:b4:e7:8d:d2:ee:73:ba:e3:e5:34:2d:bc:94:6f:4e:24: - 06:f7:5f:8b:0e:a7:8e:6b:de:5e:75:f4:32:9a:50:b1:44:33: - 9a:d0:05:e2:78:82:ff:db:da:8a:63:eb:a9:dd:d1:bf:a0:61: - ad:e3:9e:8a:24:5d:62:0e:e7:4c:91:7f:ef:df:34:36:3b:2f: - 5d:f5:84:b2:2f:c4:6d:93:96:1a:6f:30:28:f1:da:12:9a:64: - b4:40:33:1d:bd:de:2b:53:a8:ea:be:d6:bc:4e:96:f5:44:fb: - 32:18:ae:d5:1f:f6:69:af:b6:4e:7b:1d:58:ec:3b:a9:53:a3: - 5e:58:c8:9e ------BEGIN CERTIFICATE----- -MIIDbTCCAlWgAwIBAgIJALCSZLHy2iHQMA0GCSqGSIb3DQEBBQUAME0xCzAJBgNV -BAYTAlhZMSYwJAYDVQQKDB1QeXRob24gU29mdHdhcmUgRm91bmRhdGlvbiBDQTEW -MBQGA1UEAwwNb3VyLWNhLXNlcnZlcjAeFw0xMzAxMDQxOTQ3MDdaFw0yMzAxMDIx -OTQ3MDdaME0xCzAJBgNVBAYTAlhZMSYwJAYDVQQKDB1QeXRob24gU29mdHdhcmUg -Rm91bmRhdGlvbiBDQTEWMBQGA1UEAwwNb3VyLWNhLXNlcnZlcjCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBAOfe6eMMnwC2of0rW5bSb8zgvoa5IF7sA3pV -q+qk6flJhdJm1e3HeupWji2P50LiYiipn9Ybjuu1tJyfFKvf5pSLdh0+bSRh7Qy/ -AIphDN9cyDZzFgDNR7ptpKR0iIMjChn8Cac8SkvT5x0t5OpMVCHzJtuJNxjUArtA -Ml+k/y0c99S77I7PXIKs5nwIbEiFYQd/JeBc4Lw0X+C5BEd1yEcLjbzWyGhfM4Ni -0iBENbGtgRqKzbw1sFyLR9YY6ZwYl8wBPCnM6B7k5MG43ufCERiHWpM02KYl9xRx -6+QhotIPLi7UYgA109bvXGBLTKkU4t0VWEY3Mya35y5d7ULkxU0CAwEAAaNQME4w -HQYDVR0OBBYEFLzdYtl22hvSVGvP4GabHh57VgwLMB8GA1UdIwQYMBaAFLzdYtl2 -2hvSVGvP4GabHh57VgwLMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEB -AH0K9cuN0129mY74Kw+668LZpidPLnsvDmTYHDVQTu78kLmNbajFxgawr/Mtvzu4 -QgfdGH1tlVRXhRhgRy/reBv56Bf9Wg2HFyisTGrmvCn09FVwKULeheqrbCMGZDB1 -Ao5TvF4BMzfMHs24pP3K5F9lO4MchvFVAqA6j9uRt0AUtOeN0u5zuuPlNC28lG9O -JAb3X4sOp45r3l519DKaULFEM5rQBeJ4gv/b2opj66nd0b+gYa3jnookXWIO50yR -f+/fNDY7L131hLIvxG2TlhpvMCjx2hKaZLRAMx293itTqOq+1rxOlvVE+zIYrtUf -9mmvtk57HVjsO6lTo15YyJ4= ------END CERTIFICATE----- diff --git a/Lib/test/test_asyncio/ssl_cert.pem b/Lib/test/test_asyncio/ssl_cert.pem deleted file mode 100644 index 47a7d7e37e80..000000000000 --- a/Lib/test/test_asyncio/ssl_cert.pem +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICVDCCAb2gAwIBAgIJANfHOBkZr8JOMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV -BAYTAlhZMRcwFQYDVQQHEw5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9u -IFNvZnR3YXJlIEZvdW5kYXRpb24xEjAQBgNVBAMTCWxvY2FsaG9zdDAeFw0xMDEw -MDgyMzAxNTZaFw0yMDEwMDUyMzAxNTZaMF8xCzAJBgNVBAYTAlhZMRcwFQYDVQQH -Ew5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9uIFNvZnR3YXJlIEZvdW5k -YXRpb24xEjAQBgNVBAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAw -gYkCgYEA21vT5isq7F68amYuuNpSFlKDPrMUCa4YWYqZRt2OZ+/3NKaZ2xAiSwr7 -6MrQF70t5nLbSPpqE5+5VrS58SY+g/sXLiFd6AplH1wJZwh78DofbFYXUggktFMt -pTyiX8jtP66bkcPkDADA089RI1TQR6Ca+n7HFa7c1fabVV6i3zkCAwEAAaMYMBYw -FAYDVR0RBA0wC4IJbG9jYWxob3N0MA0GCSqGSIb3DQEBBQUAA4GBAHPctQBEQ4wd -BJ6+JcpIraopLn8BGhbjNWj40mmRqWB/NAWF6M5ne7KpGAu7tLeG4hb1zLaldK8G -lxy2GPSRF6LFS48dpEj2HbMv2nvv6xxalDMJ9+DicWgAKTQ6bcX2j3GUkCR0g/T1 -CRlNBAAlvhKzO7Clpf9l0YKBEfraJByX ------END CERTIFICATE----- diff --git a/Lib/test/test_asyncio/ssl_key.pem b/Lib/test/test_asyncio/ssl_key.pem deleted file mode 100644 index 3fd3bbd54a34..000000000000 --- a/Lib/test/test_asyncio/ssl_key.pem +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBANtb0+YrKuxevGpm -LrjaUhZSgz6zFAmuGFmKmUbdjmfv9zSmmdsQIksK++jK0Be9LeZy20j6ahOfuVa0 -ufEmPoP7Fy4hXegKZR9cCWcIe/A6H2xWF1IIJLRTLaU8ol/I7T+um5HD5AwAwNPP -USNU0Eegmvp+xxWu3NX2m1Veot85AgMBAAECgYA3ZdZ673X0oexFlq7AAmrutkHt -CL7LvwrpOiaBjhyTxTeSNWzvtQBkIU8DOI0bIazA4UreAFffwtvEuPmonDb3F+Iq -SMAu42XcGyVZEl+gHlTPU9XRX7nTOXVt+MlRRRxL6t9GkGfUAXI3XxJDXW3c0vBK -UL9xqD8cORXOfE06rQJBAP8mEX1ERkR64Ptsoe4281vjTlNfIbs7NMPkUnrn9N/Y -BLhjNIfQ3HFZG8BTMLfX7kCS9D593DW5tV4Z9BP/c6cCQQDcFzCcVArNh2JSywOQ -ZfTfRbJg/Z5Lt9Fkngv1meeGNPgIMLN8Sg679pAOOWmzdMO3V706rNPzSVMME7E5 -oPIfAkEA8pDddarP5tCvTTgUpmTFbakm0KoTZm2+FzHcnA4jRh+XNTjTOv98Y6Ik -eO5d1ZnKXseWvkZncQgxfdnMqqpj5wJAcNq/RVne1DbYlwWchT2Si65MYmmJ8t+F -0mcsULqjOnEMwf5e+ptq5LzwbyrHZYq5FNk7ocufPv/ZQrcSSC+cFwJBAKvOJByS -x56qyGeZLOQlWS2JS3KJo59XuLFGqcbgN9Om9xFa41Yb4N9NvplFivsvZdw3m1Q/ -SPIXQuT8RMPDVNQ= ------END PRIVATE KEY----- diff --git a/Lib/test/test_asyncio/utils.py b/Lib/test/test_asyncio/utils.py index b9489d7e7458..7084edfeca93 100644 --- a/Lib/test/test_asyncio/utils.py +++ b/Lib/test/test_asyncio/utils.py @@ -40,7 +40,7 @@ def data_file(filename): fullname = os.path.join(support.TEST_HOME_DIR, filename) if os.path.isfile(fullname): return fullname - fullname = os.path.join(os.path.dirname(__file__), filename) + fullname = os.path.join(os.path.dirname(__file__), '..', filename) if os.path.isfile(fullname): return fullname raise FileNotFoundError(filename) @@ -160,8 +160,8 @@ def finish_request(self, request, client_address): if not os.path.isdir(here): here = os.path.join(os.path.dirname(os.__file__), 'test', 'test_asyncio') - keyfile = os.path.join(here, 'ssl_key.pem') - certfile = os.path.join(here, 'ssl_cert.pem') + keyfile = os.path.join(here, ONLYKEY) + certfile = os.path.join(here, ONLYCERT) context = ssl.SSLContext() context.load_cert_chain(certfile, keyfile) diff --git a/Misc/NEWS.d/next/Tests/2018-11-30-17-18-56.bpo-35352.8bD7GC.rst b/Misc/NEWS.d/next/Tests/2018-11-30-17-18-56.bpo-35352.8bD7GC.rst new file mode 100644 index 000000000000..e479e9612e72 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2018-11-30-17-18-56.bpo-35352.8bD7GC.rst @@ -0,0 +1 @@ +Modify test_asyncio to use the certificate set from the test directory. From webhook-mailer at python.org Fri Nov 30 12:08:05 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 30 Nov 2018 17:08:05 -0000 Subject: [Python-checkins] bpo-33015: Use malloc() in PyThread_start_new_thread() (GH-10829) Message-ID: https://github.com/python/cpython/commit/bc9f53f69e8207027bf2b18e3d01b30401e76ace commit: bc9f53f69e8207027bf2b18e3d01b30401e76ace branch: 2.7 author: Victor Stinner committer: GitHub date: 2018-11-30T18:08:02+01:00 summary: bpo-33015: Use malloc() in PyThread_start_new_thread() (GH-10829) The pthread implementation of PyThread_start_new_thread() now uses malloc/free rather than PyMem_Malloc/PyMem_Free, since the latters are not thread-safe. files: M Python/thread_pthread.h diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h index ae6b6b683904..6d4b3b389f82 100644 --- a/Python/thread_pthread.h +++ b/Python/thread_pthread.h @@ -173,7 +173,7 @@ pythread_wrapper(void *arg) pythread_callback *callback = arg; void (*func)(void *) = callback->func; void *func_arg = callback->arg; - PyMem_Free(arg); + free(arg); func(func_arg); return NULL; @@ -213,7 +213,7 @@ PyThread_start_new_thread(void (*func)(void *), void *arg) pthread_attr_setscope(&attrs, PTHREAD_SCOPE_SYSTEM); #endif - pythread_callback *callback = PyMem_Malloc(sizeof(pythread_callback)); + pythread_callback *callback = malloc(sizeof(pythread_callback)); if (callback == NULL) { return -1; @@ -235,7 +235,7 @@ PyThread_start_new_thread(void (*func)(void *), void *arg) #endif if (status != 0) { - PyMem_Free(callback); + free(callback); return -1; } From webhook-mailer at python.org Fri Nov 30 12:30:12 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 30 Nov 2018 17:30:12 -0000 Subject: [Python-checkins] bpo-35352: Cleanup test_asyncio/utils.py (GH-10831) Message-ID: https://github.com/python/cpython/commit/7212148c95947b0fdfcb0c8e37d4357287bdb4bd commit: 7212148c95947b0fdfcb0c8e37d4357287bdb4bd branch: master author: Victor Stinner committer: GitHub date: 2018-11-30T18:30:09+01:00 summary: bpo-35352: Cleanup test_asyncio/utils.py (GH-10831) 'here' variable is no longer needed. files: M Lib/test/test_asyncio/utils.py diff --git a/Lib/test/test_asyncio/utils.py b/Lib/test/test_asyncio/utils.py index 7084edfeca93..8b23b0175076 100644 --- a/Lib/test/test_asyncio/utils.py +++ b/Lib/test/test_asyncio/utils.py @@ -156,14 +156,8 @@ def finish_request(self, request, client_address): # contains the ssl key and certificate files) differs # between the stdlib and stand-alone asyncio. # Prefer our own if we can find it. - here = os.path.join(os.path.dirname(__file__), '..', 'tests') - if not os.path.isdir(here): - here = os.path.join(os.path.dirname(os.__file__), - 'test', 'test_asyncio') - keyfile = os.path.join(here, ONLYKEY) - certfile = os.path.join(here, ONLYCERT) context = ssl.SSLContext() - context.load_cert_chain(certfile, keyfile) + context.load_cert_chain(ONLYCERT, ONLYKEY) ssock = context.wrap_socket(request, server_side=True) try: From webhook-mailer at python.org Fri Nov 30 14:44:32 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 30 Nov 2018 19:44:32 -0000 Subject: [Python-checkins] [3.7] bpo-35352: test_asyncio uses the certificate set from the test directory (GH-10826) (GH-10834) Message-ID: https://github.com/python/cpython/commit/38bed786a219c65d5a51c7ef4ffd97e12653a095 commit: 38bed786a219c65d5a51c7ef4ffd97e12653a095 branch: 3.7 author: Victor Stinner committer: GitHub date: 2018-11-30T20:44:27+01:00 summary: [3.7] bpo-35352: test_asyncio uses the certificate set from the test directory (GH-10826) (GH-10834) * bpo-35352: test_asyncio uses the certificate set from the test directory (GH-10826) Modify asyncio tests to utilize the certificates from the test directory instead of its own set, as they are the same and with each update they had to be updated as well. (cherry picked from commit b062ba77b617b0f89b7ea25d14cc77c991462ad4) * bpo-35352: Cleanup test_asyncio/utils.py (GH-10831) 'here' variable is no longer needed. (cherry picked from commit 7212148c95947b0fdfcb0c8e37d4357287bdb4bd) files: A Misc/NEWS.d/next/Tests/2018-11-30-17-18-56.bpo-35352.8bD7GC.rst D Lib/test/test_asyncio/keycert3.pem D Lib/test/test_asyncio/pycacert.pem D Lib/test/test_asyncio/ssl_cert.pem D Lib/test/test_asyncio/ssl_key.pem M Lib/test/test_asyncio/utils.py diff --git a/Lib/test/test_asyncio/keycert3.pem b/Lib/test/test_asyncio/keycert3.pem deleted file mode 100644 index 5bfa62c4ca30..000000000000 --- a/Lib/test/test_asyncio/keycert3.pem +++ /dev/null @@ -1,73 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAMLgD0kAKDb5cFyP -jbwNfR5CtewdXC+kMXAWD8DLxiTTvhMW7qVnlwOm36mZlszHKvsRf05lT4pegiFM -9z2j1OlaN+ci/X7NU22TNN6crYSiN77FjYJP464j876ndSxyD+rzys386T+1r1aZ -aggEdkj1TsSsv1zWIYKlPIjlvhuxAgMBAAECgYA0aH+T2Vf3WOPv8KdkcJg6gCRe -yJKXOWgWRcicx/CUzOEsTxmFIDPLxqAWA3k7v0B+3vjGw5Y9lycV/5XqXNoQI14j -y09iNsumds13u5AKkGdTJnZhQ7UKdoVHfuP44ZdOv/rJ5/VD6F4zWywpe90pcbK+ -AWDVtusgGQBSieEl1QJBAOyVrUG5l2yoUBtd2zr/kiGm/DYyXlIthQO/A3/LngDW -5/ydGxVsT7lAVOgCsoT+0L4efTh90PjzW8LPQrPBWVMCQQDS3h/FtYYd5lfz+FNL -9CEe1F1w9l8P749uNUD0g317zv1tatIqVCsQWHfVHNdVvfQ+vSFw38OORO00Xqs9 -1GJrAkBkoXXEkxCZoy4PteheO/8IWWLGGr6L7di6MzFl1lIqwT6D8L9oaV2vynFT -DnKop0pa09Unhjyw57KMNmSE2SUJAkEArloTEzpgRmCq4IK2/NpCeGdHS5uqRlbh -1VIa/xGps7EWQl5Mn8swQDel/YP3WGHTjfx7pgSegQfkyaRtGpZ9OQJAa9Vumj8m -JAAtI0Bnga8hgQx7BhTQY4CadDxyiRGOGYhwUzYVCqkb2sbVRH9HnwUaJT7cWBY3 -RnJdHOMXWem7/w== ------END PRIVATE KEY----- -Certificate: - Data: - Version: 1 (0x0) - Serial Number: 12723342612721443281 (0xb09264b1f2da21d1) - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=XY, O=Python Software Foundation CA, CN=our-ca-server - Validity - Not Before: Jan 4 19:47:07 2013 GMT - Not After : Nov 13 19:47:07 2022 GMT - Subject: C=XY, L=Castle Anthrax, O=Python Software Foundation, CN=localhost - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - Public-Key: (1024 bit) - Modulus: - 00:c2:e0:0f:49:00:28:36:f9:70:5c:8f:8d:bc:0d: - 7d:1e:42:b5:ec:1d:5c:2f:a4:31:70:16:0f:c0:cb: - c6:24:d3:be:13:16:ee:a5:67:97:03:a6:df:a9:99: - 96:cc:c7:2a:fb:11:7f:4e:65:4f:8a:5e:82:21:4c: - f7:3d:a3:d4:e9:5a:37:e7:22:fd:7e:cd:53:6d:93: - 34:de:9c:ad:84:a2:37:be:c5:8d:82:4f:e3:ae:23: - f3:be:a7:75:2c:72:0f:ea:f3:ca:cd:fc:e9:3f:b5: - af:56:99:6a:08:04:76:48:f5:4e:c4:ac:bf:5c:d6: - 21:82:a5:3c:88:e5:be:1b:b1 - Exponent: 65537 (0x10001) - Signature Algorithm: sha1WithRSAEncryption - 2f:42:5f:a3:09:2c:fa:51:88:c7:37:7f:ea:0e:63:f0:a2:9a: - e5:5a:e2:c8:20:f0:3f:60:bc:c8:0f:b6:c6:76:ce:db:83:93: - f5:a3:33:67:01:8e:04:cd:00:9a:73:fd:f3:35:86:fa:d7:13: - e2:46:c6:9d:c0:29:53:d4:a9:90:b8:77:4b:e6:83:76:e4:92: - d6:9c:50:cf:43:d0:c6:01:77:61:9a:de:9b:70:f7:72:cd:59: - 00:31:69:d9:b4:ca:06:9c:6d:c3:c7:80:8c:68:e6:b5:a2:f8: - ef:1d:bb:16:9f:77:77:ef:87:62:22:9b:4d:69:a4:3a:1a:f1: - 21:5e:8c:32:ac:92:fd:15:6b:18:c2:7f:15:0d:98:30:ca:75: - 8f:1a:71:df:da:1d:b2:ef:9a:e8:2d:2e:02:fd:4a:3c:aa:96: - 0b:06:5d:35:b3:3d:24:87:4b:e0:b0:58:60:2f:45:ac:2e:48: - 8a:b0:99:10:65:27:ff:cc:b1:d8:fd:bd:26:6b:b9:0c:05:2a: - f4:45:63:35:51:07:ed:83:85:fe:6f:69:cb:bb:40:a8:ae:b6: - 3b:56:4a:2d:a4:ed:6d:11:2c:4d:ed:17:24:fd:47:bc:d3:41: - a2:d3:06:fe:0c:90:d8:d8:94:26:c4:ff:cc:a1:d8:42:77:eb: - fc:a9:94:71 ------BEGIN CERTIFICATE----- -MIICpDCCAYwCCQCwkmSx8toh0TANBgkqhkiG9w0BAQUFADBNMQswCQYDVQQGEwJY -WTEmMCQGA1UECgwdUHl0aG9uIFNvZnR3YXJlIEZvdW5kYXRpb24gQ0ExFjAUBgNV -BAMMDW91ci1jYS1zZXJ2ZXIwHhcNMTMwMTA0MTk0NzA3WhcNMjIxMTEzMTk0NzA3 -WjBfMQswCQYDVQQGEwJYWTEXMBUGA1UEBxMOQ2FzdGxlIEFudGhyYXgxIzAhBgNV -BAoTGlB5dGhvbiBTb2Z0d2FyZSBGb3VuZGF0aW9uMRIwEAYDVQQDEwlsb2NhbGhv -c3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMLgD0kAKDb5cFyPjbwNfR5C -tewdXC+kMXAWD8DLxiTTvhMW7qVnlwOm36mZlszHKvsRf05lT4pegiFM9z2j1Ola -N+ci/X7NU22TNN6crYSiN77FjYJP464j876ndSxyD+rzys386T+1r1aZaggEdkj1 -TsSsv1zWIYKlPIjlvhuxAgMBAAEwDQYJKoZIhvcNAQEFBQADggEBAC9CX6MJLPpR -iMc3f+oOY/CimuVa4sgg8D9gvMgPtsZ2ztuDk/WjM2cBjgTNAJpz/fM1hvrXE+JG -xp3AKVPUqZC4d0vmg3bkktacUM9D0MYBd2Ga3ptw93LNWQAxadm0ygacbcPHgIxo -5rWi+O8duxafd3fvh2Iim01ppDoa8SFejDKskv0VaxjCfxUNmDDKdY8acd/aHbLv -mugtLgL9SjyqlgsGXTWzPSSHS+CwWGAvRawuSIqwmRBlJ//Msdj9vSZruQwFKvRF -YzVRB+2Dhf5vacu7QKiutjtWSi2k7W0RLE3tFyT9R7zTQaLTBv4MkNjYlCbE/8yh -2EJ36/yplHE= ------END CERTIFICATE----- diff --git a/Lib/test/test_asyncio/pycacert.pem b/Lib/test/test_asyncio/pycacert.pem deleted file mode 100644 index 09b1f3e08aee..000000000000 --- a/Lib/test/test_asyncio/pycacert.pem +++ /dev/null @@ -1,78 +0,0 @@ -Certificate: - Data: - Version: 3 (0x2) - Serial Number: 12723342612721443280 (0xb09264b1f2da21d0) - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=XY, O=Python Software Foundation CA, CN=our-ca-server - Validity - Not Before: Jan 4 19:47:07 2013 GMT - Not After : Jan 2 19:47:07 2023 GMT - Subject: C=XY, O=Python Software Foundation CA, CN=our-ca-server - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - Public-Key: (2048 bit) - Modulus: - 00:e7:de:e9:e3:0c:9f:00:b6:a1:fd:2b:5b:96:d2: - 6f:cc:e0:be:86:b9:20:5e:ec:03:7a:55:ab:ea:a4: - e9:f9:49:85:d2:66:d5:ed:c7:7a:ea:56:8e:2d:8f: - e7:42:e2:62:28:a9:9f:d6:1b:8e:eb:b5:b4:9c:9f: - 14:ab:df:e6:94:8b:76:1d:3e:6d:24:61:ed:0c:bf: - 00:8a:61:0c:df:5c:c8:36:73:16:00:cd:47:ba:6d: - a4:a4:74:88:83:23:0a:19:fc:09:a7:3c:4a:4b:d3: - e7:1d:2d:e4:ea:4c:54:21:f3:26:db:89:37:18:d4: - 02:bb:40:32:5f:a4:ff:2d:1c:f7:d4:bb:ec:8e:cf: - 5c:82:ac:e6:7c:08:6c:48:85:61:07:7f:25:e0:5c: - e0:bc:34:5f:e0:b9:04:47:75:c8:47:0b:8d:bc:d6: - c8:68:5f:33:83:62:d2:20:44:35:b1:ad:81:1a:8a: - cd:bc:35:b0:5c:8b:47:d6:18:e9:9c:18:97:cc:01: - 3c:29:cc:e8:1e:e4:e4:c1:b8:de:e7:c2:11:18:87: - 5a:93:34:d8:a6:25:f7:14:71:eb:e4:21:a2:d2:0f: - 2e:2e:d4:62:00:35:d3:d6:ef:5c:60:4b:4c:a9:14: - e2:dd:15:58:46:37:33:26:b7:e7:2e:5d:ed:42:e4: - c5:4d - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Subject Key Identifier: - BC:DD:62:D9:76:DA:1B:D2:54:6B:CF:E0:66:9B:1E:1E:7B:56:0C:0B - X509v3 Authority Key Identifier: - keyid:BC:DD:62:D9:76:DA:1B:D2:54:6B:CF:E0:66:9B:1E:1E:7B:56:0C:0B - - X509v3 Basic Constraints: - CA:TRUE - Signature Algorithm: sha1WithRSAEncryption - 7d:0a:f5:cb:8d:d3:5d:bd:99:8e:f8:2b:0f:ba:eb:c2:d9:a6: - 27:4f:2e:7b:2f:0e:64:d8:1c:35:50:4e:ee:fc:90:b9:8d:6d: - a8:c5:c6:06:b0:af:f3:2d:bf:3b:b8:42:07:dd:18:7d:6d:95: - 54:57:85:18:60:47:2f:eb:78:1b:f9:e8:17:fd:5a:0d:87:17: - 28:ac:4c:6a:e6:bc:29:f4:f4:55:70:29:42:de:85:ea:ab:6c: - 23:06:64:30:75:02:8e:53:bc:5e:01:33:37:cc:1e:cd:b8:a4: - fd:ca:e4:5f:65:3b:83:1c:86:f1:55:02:a0:3a:8f:db:91:b7: - 40:14:b4:e7:8d:d2:ee:73:ba:e3:e5:34:2d:bc:94:6f:4e:24: - 06:f7:5f:8b:0e:a7:8e:6b:de:5e:75:f4:32:9a:50:b1:44:33: - 9a:d0:05:e2:78:82:ff:db:da:8a:63:eb:a9:dd:d1:bf:a0:61: - ad:e3:9e:8a:24:5d:62:0e:e7:4c:91:7f:ef:df:34:36:3b:2f: - 5d:f5:84:b2:2f:c4:6d:93:96:1a:6f:30:28:f1:da:12:9a:64: - b4:40:33:1d:bd:de:2b:53:a8:ea:be:d6:bc:4e:96:f5:44:fb: - 32:18:ae:d5:1f:f6:69:af:b6:4e:7b:1d:58:ec:3b:a9:53:a3: - 5e:58:c8:9e ------BEGIN CERTIFICATE----- -MIIDbTCCAlWgAwIBAgIJALCSZLHy2iHQMA0GCSqGSIb3DQEBBQUAME0xCzAJBgNV -BAYTAlhZMSYwJAYDVQQKDB1QeXRob24gU29mdHdhcmUgRm91bmRhdGlvbiBDQTEW -MBQGA1UEAwwNb3VyLWNhLXNlcnZlcjAeFw0xMzAxMDQxOTQ3MDdaFw0yMzAxMDIx -OTQ3MDdaME0xCzAJBgNVBAYTAlhZMSYwJAYDVQQKDB1QeXRob24gU29mdHdhcmUg -Rm91bmRhdGlvbiBDQTEWMBQGA1UEAwwNb3VyLWNhLXNlcnZlcjCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBAOfe6eMMnwC2of0rW5bSb8zgvoa5IF7sA3pV -q+qk6flJhdJm1e3HeupWji2P50LiYiipn9Ybjuu1tJyfFKvf5pSLdh0+bSRh7Qy/ -AIphDN9cyDZzFgDNR7ptpKR0iIMjChn8Cac8SkvT5x0t5OpMVCHzJtuJNxjUArtA -Ml+k/y0c99S77I7PXIKs5nwIbEiFYQd/JeBc4Lw0X+C5BEd1yEcLjbzWyGhfM4Ni -0iBENbGtgRqKzbw1sFyLR9YY6ZwYl8wBPCnM6B7k5MG43ufCERiHWpM02KYl9xRx -6+QhotIPLi7UYgA109bvXGBLTKkU4t0VWEY3Mya35y5d7ULkxU0CAwEAAaNQME4w -HQYDVR0OBBYEFLzdYtl22hvSVGvP4GabHh57VgwLMB8GA1UdIwQYMBaAFLzdYtl2 -2hvSVGvP4GabHh57VgwLMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEB -AH0K9cuN0129mY74Kw+668LZpidPLnsvDmTYHDVQTu78kLmNbajFxgawr/Mtvzu4 -QgfdGH1tlVRXhRhgRy/reBv56Bf9Wg2HFyisTGrmvCn09FVwKULeheqrbCMGZDB1 -Ao5TvF4BMzfMHs24pP3K5F9lO4MchvFVAqA6j9uRt0AUtOeN0u5zuuPlNC28lG9O -JAb3X4sOp45r3l519DKaULFEM5rQBeJ4gv/b2opj66nd0b+gYa3jnookXWIO50yR -f+/fNDY7L131hLIvxG2TlhpvMCjx2hKaZLRAMx293itTqOq+1rxOlvVE+zIYrtUf -9mmvtk57HVjsO6lTo15YyJ4= ------END CERTIFICATE----- diff --git a/Lib/test/test_asyncio/ssl_cert.pem b/Lib/test/test_asyncio/ssl_cert.pem deleted file mode 100644 index 47a7d7e37e80..000000000000 --- a/Lib/test/test_asyncio/ssl_cert.pem +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICVDCCAb2gAwIBAgIJANfHOBkZr8JOMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV -BAYTAlhZMRcwFQYDVQQHEw5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9u -IFNvZnR3YXJlIEZvdW5kYXRpb24xEjAQBgNVBAMTCWxvY2FsaG9zdDAeFw0xMDEw -MDgyMzAxNTZaFw0yMDEwMDUyMzAxNTZaMF8xCzAJBgNVBAYTAlhZMRcwFQYDVQQH -Ew5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9uIFNvZnR3YXJlIEZvdW5k -YXRpb24xEjAQBgNVBAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAw -gYkCgYEA21vT5isq7F68amYuuNpSFlKDPrMUCa4YWYqZRt2OZ+/3NKaZ2xAiSwr7 -6MrQF70t5nLbSPpqE5+5VrS58SY+g/sXLiFd6AplH1wJZwh78DofbFYXUggktFMt -pTyiX8jtP66bkcPkDADA089RI1TQR6Ca+n7HFa7c1fabVV6i3zkCAwEAAaMYMBYw -FAYDVR0RBA0wC4IJbG9jYWxob3N0MA0GCSqGSIb3DQEBBQUAA4GBAHPctQBEQ4wd -BJ6+JcpIraopLn8BGhbjNWj40mmRqWB/NAWF6M5ne7KpGAu7tLeG4hb1zLaldK8G -lxy2GPSRF6LFS48dpEj2HbMv2nvv6xxalDMJ9+DicWgAKTQ6bcX2j3GUkCR0g/T1 -CRlNBAAlvhKzO7Clpf9l0YKBEfraJByX ------END CERTIFICATE----- diff --git a/Lib/test/test_asyncio/ssl_key.pem b/Lib/test/test_asyncio/ssl_key.pem deleted file mode 100644 index 3fd3bbd54a34..000000000000 --- a/Lib/test/test_asyncio/ssl_key.pem +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBANtb0+YrKuxevGpm -LrjaUhZSgz6zFAmuGFmKmUbdjmfv9zSmmdsQIksK++jK0Be9LeZy20j6ahOfuVa0 -ufEmPoP7Fy4hXegKZR9cCWcIe/A6H2xWF1IIJLRTLaU8ol/I7T+um5HD5AwAwNPP -USNU0Eegmvp+xxWu3NX2m1Veot85AgMBAAECgYA3ZdZ673X0oexFlq7AAmrutkHt -CL7LvwrpOiaBjhyTxTeSNWzvtQBkIU8DOI0bIazA4UreAFffwtvEuPmonDb3F+Iq -SMAu42XcGyVZEl+gHlTPU9XRX7nTOXVt+MlRRRxL6t9GkGfUAXI3XxJDXW3c0vBK -UL9xqD8cORXOfE06rQJBAP8mEX1ERkR64Ptsoe4281vjTlNfIbs7NMPkUnrn9N/Y -BLhjNIfQ3HFZG8BTMLfX7kCS9D593DW5tV4Z9BP/c6cCQQDcFzCcVArNh2JSywOQ -ZfTfRbJg/Z5Lt9Fkngv1meeGNPgIMLN8Sg679pAOOWmzdMO3V706rNPzSVMME7E5 -oPIfAkEA8pDddarP5tCvTTgUpmTFbakm0KoTZm2+FzHcnA4jRh+XNTjTOv98Y6Ik -eO5d1ZnKXseWvkZncQgxfdnMqqpj5wJAcNq/RVne1DbYlwWchT2Si65MYmmJ8t+F -0mcsULqjOnEMwf5e+ptq5LzwbyrHZYq5FNk7ocufPv/ZQrcSSC+cFwJBAKvOJByS -x56qyGeZLOQlWS2JS3KJo59XuLFGqcbgN9Om9xFa41Yb4N9NvplFivsvZdw3m1Q/ -SPIXQuT8RMPDVNQ= ------END PRIVATE KEY----- diff --git a/Lib/test/test_asyncio/utils.py b/Lib/test/test_asyncio/utils.py index e7438d40a441..a148f1639ecc 100644 --- a/Lib/test/test_asyncio/utils.py +++ b/Lib/test/test_asyncio/utils.py @@ -40,7 +40,7 @@ def data_file(filename): fullname = os.path.join(support.TEST_HOME_DIR, filename) if os.path.isfile(fullname): return fullname - fullname = os.path.join(os.path.dirname(__file__), filename) + fullname = os.path.join(os.path.dirname(__file__), '..', filename) if os.path.isfile(fullname): return fullname raise FileNotFoundError(filename) @@ -156,14 +156,8 @@ def finish_request(self, request, client_address): # contains the ssl key and certificate files) differs # between the stdlib and stand-alone asyncio. # Prefer our own if we can find it. - here = os.path.join(os.path.dirname(__file__), '..', 'tests') - if not os.path.isdir(here): - here = os.path.join(os.path.dirname(os.__file__), - 'test', 'test_asyncio') - keyfile = os.path.join(here, 'ssl_key.pem') - certfile = os.path.join(here, 'ssl_cert.pem') context = ssl.SSLContext() - context.load_cert_chain(certfile, keyfile) + context.load_cert_chain(ONLYCERT, ONLYKEY) ssock = context.wrap_socket(request, server_side=True) try: diff --git a/Misc/NEWS.d/next/Tests/2018-11-30-17-18-56.bpo-35352.8bD7GC.rst b/Misc/NEWS.d/next/Tests/2018-11-30-17-18-56.bpo-35352.8bD7GC.rst new file mode 100644 index 000000000000..e479e9612e72 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2018-11-30-17-18-56.bpo-35352.8bD7GC.rst @@ -0,0 +1 @@ +Modify test_asyncio to use the certificate set from the test directory. From webhook-mailer at python.org Fri Nov 30 14:44:47 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 30 Nov 2018 19:44:47 -0000 Subject: [Python-checkins] bpo-35352: test_asyncio uses the certificate set from the test directory (GH-10826) (GH-10832) Message-ID: https://github.com/python/cpython/commit/02250e57c37339ea6de08ab077a307e75eef02f5 commit: 02250e57c37339ea6de08ab077a307e75eef02f5 branch: 3.6 author: Victor Stinner committer: GitHub date: 2018-11-30T20:44:43+01:00 summary: bpo-35352: test_asyncio uses the certificate set from the test directory (GH-10826) (GH-10832) Modify asyncio tests to utilize the certificates from the test directory instead of its own set, as they are the same and with each update they had to be updated as well. (cherry picked from commit b062ba77b617b0f89b7ea25d14cc77c991462ad4) files: A Misc/NEWS.d/next/Tests/2018-11-30-17-18-56.bpo-35352.8bD7GC.rst D Lib/test/test_asyncio/keycert3.pem D Lib/test/test_asyncio/pycacert.pem D Lib/test/test_asyncio/ssl_cert.pem D Lib/test/test_asyncio/ssl_key.pem M Lib/asyncio/test_utils.py M Lib/test/test_asyncio/test_events.py diff --git a/Lib/asyncio/test_utils.py b/Lib/asyncio/test_utils.py index f41720428cec..116b3fcb3e25 100644 --- a/Lib/asyncio/test_utils.py +++ b/Lib/asyncio/test_utils.py @@ -42,6 +42,21 @@ from socket import socketpair # pragma: no cover +def data_file(filename): + if hasattr(support, 'TEST_HOME_DIR'): + fullname = os.path.join(support.TEST_HOME_DIR, filename) + if os.path.isfile(fullname): + return fullname + fullname = os.path.join(os.path.dirname(os.__file__), 'test', filename) + if os.path.isfile(fullname): + return fullname + raise FileNotFoundError(filename) + + +ONLYCERT = data_file('ssl_cert.pem') +ONLYKEY = data_file('ssl_key.pem') + + def dummy_ssl_context(): if ssl is None: return None @@ -114,12 +129,8 @@ def finish_request(self, request, client_address): # contains the ssl key and certificate files) differs # between the stdlib and stand-alone asyncio. # Prefer our own if we can find it. - here = os.path.join(os.path.dirname(__file__), '..', 'tests') - if not os.path.isdir(here): - here = os.path.join(os.path.dirname(os.__file__), - 'test', 'test_asyncio') - keyfile = os.path.join(here, 'ssl_key.pem') - certfile = os.path.join(here, 'ssl_cert.pem') + keyfile = ONLYKEY + certfile = ONLYCERT context = ssl.SSLContext() context.load_cert_chain(certfile, keyfile) diff --git a/Lib/test/test_asyncio/keycert3.pem b/Lib/test/test_asyncio/keycert3.pem deleted file mode 100644 index 5bfa62c4ca30..000000000000 --- a/Lib/test/test_asyncio/keycert3.pem +++ /dev/null @@ -1,73 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAMLgD0kAKDb5cFyP -jbwNfR5CtewdXC+kMXAWD8DLxiTTvhMW7qVnlwOm36mZlszHKvsRf05lT4pegiFM -9z2j1OlaN+ci/X7NU22TNN6crYSiN77FjYJP464j876ndSxyD+rzys386T+1r1aZ -aggEdkj1TsSsv1zWIYKlPIjlvhuxAgMBAAECgYA0aH+T2Vf3WOPv8KdkcJg6gCRe -yJKXOWgWRcicx/CUzOEsTxmFIDPLxqAWA3k7v0B+3vjGw5Y9lycV/5XqXNoQI14j -y09iNsumds13u5AKkGdTJnZhQ7UKdoVHfuP44ZdOv/rJ5/VD6F4zWywpe90pcbK+ -AWDVtusgGQBSieEl1QJBAOyVrUG5l2yoUBtd2zr/kiGm/DYyXlIthQO/A3/LngDW -5/ydGxVsT7lAVOgCsoT+0L4efTh90PjzW8LPQrPBWVMCQQDS3h/FtYYd5lfz+FNL -9CEe1F1w9l8P749uNUD0g317zv1tatIqVCsQWHfVHNdVvfQ+vSFw38OORO00Xqs9 -1GJrAkBkoXXEkxCZoy4PteheO/8IWWLGGr6L7di6MzFl1lIqwT6D8L9oaV2vynFT -DnKop0pa09Unhjyw57KMNmSE2SUJAkEArloTEzpgRmCq4IK2/NpCeGdHS5uqRlbh -1VIa/xGps7EWQl5Mn8swQDel/YP3WGHTjfx7pgSegQfkyaRtGpZ9OQJAa9Vumj8m -JAAtI0Bnga8hgQx7BhTQY4CadDxyiRGOGYhwUzYVCqkb2sbVRH9HnwUaJT7cWBY3 -RnJdHOMXWem7/w== ------END PRIVATE KEY----- -Certificate: - Data: - Version: 1 (0x0) - Serial Number: 12723342612721443281 (0xb09264b1f2da21d1) - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=XY, O=Python Software Foundation CA, CN=our-ca-server - Validity - Not Before: Jan 4 19:47:07 2013 GMT - Not After : Nov 13 19:47:07 2022 GMT - Subject: C=XY, L=Castle Anthrax, O=Python Software Foundation, CN=localhost - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - Public-Key: (1024 bit) - Modulus: - 00:c2:e0:0f:49:00:28:36:f9:70:5c:8f:8d:bc:0d: - 7d:1e:42:b5:ec:1d:5c:2f:a4:31:70:16:0f:c0:cb: - c6:24:d3:be:13:16:ee:a5:67:97:03:a6:df:a9:99: - 96:cc:c7:2a:fb:11:7f:4e:65:4f:8a:5e:82:21:4c: - f7:3d:a3:d4:e9:5a:37:e7:22:fd:7e:cd:53:6d:93: - 34:de:9c:ad:84:a2:37:be:c5:8d:82:4f:e3:ae:23: - f3:be:a7:75:2c:72:0f:ea:f3:ca:cd:fc:e9:3f:b5: - af:56:99:6a:08:04:76:48:f5:4e:c4:ac:bf:5c:d6: - 21:82:a5:3c:88:e5:be:1b:b1 - Exponent: 65537 (0x10001) - Signature Algorithm: sha1WithRSAEncryption - 2f:42:5f:a3:09:2c:fa:51:88:c7:37:7f:ea:0e:63:f0:a2:9a: - e5:5a:e2:c8:20:f0:3f:60:bc:c8:0f:b6:c6:76:ce:db:83:93: - f5:a3:33:67:01:8e:04:cd:00:9a:73:fd:f3:35:86:fa:d7:13: - e2:46:c6:9d:c0:29:53:d4:a9:90:b8:77:4b:e6:83:76:e4:92: - d6:9c:50:cf:43:d0:c6:01:77:61:9a:de:9b:70:f7:72:cd:59: - 00:31:69:d9:b4:ca:06:9c:6d:c3:c7:80:8c:68:e6:b5:a2:f8: - ef:1d:bb:16:9f:77:77:ef:87:62:22:9b:4d:69:a4:3a:1a:f1: - 21:5e:8c:32:ac:92:fd:15:6b:18:c2:7f:15:0d:98:30:ca:75: - 8f:1a:71:df:da:1d:b2:ef:9a:e8:2d:2e:02:fd:4a:3c:aa:96: - 0b:06:5d:35:b3:3d:24:87:4b:e0:b0:58:60:2f:45:ac:2e:48: - 8a:b0:99:10:65:27:ff:cc:b1:d8:fd:bd:26:6b:b9:0c:05:2a: - f4:45:63:35:51:07:ed:83:85:fe:6f:69:cb:bb:40:a8:ae:b6: - 3b:56:4a:2d:a4:ed:6d:11:2c:4d:ed:17:24:fd:47:bc:d3:41: - a2:d3:06:fe:0c:90:d8:d8:94:26:c4:ff:cc:a1:d8:42:77:eb: - fc:a9:94:71 ------BEGIN CERTIFICATE----- -MIICpDCCAYwCCQCwkmSx8toh0TANBgkqhkiG9w0BAQUFADBNMQswCQYDVQQGEwJY -WTEmMCQGA1UECgwdUHl0aG9uIFNvZnR3YXJlIEZvdW5kYXRpb24gQ0ExFjAUBgNV -BAMMDW91ci1jYS1zZXJ2ZXIwHhcNMTMwMTA0MTk0NzA3WhcNMjIxMTEzMTk0NzA3 -WjBfMQswCQYDVQQGEwJYWTEXMBUGA1UEBxMOQ2FzdGxlIEFudGhyYXgxIzAhBgNV -BAoTGlB5dGhvbiBTb2Z0d2FyZSBGb3VuZGF0aW9uMRIwEAYDVQQDEwlsb2NhbGhv -c3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMLgD0kAKDb5cFyPjbwNfR5C -tewdXC+kMXAWD8DLxiTTvhMW7qVnlwOm36mZlszHKvsRf05lT4pegiFM9z2j1Ola -N+ci/X7NU22TNN6crYSiN77FjYJP464j876ndSxyD+rzys386T+1r1aZaggEdkj1 -TsSsv1zWIYKlPIjlvhuxAgMBAAEwDQYJKoZIhvcNAQEFBQADggEBAC9CX6MJLPpR -iMc3f+oOY/CimuVa4sgg8D9gvMgPtsZ2ztuDk/WjM2cBjgTNAJpz/fM1hvrXE+JG -xp3AKVPUqZC4d0vmg3bkktacUM9D0MYBd2Ga3ptw93LNWQAxadm0ygacbcPHgIxo -5rWi+O8duxafd3fvh2Iim01ppDoa8SFejDKskv0VaxjCfxUNmDDKdY8acd/aHbLv -mugtLgL9SjyqlgsGXTWzPSSHS+CwWGAvRawuSIqwmRBlJ//Msdj9vSZruQwFKvRF -YzVRB+2Dhf5vacu7QKiutjtWSi2k7W0RLE3tFyT9R7zTQaLTBv4MkNjYlCbE/8yh -2EJ36/yplHE= ------END CERTIFICATE----- diff --git a/Lib/test/test_asyncio/pycacert.pem b/Lib/test/test_asyncio/pycacert.pem deleted file mode 100644 index 09b1f3e08aee..000000000000 --- a/Lib/test/test_asyncio/pycacert.pem +++ /dev/null @@ -1,78 +0,0 @@ -Certificate: - Data: - Version: 3 (0x2) - Serial Number: 12723342612721443280 (0xb09264b1f2da21d0) - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=XY, O=Python Software Foundation CA, CN=our-ca-server - Validity - Not Before: Jan 4 19:47:07 2013 GMT - Not After : Jan 2 19:47:07 2023 GMT - Subject: C=XY, O=Python Software Foundation CA, CN=our-ca-server - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - Public-Key: (2048 bit) - Modulus: - 00:e7:de:e9:e3:0c:9f:00:b6:a1:fd:2b:5b:96:d2: - 6f:cc:e0:be:86:b9:20:5e:ec:03:7a:55:ab:ea:a4: - e9:f9:49:85:d2:66:d5:ed:c7:7a:ea:56:8e:2d:8f: - e7:42:e2:62:28:a9:9f:d6:1b:8e:eb:b5:b4:9c:9f: - 14:ab:df:e6:94:8b:76:1d:3e:6d:24:61:ed:0c:bf: - 00:8a:61:0c:df:5c:c8:36:73:16:00:cd:47:ba:6d: - a4:a4:74:88:83:23:0a:19:fc:09:a7:3c:4a:4b:d3: - e7:1d:2d:e4:ea:4c:54:21:f3:26:db:89:37:18:d4: - 02:bb:40:32:5f:a4:ff:2d:1c:f7:d4:bb:ec:8e:cf: - 5c:82:ac:e6:7c:08:6c:48:85:61:07:7f:25:e0:5c: - e0:bc:34:5f:e0:b9:04:47:75:c8:47:0b:8d:bc:d6: - c8:68:5f:33:83:62:d2:20:44:35:b1:ad:81:1a:8a: - cd:bc:35:b0:5c:8b:47:d6:18:e9:9c:18:97:cc:01: - 3c:29:cc:e8:1e:e4:e4:c1:b8:de:e7:c2:11:18:87: - 5a:93:34:d8:a6:25:f7:14:71:eb:e4:21:a2:d2:0f: - 2e:2e:d4:62:00:35:d3:d6:ef:5c:60:4b:4c:a9:14: - e2:dd:15:58:46:37:33:26:b7:e7:2e:5d:ed:42:e4: - c5:4d - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Subject Key Identifier: - BC:DD:62:D9:76:DA:1B:D2:54:6B:CF:E0:66:9B:1E:1E:7B:56:0C:0B - X509v3 Authority Key Identifier: - keyid:BC:DD:62:D9:76:DA:1B:D2:54:6B:CF:E0:66:9B:1E:1E:7B:56:0C:0B - - X509v3 Basic Constraints: - CA:TRUE - Signature Algorithm: sha1WithRSAEncryption - 7d:0a:f5:cb:8d:d3:5d:bd:99:8e:f8:2b:0f:ba:eb:c2:d9:a6: - 27:4f:2e:7b:2f:0e:64:d8:1c:35:50:4e:ee:fc:90:b9:8d:6d: - a8:c5:c6:06:b0:af:f3:2d:bf:3b:b8:42:07:dd:18:7d:6d:95: - 54:57:85:18:60:47:2f:eb:78:1b:f9:e8:17:fd:5a:0d:87:17: - 28:ac:4c:6a:e6:bc:29:f4:f4:55:70:29:42:de:85:ea:ab:6c: - 23:06:64:30:75:02:8e:53:bc:5e:01:33:37:cc:1e:cd:b8:a4: - fd:ca:e4:5f:65:3b:83:1c:86:f1:55:02:a0:3a:8f:db:91:b7: - 40:14:b4:e7:8d:d2:ee:73:ba:e3:e5:34:2d:bc:94:6f:4e:24: - 06:f7:5f:8b:0e:a7:8e:6b:de:5e:75:f4:32:9a:50:b1:44:33: - 9a:d0:05:e2:78:82:ff:db:da:8a:63:eb:a9:dd:d1:bf:a0:61: - ad:e3:9e:8a:24:5d:62:0e:e7:4c:91:7f:ef:df:34:36:3b:2f: - 5d:f5:84:b2:2f:c4:6d:93:96:1a:6f:30:28:f1:da:12:9a:64: - b4:40:33:1d:bd:de:2b:53:a8:ea:be:d6:bc:4e:96:f5:44:fb: - 32:18:ae:d5:1f:f6:69:af:b6:4e:7b:1d:58:ec:3b:a9:53:a3: - 5e:58:c8:9e ------BEGIN CERTIFICATE----- -MIIDbTCCAlWgAwIBAgIJALCSZLHy2iHQMA0GCSqGSIb3DQEBBQUAME0xCzAJBgNV -BAYTAlhZMSYwJAYDVQQKDB1QeXRob24gU29mdHdhcmUgRm91bmRhdGlvbiBDQTEW -MBQGA1UEAwwNb3VyLWNhLXNlcnZlcjAeFw0xMzAxMDQxOTQ3MDdaFw0yMzAxMDIx -OTQ3MDdaME0xCzAJBgNVBAYTAlhZMSYwJAYDVQQKDB1QeXRob24gU29mdHdhcmUg -Rm91bmRhdGlvbiBDQTEWMBQGA1UEAwwNb3VyLWNhLXNlcnZlcjCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBAOfe6eMMnwC2of0rW5bSb8zgvoa5IF7sA3pV -q+qk6flJhdJm1e3HeupWji2P50LiYiipn9Ybjuu1tJyfFKvf5pSLdh0+bSRh7Qy/ -AIphDN9cyDZzFgDNR7ptpKR0iIMjChn8Cac8SkvT5x0t5OpMVCHzJtuJNxjUArtA -Ml+k/y0c99S77I7PXIKs5nwIbEiFYQd/JeBc4Lw0X+C5BEd1yEcLjbzWyGhfM4Ni -0iBENbGtgRqKzbw1sFyLR9YY6ZwYl8wBPCnM6B7k5MG43ufCERiHWpM02KYl9xRx -6+QhotIPLi7UYgA109bvXGBLTKkU4t0VWEY3Mya35y5d7ULkxU0CAwEAAaNQME4w -HQYDVR0OBBYEFLzdYtl22hvSVGvP4GabHh57VgwLMB8GA1UdIwQYMBaAFLzdYtl2 -2hvSVGvP4GabHh57VgwLMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEB -AH0K9cuN0129mY74Kw+668LZpidPLnsvDmTYHDVQTu78kLmNbajFxgawr/Mtvzu4 -QgfdGH1tlVRXhRhgRy/reBv56Bf9Wg2HFyisTGrmvCn09FVwKULeheqrbCMGZDB1 -Ao5TvF4BMzfMHs24pP3K5F9lO4MchvFVAqA6j9uRt0AUtOeN0u5zuuPlNC28lG9O -JAb3X4sOp45r3l519DKaULFEM5rQBeJ4gv/b2opj66nd0b+gYa3jnookXWIO50yR -f+/fNDY7L131hLIvxG2TlhpvMCjx2hKaZLRAMx293itTqOq+1rxOlvVE+zIYrtUf -9mmvtk57HVjsO6lTo15YyJ4= ------END CERTIFICATE----- diff --git a/Lib/test/test_asyncio/ssl_cert.pem b/Lib/test/test_asyncio/ssl_cert.pem deleted file mode 100644 index 47a7d7e37e80..000000000000 --- a/Lib/test/test_asyncio/ssl_cert.pem +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICVDCCAb2gAwIBAgIJANfHOBkZr8JOMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV -BAYTAlhZMRcwFQYDVQQHEw5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9u -IFNvZnR3YXJlIEZvdW5kYXRpb24xEjAQBgNVBAMTCWxvY2FsaG9zdDAeFw0xMDEw -MDgyMzAxNTZaFw0yMDEwMDUyMzAxNTZaMF8xCzAJBgNVBAYTAlhZMRcwFQYDVQQH -Ew5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9uIFNvZnR3YXJlIEZvdW5k -YXRpb24xEjAQBgNVBAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAw -gYkCgYEA21vT5isq7F68amYuuNpSFlKDPrMUCa4YWYqZRt2OZ+/3NKaZ2xAiSwr7 -6MrQF70t5nLbSPpqE5+5VrS58SY+g/sXLiFd6AplH1wJZwh78DofbFYXUggktFMt -pTyiX8jtP66bkcPkDADA089RI1TQR6Ca+n7HFa7c1fabVV6i3zkCAwEAAaMYMBYw -FAYDVR0RBA0wC4IJbG9jYWxob3N0MA0GCSqGSIb3DQEBBQUAA4GBAHPctQBEQ4wd -BJ6+JcpIraopLn8BGhbjNWj40mmRqWB/NAWF6M5ne7KpGAu7tLeG4hb1zLaldK8G -lxy2GPSRF6LFS48dpEj2HbMv2nvv6xxalDMJ9+DicWgAKTQ6bcX2j3GUkCR0g/T1 -CRlNBAAlvhKzO7Clpf9l0YKBEfraJByX ------END CERTIFICATE----- diff --git a/Lib/test/test_asyncio/ssl_key.pem b/Lib/test/test_asyncio/ssl_key.pem deleted file mode 100644 index 3fd3bbd54a34..000000000000 --- a/Lib/test/test_asyncio/ssl_key.pem +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBANtb0+YrKuxevGpm -LrjaUhZSgz6zFAmuGFmKmUbdjmfv9zSmmdsQIksK++jK0Be9LeZy20j6ahOfuVa0 -ufEmPoP7Fy4hXegKZR9cCWcIe/A6H2xWF1IIJLRTLaU8ol/I7T+um5HD5AwAwNPP -USNU0Eegmvp+xxWu3NX2m1Veot85AgMBAAECgYA3ZdZ673X0oexFlq7AAmrutkHt -CL7LvwrpOiaBjhyTxTeSNWzvtQBkIU8DOI0bIazA4UreAFffwtvEuPmonDb3F+Iq -SMAu42XcGyVZEl+gHlTPU9XRX7nTOXVt+MlRRRxL6t9GkGfUAXI3XxJDXW3c0vBK -UL9xqD8cORXOfE06rQJBAP8mEX1ERkR64Ptsoe4281vjTlNfIbs7NMPkUnrn9N/Y -BLhjNIfQ3HFZG8BTMLfX7kCS9D593DW5tV4Z9BP/c6cCQQDcFzCcVArNh2JSywOQ -ZfTfRbJg/Z5Lt9Fkngv1meeGNPgIMLN8Sg679pAOOWmzdMO3V706rNPzSVMME7E5 -oPIfAkEA8pDddarP5tCvTTgUpmTFbakm0KoTZm2+FzHcnA4jRh+XNTjTOv98Y6Ik -eO5d1ZnKXseWvkZncQgxfdnMqqpj5wJAcNq/RVne1DbYlwWchT2Si65MYmmJ8t+F -0mcsULqjOnEMwf5e+ptq5LzwbyrHZYq5FNk7ocufPv/ZQrcSSC+cFwJBAKvOJByS -x56qyGeZLOQlWS2JS3KJo59XuLFGqcbgN9Om9xFa41Yb4N9NvplFivsvZdw3m1Q/ -SPIXQuT8RMPDVNQ= ------END PRIVATE KEY----- diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py index b024ef4ca007..91d8a964f162 100644 --- a/Lib/test/test_asyncio/test_events.py +++ b/Lib/test/test_asyncio/test_events.py @@ -32,23 +32,13 @@ from asyncio import selector_events from asyncio import sslproto from asyncio import test_utils +from asyncio.test_utils import ONLYKEY, ONLYCERT, data_file try: from test import support except ImportError: from asyncio import test_support as support -def data_file(filename): - if hasattr(support, 'TEST_HOME_DIR'): - fullname = os.path.join(support.TEST_HOME_DIR, filename) - if os.path.isfile(fullname): - return fullname - fullname = os.path.join(os.path.dirname(__file__), filename) - if os.path.isfile(fullname): - return fullname - raise FileNotFoundError(filename) - - def osx_tiger(): """Return True if the platform is Mac OS 10.4 or older.""" if sys.platform != 'darwin': @@ -67,10 +57,8 @@ def _test_get_event_loop_new_process__sub_proc(): return loop.run_until_complete(doit()) -ONLYCERT = data_file('ssl_cert.pem') -ONLYKEY = data_file('ssl_key.pem') -SIGNED_CERTFILE = data_file('keycert3.pem') -SIGNING_CA = data_file('pycacert.pem') +SIGNED_CERTFILE = test_utils.data_file('keycert3.pem') +SIGNING_CA = test_utils.data_file('pycacert.pem') PEERCERT = { 'OCSP': ('http://testca.pythontest.net/testca/ocsp/',), 'caIssuers': ('http://testca.pythontest.net/testca/pycacert.cer',), diff --git a/Misc/NEWS.d/next/Tests/2018-11-30-17-18-56.bpo-35352.8bD7GC.rst b/Misc/NEWS.d/next/Tests/2018-11-30-17-18-56.bpo-35352.8bD7GC.rst new file mode 100644 index 000000000000..e479e9612e72 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2018-11-30-17-18-56.bpo-35352.8bD7GC.rst @@ -0,0 +1 @@ +Modify test_asyncio to use the certificate set from the test directory. From webhook-mailer at python.org Fri Nov 30 14:45:08 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 30 Nov 2018 19:45:08 -0000 Subject: [Python-checkins] Replace 1/0 with 1//0 in tests to avoid Python 3 warns (GH-10833) Message-ID: https://github.com/python/cpython/commit/2212ee2bee70fc9b4c76e79cc532f52673e5a13f commit: 2212ee2bee70fc9b4c76e79cc532f52673e5a13f branch: 2.7 author: Victor Stinner committer: GitHub date: 2018-11-30T20:45:04+01:00 summary: Replace 1/0 with 1//0 in tests to avoid Python 3 warns (GH-10833) Fix DeprecationWarning when tests are run using python -3. files: M Lib/test/test_bdb.py M Lib/test/test_gdb.py M Lib/test/test_sys_settrace.py diff --git a/Lib/test/test_bdb.py b/Lib/test/test_bdb.py index 4fb7c79cdcc5..d3ff8fc76860 100644 --- a/Lib/test/test_bdb.py +++ b/Lib/test/test_bdb.py @@ -868,7 +868,7 @@ def main(): with create_modules(modules): self.expect_set = [ ('line', 2, 'tfunc_import'), - break_in_func('func', TEST_MODULE_FNAME, False, '1 / 0'), + break_in_func('func', TEST_MODULE_FNAME, False, '1 // 0'), ('None', 2, 'tfunc_import'), ('continue', ), ('line', 3, 'func', ({1:1}, [])), ('quit', ), ] diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py index 118dbbf0d9ef..335e48a24e68 100644 --- a/Lib/test/test_gdb.py +++ b/Lib/test/test_gdb.py @@ -423,7 +423,7 @@ def test_exceptions(self): # Test division by zero: gdb_repr, gdb_output = self.get_gdb_repr(''' try: - a = 1 / 0 + a = 1 // 0 except ZeroDivisionError, e: print e ''') diff --git a/Lib/test/test_sys_settrace.py b/Lib/test/test_sys_settrace.py index d8737af3bc8d..b6695fe012f8 100644 --- a/Lib/test/test_sys_settrace.py +++ b/Lib/test/test_sys_settrace.py @@ -1053,7 +1053,7 @@ def test_no_jump_from_return_event(output): "can only jump from a 'line' trace event")) def test_no_jump_from_exception_event(output): output.append(1) - 1 / 0 + 1 // 0 @jump_test(3, 2, [2], event='return', error=(ValueError, "can't jump from a yield statement")) From webhook-mailer at python.org Fri Nov 30 18:39:41 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 30 Nov 2018 23:39:41 -0000 Subject: [Python-checkins] get_gmtoff() now returns time_t (GH-10838) Message-ID: https://github.com/python/cpython/commit/503ce5c482cb267b0770bc46c315d5cf822bdca9 commit: 503ce5c482cb267b0770bc46c315d5cf822bdca9 branch: master author: Victor Stinner committer: GitHub date: 2018-12-01T00:39:36+01:00 summary: get_gmtoff() now returns time_t (GH-10838) get_gmtoff() now returns time_t instead of int to fix the following Visual Studio warning: Modules\timemodule.c(1183): warning C4244: 'return': conversion from 'time_t' to 'int', possible loss of data files: M Modules/timemodule.c diff --git a/Modules/timemodule.c b/Modules/timemodule.c index 55b82d74cb19..188f1e6ef571 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -1019,7 +1019,7 @@ of the timezone or altzone attributes on the time module."); #endif /* HAVE_MKTIME */ #ifdef HAVE_WORKING_TZSET -static void PyInit_timezone(PyObject *module); +static int PyInit_timezone(PyObject *module); static PyObject * time_tzset(PyObject *self, PyObject *unused) @@ -1034,7 +1034,9 @@ time_tzset(PyObject *self, PyObject *unused) tzset(); /* Reset timezone, altzone, daylight and tzname */ - PyInit_timezone(m); + if (PyInit_timezone(m) < 0) { + return NULL; + } Py_DECREF(m); if (PyErr_Occurred()) return NULL; @@ -1535,7 +1537,7 @@ get_zone(char *zone, int n, struct tm *p) #endif } -static int +static time_t get_gmtoff(time_t t, struct tm *p) { #ifdef HAVE_STRUCT_TM_TM_ZONE @@ -1546,8 +1548,11 @@ get_gmtoff(time_t t, struct tm *p) } #endif // !HAVE_DECL_TZNAME -static void -PyInit_timezone(PyObject *m) { +static int +PyInit_timezone(PyObject *m) +{ + assert(!PyErr_Occurred()); + /* This code moved from PyInit_time wholesale to allow calling it from time_tzset. In the future, some parts of it can be moved back (for platforms that don't HAVE_WORKING_TZSET, when we know what they @@ -1591,19 +1596,31 @@ PyInit_timezone(PyObject *m) { static const time_t YEAR = (365 * 24 + 6) * 3600; time_t t; struct tm p; - long janzone, julyzone; + time_t janzone_t, julyzone_t; char janname[10], julyname[10]; t = (time((time_t *)0) / YEAR) * YEAR; _PyTime_localtime(t, &p); get_zone(janname, 9, &p); - janzone = -get_gmtoff(t, &p); + janzone_t = -get_gmtoff(t, &p); janname[9] = '\0'; t += YEAR/2; _PyTime_localtime(t, &p); get_zone(julyname, 9, &p); - julyzone = -get_gmtoff(t, &p); + julyzone_t = -get_gmtoff(t, &p); julyname[9] = '\0'; + /* Sanity check, don't check for the validity of timezones. + In practice, it should be more in range -12 hours .. +14 hours. */ +#define MAX_TIMEZONE (48 * 3600) + if (janzone_t < -MAX_TIMEZONE || janzone_t > MAX_TIMEZONE + || julyzone_t < -MAX_TIMEZONE || julyzone_t > MAX_TIMEZONE) + { + PyErr_SetString(PyExc_RuntimeError, "invalid GMT offset"); + return -1; + } + int janzone = (int)janzone_t; + int julyzone = (int)julyzone_t; + PyObject *tzname_obj; if (janzone < julyzone) { /* DST is reversed in the southern hemisphere */ @@ -1617,10 +1634,16 @@ PyInit_timezone(PyObject *m) { PyModule_AddIntConstant(m, "daylight", janzone != julyzone); tzname_obj = Py_BuildValue("(zz)", janname, julyname); } - if (tzname_obj == NULL) - return; + if (tzname_obj == NULL) { + return -1; + } PyModule_AddObject(m, "tzname", tzname_obj); #endif // !HAVE_DECL_TZNAME + + if (PyErr_Occurred()) { + return -1; + } + return 0; } @@ -1721,7 +1744,9 @@ PyInit_time(void) return NULL; /* Set, or reset, module variables like time.timezone */ - PyInit_timezone(m); + if (PyInit_timezone(m) < 0) { + return NULL; + } #if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_CLOCK_SETTIME) || defined(HAVE_CLOCK_GETRES) From webhook-mailer at python.org Fri Nov 30 19:24:19 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Sat, 01 Dec 2018 00:24:19 -0000 Subject: [Python-checkins] get_gmtoff() now returns time_t (GH-10838) (GH-10840) Message-ID: https://github.com/python/cpython/commit/6c3f272b01c5d327e97f65115217e283103f7c66 commit: 6c3f272b01c5d327e97f65115217e283103f7c66 branch: 3.6 author: Victor Stinner committer: GitHub date: 2018-12-01T01:24:16+01:00 summary: get_gmtoff() now returns time_t (GH-10838) (GH-10840) get_gmtoff() now returns time_t instead of int to fix the following Visual Studio warning: Modules\timemodule.c(1183): warning C4244: 'return': conversion from 'time_t' to 'int', possible loss of data (cherry picked from commit 503ce5c482cb267b0770bc46c315d5cf822bdca9) files: M Modules/timemodule.c diff --git a/Modules/timemodule.c b/Modules/timemodule.c index 6bb1ffb163d7..0bc32083e006 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -860,7 +860,7 @@ of the timezone or altzone attributes on the time module."); #endif /* HAVE_MKTIME */ #ifdef HAVE_WORKING_TZSET -static void PyInit_timezone(PyObject *module); +static int PyInit_timezone(PyObject *module); static PyObject * time_tzset(PyObject *self, PyObject *unused) @@ -875,7 +875,9 @@ time_tzset(PyObject *self, PyObject *unused) tzset(); /* Reset timezone, altzone, daylight and tzname */ - PyInit_timezone(m); + if (PyInit_timezone(m) < 0) { + return NULL; + } Py_DECREF(m); if (PyErr_Occurred()) return NULL; @@ -1174,7 +1176,7 @@ get_zone(char *zone, int n, struct tm *p) #endif } -static int +static time_t get_gmtoff(time_t t, struct tm *p) { #ifdef HAVE_STRUCT_TM_TM_ZONE @@ -1184,8 +1186,11 @@ get_gmtoff(time_t t, struct tm *p) #endif } -static void -PyInit_timezone(PyObject *m) { +static int +PyInit_timezone(PyObject *m) +{ + assert(!PyErr_Occurred()); + /* This code moved from PyInit_time wholesale to allow calling it from time_tzset. In the future, some parts of it can be moved back (for platforms that don't HAVE_WORKING_TZSET, when we know what they @@ -1220,19 +1225,31 @@ PyInit_timezone(PyObject *m) { #define YEAR ((time_t)((365 * 24 + 6) * 3600)) time_t t; struct tm p; - long janzone, julyzone; + time_t janzone_t, julyzone_t; char janname[10], julyname[10]; t = (time((time_t *)0) / YEAR) * YEAR; _PyTime_localtime(t, &p); get_zone(janname, 9, &p); - janzone = -get_gmtoff(t, &p); + janzone_t = -get_gmtoff(t, &p); janname[9] = '\0'; t += YEAR/2; _PyTime_localtime(t, &p); get_zone(julyname, 9, &p); - julyzone = -get_gmtoff(t, &p); + julyzone_t = -get_gmtoff(t, &p); julyname[9] = '\0'; + /* Sanity check, don't check for the validity of timezones. + In practice, it should be more in range -12 hours .. +14 hours. */ +#define MAX_TIMEZONE (48 * 3600) + if (janzone_t < -MAX_TIMEZONE || janzone_t > MAX_TIMEZONE + || julyzone_t < -MAX_TIMEZONE || julyzone_t > MAX_TIMEZONE) + { + PyErr_SetString(PyExc_RuntimeError, "invalid GMT offset"); + return -1; + } + int janzone = (int)janzone_t; + int julyzone = (int)julyzone_t; + if( janzone < julyzone ) { /* DST is reversed in the southern hemisphere */ PyModule_AddIntConstant(m, "timezone", julyzone); @@ -1261,6 +1278,7 @@ PyInit_timezone(PyObject *m) { Py_BuildValue("(zz)", _tzname[0], _tzname[1])); #endif /* __CYGWIN__ */ #endif /* !HAVE_TZNAME || __GLIBC__ || __CYGWIN__*/ + return 0; } @@ -1348,7 +1366,9 @@ PyInit_time(void) return NULL; /* Set, or reset, module variables like time.timezone */ - PyInit_timezone(m); + if (PyInit_timezone(m) < 0) { + return NULL; + } #if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_CLOCK_SETTIME) || defined(HAVE_CLOCK_GETRES) From webhook-mailer at python.org Fri Nov 30 19:24:24 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Sat, 01 Dec 2018 00:24:24 -0000 Subject: [Python-checkins] get_gmtoff() now returns time_t (GH-10838) (GH-10839) Message-ID: https://github.com/python/cpython/commit/38c06d9193b874fd440a874bf34227d837cb49c0 commit: 38c06d9193b874fd440a874bf34227d837cb49c0 branch: 3.7 author: Victor Stinner committer: GitHub date: 2018-12-01T01:24:21+01:00 summary: get_gmtoff() now returns time_t (GH-10838) (GH-10839) get_gmtoff() now returns time_t instead of int to fix the following Visual Studio warning: Modules\timemodule.c(1183): warning C4244: 'return': conversion from 'time_t' to 'int', possible loss of data (cherry picked from commit 503ce5c482cb267b0770bc46c315d5cf822bdca9) files: M Modules/timemodule.c diff --git a/Modules/timemodule.c b/Modules/timemodule.c index cd287f595b14..6cf9e7c641e3 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -994,7 +994,7 @@ of the timezone or altzone attributes on the time module."); #endif /* HAVE_MKTIME */ #ifdef HAVE_WORKING_TZSET -static void PyInit_timezone(PyObject *module); +static int PyInit_timezone(PyObject *module); static PyObject * time_tzset(PyObject *self, PyObject *unused) @@ -1009,7 +1009,9 @@ time_tzset(PyObject *self, PyObject *unused) tzset(); /* Reset timezone, altzone, daylight and tzname */ - PyInit_timezone(m); + if (PyInit_timezone(m) < 0) { + return NULL; + } Py_DECREF(m); if (PyErr_Occurred()) return NULL; @@ -1510,7 +1512,7 @@ get_zone(char *zone, int n, struct tm *p) #endif } -static int +static time_t get_gmtoff(time_t t, struct tm *p) { #ifdef HAVE_STRUCT_TM_TM_ZONE @@ -1521,8 +1523,11 @@ get_gmtoff(time_t t, struct tm *p) } #endif /* !defined(HAVE_TZNAME) || defined(__GLIBC__) || defined(__CYGWIN__) */ -static void -PyInit_timezone(PyObject *m) { +static int +PyInit_timezone(PyObject *m) +{ + assert(!PyErr_Occurred()); + /* This code moved from PyInit_time wholesale to allow calling it from time_tzset. In the future, some parts of it can be moved back (for platforms that don't HAVE_WORKING_TZSET, when we know what they @@ -1557,19 +1562,31 @@ PyInit_timezone(PyObject *m) { #define YEAR ((time_t)((365 * 24 + 6) * 3600)) time_t t; struct tm p; - long janzone, julyzone; + time_t janzone_t, julyzone_t; char janname[10], julyname[10]; t = (time((time_t *)0) / YEAR) * YEAR; _PyTime_localtime(t, &p); get_zone(janname, 9, &p); - janzone = -get_gmtoff(t, &p); + janzone_t = -get_gmtoff(t, &p); janname[9] = '\0'; t += YEAR/2; _PyTime_localtime(t, &p); get_zone(julyname, 9, &p); - julyzone = -get_gmtoff(t, &p); + julyzone_t = -get_gmtoff(t, &p); julyname[9] = '\0'; + /* Sanity check, don't check for the validity of timezones. + In practice, it should be more in range -12 hours .. +14 hours. */ +#define MAX_TIMEZONE (48 * 3600) + if (janzone_t < -MAX_TIMEZONE || janzone_t > MAX_TIMEZONE + || julyzone_t < -MAX_TIMEZONE || julyzone_t > MAX_TIMEZONE) + { + PyErr_SetString(PyExc_RuntimeError, "invalid GMT offset"); + return -1; + } + int janzone = (int)janzone_t; + int julyzone = (int)julyzone_t; + if( janzone < julyzone ) { /* DST is reversed in the southern hemisphere */ PyModule_AddIntConstant(m, "timezone", julyzone); @@ -1598,6 +1615,7 @@ PyInit_timezone(PyObject *m) { Py_BuildValue("(zz)", _tzname[0], _tzname[1])); #endif /* __CYGWIN__ */ #endif /* !HAVE_TZNAME || __GLIBC__ || __CYGWIN__*/ + return 0; } @@ -1698,7 +1716,9 @@ PyInit_time(void) return NULL; /* Set, or reset, module variables like time.timezone */ - PyInit_timezone(m); + if (PyInit_timezone(m) < 0) { + return NULL; + } #if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_CLOCK_SETTIME) || defined(HAVE_CLOCK_GETRES) From webhook-mailer at python.org Fri Nov 30 20:46:52 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Sat, 01 Dec 2018 01:46:52 -0000 Subject: [Python-checkins] Fix compiler warning in structseq_repr() (GH-10841) Message-ID: https://github.com/python/cpython/commit/989052047eea7f35da0d7ca268791b2442ee1553 commit: 989052047eea7f35da0d7ca268791b2442ee1553 branch: master author: Victor Stinner committer: GitHub date: 2018-12-01T02:46:40+01:00 summary: Fix compiler warning in structseq_repr() (GH-10841) Replace strncpy() with memcpy() in structseq_repr() to fix the following compiler warning: Objects/structseq.c:187:5: warning: 'strncpy' specified bound depends on the length of the source argument [-Wstringop-overflow=] strncpy(pbuf, typ->tp_name, len); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Objects/structseq.c:185:11: note: length computed here len = strlen(typ->tp_name) > TYPE_MAXSIZE ? TYPE_MAXSIZE : The function writes the terminating NUL byte later. files: M Objects/structseq.c diff --git a/Objects/structseq.c b/Objects/structseq.c index 05ea87b67a82..cf94155f18f8 100644 --- a/Objects/structseq.c +++ b/Objects/structseq.c @@ -182,9 +182,9 @@ structseq_repr(PyStructSequence *obj) endofbuf= &buf[REPR_BUFFER_SIZE-5]; /* "typename(", limited to TYPE_MAXSIZE */ - len = strlen(typ->tp_name) > TYPE_MAXSIZE ? TYPE_MAXSIZE : - strlen(typ->tp_name); - strncpy(pbuf, typ->tp_name, len); + len = strlen(typ->tp_name); + len = Py_MIN(len, TYPE_MAXSIZE); + memcpy(pbuf, typ->tp_name, len); pbuf += len; *pbuf++ = '(';